Home > English, JavaScript, Programming, Testing > Go learn JavaScript!

Go learn JavaScript!


This post comes late, as I have realized this late myself.
But it is not late enough to be useless, because most developers out there still haven’t learned JavaScript.

If you work with development of some sort, big chances are you work with web development.
If you work with web development, regardless of the technology stack – be it Java, .NET, Ruby, Python, Perl or Brainfuck – your application runs on a browser, and all browsers run JavaScript, so you can’t escape from it. *

That said, once you have learned JavaScript, you will find out that programming in JavaScript is actually fun!
I have gone through this myself as I have seen colleagues going through this too.
Not only you will find out it is fun, you will see how JavaScript is a powerful language that has lots of good things that you will start to wish other languages also had.

Most important of all: your JavaScript code will start to look good.
And once all developers in your team have learned that learning JavaScript is not only important, but necessary, your project’s JavaScript codebase will stop looking horrendous as it does nowadays. It will look good, modularized and testable. And you won’t ever again go “Oh crap, I have to touch JavaScript in this story…”.

Wait, did I say testable? Yes, I did! You can actually TDD your JavaScript code as well as you can TDD your <favorite language> code.
For that I recommend Jasmine, have been using it in our project, love it.
You can even combine Jasmine with Rhino or WebDriver and add your JavaScript tests to your Continuous Integration pipeline. (Your project has a CI server, right?!)

And you know what? Learning JavaScript is EASY!
I believe most developers familiar with any OO language wouldn’t need more than a couple of days to start writing more than decent JavaScript code.
There’s plenty of good websites and books out there for you to learn it, so go on and have fun!

* Ok, actually, you can escape from writing JavaScript.
You could go with GWT for instance. And I remember there were other frameworks that let you develop the whole fancy UI on Java on the server side, sending only few instructions to the client – I can’t recall any names right now.
The thing is: is it worth it?
I worked with GWT for a considerable time in 2009 and, now that I have had more JavaScript experience, I definitely wouldn’t go back to GWT. It just seems like a lot more work to do, not to mention the messy HTML and CSSs it generates.
If you’d like to have your JavaScript compiled from something else, take a look at CoffeeScript 😉

  1. December 9, 2010 at 03:47

    Nice post, I’ve been coming to this realization myself. Seems like JavaScript always seems to pop up everywhere, but I always bump it down my “to learn” list in lieu of some other language that seems more “exciting”.

    • December 10, 2010 at 03:37

      Give js a chance and you’ll see how exciting it can be 🙂

  2. timurstrekalov
    December 9, 2010 at 10:35

    I’ve been telling that to everybody all along, but does anyone ever listen to me? Nooo… 🙂 Yeah, JS really is a beautiful language, with all its ifs and buts and dos and don’ts, but it’s still cool 🙂

    About the IoC thing we were talking about on the chat sometime ago: I’ve started my first steps working on an open source ‘version’ of it – basically, from scratch 🙂 I’ll share my results with you whenever I’m ready 😉

  3. timurstrekalov
    December 9, 2010 at 10:38

    As for ‘server-side Java frameworks, generating JS UI code’, I think you might be referring to JSF, for example… what a crock of shite, if you ask me 🙂

    And yeah, I’ve also lost faith in GWT recently. The development cycle is still no good.

    No, JS is as good as it’s ever gonna be – new features and cross-browser compatibility is welcome, of course, but it’s alright even now 😉

    • December 10, 2010 at 03:42

      Hmmm, not really JSF. Remember when we were about to start AMS 2.0 and we checked out many options? Some of them were similar to GWT, with the difference that the code ran on the server side. I don’t remember any names though.
      And please let me know about ioc thingy 😛
      As for gwt, indeed I think Then & Now would’ve come out much easier if we had taken a couple of days to learn js before.

      • Anonymous
        December 10, 2010 at 10:18

        then you must mean all the bs like Laszlo, ZK, Echo3.. yeah, learning JS is easier and more beneficial in the long run anyway 😀

        as for T&N – I fully agree 🙂

      • timurstrekalov
        December 10, 2010 at 10:20

        crappy crap, that was me, didn’t notice I wasn’t logged in 🙂

  4. macskeptic
    December 9, 2010 at 18:06

    I couldn’t agree more 😉

    Once you learn it, javascript is a brilliant and awesome language… with lots of crappy evil features, that you can just ignore and be happy =).

    the only issue is, quoting from Crockford: it is the only language people seem to feel that they can start writing production code right away, without caring about learning it [at least a little bit] first. [maybe php too]

    glad I’ve gained a comrade on my quest to evangelize people on good javascript \o/
    [] = mine

  5. macskeptic
    December 9, 2010 at 18:19

    by the way… I haven’t noticed the sticky figure on the top right corner before… it looks perfect for your blog title =P

    • December 10, 2010 at 03:44

      Yeap, from all the bad parts, I think this is one of worst in js: that people just go writing it without bothering to learn a bit first.

      The figure is cool indeed! 🙂
      Too bad I am kinda losing my nickname 😦

  6. December 13, 2010 at 07:20

    I blame jquery, since it is super easy to use. So ppl will just add new javascript code using jquery anywhere in the pages, just a little bit of code here and there and things are going to work (for a while).

    So if we think in our pages as a set of components, bad javascript code will have a lot of jquery calls messing with those components in different places. That’s not testable. I tell you what: for each component in the whole app you should select it with jquery in just one place (a component object), then implement all the functionality for it in that object. That is testable.

    • timurstrekalov
      December 13, 2010 at 10:40

      Crappy JS code appeared looooong before jQuery was conceived 🙂 I guess, jQuery just fuelled incompetency and brought to a whole new level

  7. June 30, 2013 at 06:30

    This is a topic that is near to my heart…

    Cheers! Exactly where are your contact details though?

  8. February 17, 2014 at 11:08

    If you come up as an expert in tulip bulbs or winter gardening, you will have fewer
    visitors to your website, but they will be targeted
    visitors, people who are looking the exact type of product you are trying to
    sell. I won’t mention the name of the product but I’ll explain to you why
    yesterday night was a failure for me: Basically, the product was a dating
    product helping men learn how to attract women.
    t going to be able to find you on the Internet and you will have
    to rely on links that you send to people.

  9. ">
    April 4, 2018 at 10:38
  1. No trackbacks yet.

Leave a reply to timurstrekalov Cancel reply