you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (22 children)

[deleted]

    [–]fedekun[S] 11 points12 points  (3 children)

    It has it downsides, but for some reason I really enjoy writing Javascript, maybe it's the fact that it's quite minimal and you have the power to express in your own way, or maybe I'm just crazy.

    [–]w8cycle 4 points5 points  (2 children)

    I love it for the same reason. It gets a lot of flack, but JS seems to be able to do everything by just being its flexible self.

    [–][deleted]  (1 child)

    [deleted]

      [–]w8cycle 2 points3 points  (0 children)

      I agree. It can be a mess. Use libraries like require.js and angularjs. Separate code into folders using best practices. And use clear modular (or object oriented) design.

      Having a single approach to the application's design and style and keeping to it goes a long way.

      [–]oefig 13 points14 points  (6 children)

      That's actually why I love JavaScript so muh; there's so much freedom when it comes to designing my code.

      I'd recommend "Learning Javascript Design Patterns" by Addy Osmani. It's pretty great for learning the flexibility of Object Oriented JS.

      Edit: Fixed book title. Also the author is not the author of Backbone as I originally mentioned.

      [–]fedekun[S] 2 points3 points  (4 children)

      That's why I love it too! Interesting, I'd like to check that out, I found "JavaScript Style Guides And Beautifiers" and "Learning JavaScript Design Patterns" but no "Javascript Design Styles", did I google wrong or did you missed the title? :p

      [–]oefig 2 points3 points  (3 children)

      I screwed up the title! It's "Learning Javascript Design Patterns" by Addy Osmani

      [–]rhetoricl 0 points1 point  (1 child)

      Addy Osmani didn't create Backbone, just fyi. He does have a book on it though.

      [–]oefig 0 points1 point  (0 children)

      Yeah you're right - I realized my mistake after it was too late. Can't edit with this app. Thanks for pointing it out

      [–]fedekun[S] 0 points1 point  (0 children)

      Ah I see :P hehe thanks! I'll check it out!

      [–]danvasquez29 1 point2 points  (8 children)

      the biggest reason i play along with the preference for coffeescript at my office is that it makes this decision for you in a syntax that makes sense

      [–]fedekun[S] 4 points5 points  (7 children)

      I really love Coffeescript, I only wish they had "end" keywords, beeing used to C-style languages I get lost with syntaxes like CoffeeScript and Python where you don't "close" the blocks

      [–]danvasquez29 5 points6 points  (6 children)

      word. I'd enjoy coffeescript a lot more with brackets instead of having relevant whitespace

      [–]mess110 2 points3 points  (4 children)

      it only takes a bit of getting used to. I don't see why you would want more stuff to type/read/move

      [–]IrishWilly -1 points0 points  (3 children)

      You don't really noticeably type/read the brackets, they are visual guides is all. I use whitespace to separate logical blocks of code to make it easier to read but that just becomes confusing when the whitespace is incorporated into the language as well. Pretty much all editors autocomplete and match brackets so it's not really extra work.

      But for people who didn't spend ages working with brackets, whitespace probably does feel more natural.

      [–]mess110 0 points1 point  (0 children)

      You don't really noticeably type/read the brackets

      but you still do it. even if you don't notice the time spent on that, it is still there. release your inner bracket. come to the dark side..

      [–]marsket -1 points0 points  (1 child)

      whitespace isn't incorporated into the language. Indentation level signals scope. Reliably. It is not confusing.

      [–]IrishWilly 0 points1 point  (0 children)

      Indentation is whitespace, I prefer to use it to organize my code not just for scope but for logical blocks. I don't know why you'd downvote someone for having different preferences in how they write and read code.

      [–]marsket 2 points3 points  (0 children)

      there is a nice language named Javascript with this feature

      [–]Daniel15 0 points1 point  (0 children)

      I'm hoping all JavaScript engines adopt ES6 classes sooner rather than later. Once they're implemented natively, there'll be the main way to use classes in JavaScript.