Live data from Hacker News

Writing Eloquent JavaScript Without CoffeeScript

oscargodson.com

1–10 of 55 posts

Re: Writing Eloquent JavaScript Without CoffeeScript

#2
I guess from MPOV, "eloquent" formatting shouldn't change based on the size of the content... ie the difference between standard indenting and tab-aligning commas vertically. There's nothing eloquent about stepping through a dozen lines of code, tabbing each out, because a value was added that's a little longer than the rest..

Re: Writing Eloquent JavaScript Without CoffeeScript

#6

most of that made me feel sick

Yeah, it was sort of short and newbie-friendly, but it probably helped some people. I wish that it would have gone into more detail to explain how each of those tricks works so readers could learn why those operators work the way they do. For example, he called using a logical "OR" a "var = var || value way of setting variables."

He should have gone into more detail to explain how ||'s work, how you can have more than just 1 of them, the order in which they are evaluated if you do have more than 1, etc.

Re: Writing Eloquent JavaScript Without CoffeeScript

#7
As someone who writes JS every day, ignoring the fact that I think most of these paradigms are terribly ugly (though the comma placement is acceptable for cleaner diffs), I expected this post to be about actually getting things done eloquently without CoffeeScript. What I got was a blog post about how ternary operators can be written on multiple lines.

Re: Writing Eloquent JavaScript Without CoffeeScript

#9
I don't want to sound like an asshole and I'm saying nothing about the author, but in my personal experience I found lining up variables or =s was something I worried about when I first started programming.

Now my mind's eye just totally skips variable declaration when visually code parsing, variable declaration is meaningless drivel that exists only to stop typos (a good purpose).

I had an opinion on the layout of them back then because I wasn't a good enough programmer yet to have an opinion on anything else, I had opinions on things that didn't matter because those were the only things I actually understood well.

Also, again in my personal experience, it's much better to declare them just before you use them for future maintenance, having 4 or 5 declarations at the same time is something I do so rarely now. If you start faffing around laying them out, you're going to be tempted to put them all together.

Post reply on HN