JavaScript is hard!

I know I have been talking and writing a lot lately about the usual arguments in favor of hybrid app development. This post by Alfred Beiley inspired me to write another post specifically about certain JavaScript misconceptions. Before I begin, let me state that I highly respect Alfred’s professional opinions and that this is in no way meant to discredit him in any way. It is this kind of discussion that keeps us going and getting better, bringing our craft forward.

That being said, I believe he is all wrong regarding hybrid mobile development :-)

Especially in regards to JavaScript. For some reasons I try to explain below, people still tend to believe that JavaScript is easy and that you can go and turn a web site developer into a hybrid mobile web developer with ease. This is not the case, and if you don’t believe me, you might believe Douglas Crockford:

Most of the people writing in JavaScript are not programmers. They lack the training and discipline to write good programs. JavaScript has so much expressive power that they are able to do useful things in it, anyway. This has given JavaScript a reputation of being strictly for the amateurs, that it is not suitable for professional programming. This is simply not the case.

I think the language name is part of the problem. The suffix “script” gives it a derogatory feeling. “It’s just a little script I wrote”. Also the fact that, for many years, the main usage of JavaScript was to do visually appealing hover effects on website buttons doesn’t really give it a professional connotation.

Before node.js made JavaScript really popular outside of the browser, you could get away with throwing jQuery[mobile] into your pages and do the craziest DOM manipulations in order to get more complex tasks done. The thing to note here is that all of this is just UI work and 3rd party frameworks. And these are replaceable details that have to be interfaced away, at least in my books. Have you ever come across a complex web application, mobile or not, that is not completely tied to one or more specific JavaScript libraries? What would happen if you would want to replace one such library by another in the future? Most probably the total rewrite dance. Not good.

JavaScript is hard. Prototypical inheritance is not intuitive. If you learned class based inheritance with Java or C++, you will have a steep learning curve to climb with JavaScript. Also there is no compiler, so you have to revert to linting to avoid common mistakes, which encourages you to write even better and cleaner code than is possible with, for example, C++.

And then there is the development of complex applications. This involves organizing code, programming against interfaces, producing testable code, making use of inheritance, interfacing external dependencies away, and much more. I wonder how many JavaScript developers can implement the GoF patterns. I am sure most C++ and Java devs can implement at least the most common ones.

Ultimately, and this is a mobile only problem, hybrid apps are much harder to debug than native ones. Safari just recently introduced a debug bridge that supports attaching to a running web view. On the Android side this is also possible with Chrome, but only for Android 4.4 and higher. When chasing complex defects this can be a nightmare, so your code better be good and nicely structured.

What I am saying is, JavaScript is hard. Developing mobile Apps with JavaScript is even harder. Consider this before jumping on the hybrid wagon in your next project.


11 Responses to “JavaScript is hard!”

  1. Jung 21/03/2015 at 1:25 pm #

    I see you don’t use the power of social websites like pinterest and facebook
    on your blog. You can get huge traffic from social sites on autopilot using one useful app, for
    more details search in google for:
    Alufi’s Social Automation

    • Robbie 29/04/2016 at 11:34 pm #

      That’s a genuinely imvprssiee answer.

    • 01/05/2016 at 3:15 am #

      OH MERCI BEAUCOUP je suis très contente que ça te plaise et que ça t’ait fait rire, c’est le but !! J’espère que tu continueras à trouver ton bonheur ici Plein de bisous

    • 01/05/2016 at 3:27 am #

      Ooh, I’m due in July and would LOVE this baby book. My favorite childhood memory is taking road trips with my family “up north” to the lake. We would pack grandparents, kids a d dog into a suburban and all stay together in one cabin for a week every summer. Fun to learn about the turtles, fish, chipmunks, and even a few raccoons with your grandpa.

    • 13/05/2016 at 3:03 am #

      I agree with those that say money doesn’t buy happiness but makes getting there a heck of a lot easier! I would be very happy to know that I could pay the rent and buy groceries and still be able to buy that sweatshirt I saw in a store that was sooo cute…and not have to worry that now I won’t be able to pay the phone bill or fix my car if something happens!

    • 08/07/2016 at 4:01 pm #

      Hello! I’m at work browsing your blog from my new iphone 4! Just wanted to say I love reading through your blog and look forward to all your posts! Carry on the fantastic work!

    • 01/08/2016 at 5:16 pm #

      Et je ne vous parle même pas de l’administration : 1 an, 6 visites et 20€ escroqués par la commune en plus des 20€ standards, rien que pour avoir une carte de résident, qui permet d’avoir un numéro national, qui permet d’avoir un emploi, qui permet d’avoir un loge…etc, etc.

    • http://www./ 24/10/2016 at 9:45 am #

      tea kept reminding me of something I’d had before and I just realized what it is; emoliente!  I drank emoliente from street vendors in Peru and once or twice bought packs of herbs and mixed

    • deutsche bank kredit erfahrung 12/02/2017 at 6:49 pm #

      Jo visst gÃ¥r det fort! Det som kändes sÃ¥ lÃ¥ngt fram när vi började jobba i höst…Hoppas huvudvärken blir bättre, kramisar Suss

    • grocery coupons 22/03/2017 at 10:13 am #

      31 yr old male here too.decided against buying a couple of years ago because I thought the price was too inflated already at that time. Never in a million years would I think the price will keep on increasing in the last couple of years…

  2. Columbus 13/09/2016 at 2:58 am #

    If you are interested in topic: how to earn money online by making websites – you should read
    about Bucksflooder first

Leave a Reply