Treating JavaScript like a 30 year old language
jeremyckahn.github.com
Treating JavaScript like a 30 year old language
1–10 of 99 posts
Re: Treating JavaScript like a 30 year old language
#2I thoroughly enjoyed this article. I'm always looking for ways to improve the readability and "share"ability of my code, and the author has provided several tips that I'll be taking forward. The part on strict-ish typing is brilliant. Very good read.
Re: Treating JavaScript like a 30 year old language
#3Doesn't even mention coffescript
Re: Treating JavaScript like a 30 year old language
#4I liked the bit about using new. As he says, some people go with capitalizing their constructors, but capitalization is not enforced by the compiler. 'new' is explicit, it can't be anything but a new object.
Re: Treating JavaScript like a 30 year old language
#5If you are writing types in Javascript, you owe it to yourself to use webstorm, as it can do code completion in javascript (it can also do reasonable inference).
Re: Treating JavaScript like a 30 year old language
#6Doesn't even mention coffescript
I am debating starting up a bot which just scans for stuff like this and auto-posts a reply of "Yes, this article didn't mention your favorite buzzword, and you must be incredibly perceptive and intelligent to have noticed this and pointed it out."
Re: Treating JavaScript like a 30 year old language
#7I just cannot wrap my head around the fact that readable code is considered boring?
Re: Treating JavaScript like a 30 year old language
#8AFAIK, using 'new' is not a matter of preference. Omitting the keyword leads to different results. Am I missing something?
Re: Treating JavaScript like a 30 year old language
#9AFAIK, using 'new' is not a matter of preference. Omitting the keyword leads to different results. Am I missing something?
Some people think that library consumers shouldn't have to use new. Instead they should call a factory function (which itself calls new).
Re: Treating JavaScript like a 30 year old language
#10I liked the bit about using new. As he says, some people go with capitalizing their constructors, but capitalization is not enforced by the compiler. 'new' is explicit, it can't be anything but a new object.
Well.. that's mostly true. You can get some pretty interesting results if you return something in a function invoked using new: http://wtfjs.com/2010/11/10/false-advertising