r/programming • • May 09 '12

JavaScript: The good parts

http://blog.movereem.nl/images/javascript-the-good-parts-the-definitive-guide.jpg
645 Upvotes

159 comments sorted by

View all comments

21

u/[deleted] May 09 '12

Old, and wouldn't this be true of every language?

24

u/angrystuff May 09 '12

Some languages are better than others:

http://xkcd.com/353/

48

u/Fissionary May 09 '12 edited May 09 '12

Hello World is just print "Hello, world!"

Not in the latest version of Python, it isn't. It will work in Basic, though.

The simplicity of the Hello World program is not a good indicator of the power of a language.

29

u/Wolfy87 May 09 '12

No, now it uses parenthesis. How difficult.

9

u/[deleted] May 09 '12

it's not difficult, but it is the wrong direction for the language to move in. Ham-fisted correctness over readability? WTF python devs .... I'm sticking to the 2.7 branch as long as I can ...

5

u/kqr May 09 '12

Do you not want to be able to pass print to a higher-order function?

4

u/Traubert May 09 '12

That's possible even if print is kept as a keyword too. You can do it in any of the 2.x versions that provide print as a function.

6

u/kqr May 09 '12

How do you pass it? It just syntax errors me when I try.

2

u/Traubert May 10 '12

Hey, what do you know, you're right! I'm sorry I made that claim without checking it out. I assumed that as a rvalue it would be evaluated as a function reference, but it's a part of the syntax so it does indeed just error out. Thanks for teaching me something.

1

u/kqr May 10 '12

Yeah, passing print in pre-3.0 is somewhat like passing for, while, if or return.