views:

289

answers:

8

I'm interested in learning a new language.

Does anyone know of a website with the same program (maybe a Hello World) written in several different languages (maybe 10-15 or so), so that I can get an idea of how the syntaxes compare.

+13  A: 

How about 1,304 languages (as of 10/6/2009)?

http://99-bottles-of-beer.net/

Nice one :) +1..
Aviator
+2  A: 

Not necessarily the same program written in different languages, but Wikipedia's Comparison of Programming Languages article has a good overview of the basic syntax of a lot of different languages.

Donut
+4  A: 

Have a look at this StackOverflow question:

How do you code the “Hello World!” program in your favourite language?

M4N
http://stackoverflow.com/questions/tagged/rosetta-stone
Brad Gilbert
+2  A: 

How about The Hello World Collection?

Fredrik Mörk
+1  A: 

If you want to look at the syntax to choose a new language to learn, I suppose that you are sensitive to that syntax.

I don"t think that looking at the Hello World example will give you a good idea of the overall syntax of the language because

  • Hello World, only covers a very limited part of the syntax
  • the selected implementation may not be very representative

If you really care about the syntax, I would recommend that you don't use the Hello World review for more than a very early filter (maybe to prioritize or reject some candidates... if really you want to do so).

I would recommand that you document yourself on languages for which syntax was part of the design concerns, or languages that are known for syntax specificities.

And then, when you are quite confident about your choice, that you dig into a few ones that are still candidates to evaluate the other aspect that will affect your development: * IDE (that could definitively compensate or help for the syntax) * Community * Available libraries * ...

Personally, I would be more interested to look for a different paradigm that a different syntax...

Chris
+4  A: 

Nobody has mentioned Rosetta Code yet?

Rob Lourens
+2  A: 

It would probably be more beneficial to look at various code examples rather than a simple hello world or 99 bottles of beer to compare.

What languages are you considering?
+1  A: 

There are some more examples (including "Hello, World") on the C2 Wiki.

finnw