3 ms·
>Ceylon's syntax is ultimately derived from C. So if you're a C, Java, or C# programmer, you'll immediately feel right at home ...yet we introduce the VB-keywo
by Nilzor 12y ago
>Ceylon's syntax is ultimately derived from C. So if you're a C, Java, or C# programmer, you'll immediately feel right at home
...yet we introduce the VB-keyword "shared" instead of "public", "variable" instead of C#'s "var" and use square brackets instead of curly braces for array initialization. You know, just because fuck you.
Seriously I see this all the time in new languages. Why invent or change keywords just for the sake of changing? Why does Rust use "let"? Why does Scala use "def"? If you want easy adoptation from one of the two largest languages in the world, change what matters and stick with the rest.
- chrismonsanto 12y ago> Why does Rust use "let"? let is the standard keyword for introducing a new, shadowing variable binding. It is a very old tradition and is immediately recognizable to functional programmers. > If you want easy adoptation from one of the two largest languages in the world, change what matters and stick with the rest. In the case of "let", it would be a false consistency with C/Java. Assignment in C/Java does not have the same semantics as a let binding in Rust, although a let binding in Rust has very similar semantics to a let binding in Scheme or Haskell.
- deleted 12y ago[deleted]
- chc 12y agoC — the language he cites as inspiring the syntax — doesn't have "var" or "public," so you're arbitrarily choosing another language as the "starting point" and then insulting this language for not doing the same thing as the one you would have chosen. And in the years since C came about, square array literals have been pretty common (and curly-brace array literals are actually almost unheard-of)†, so that seems like a pretty reasonable deviation from C. † Here is a not-remotely-exhaustive list of languages with square sequence literals: D, Objective-C, Python, Ruby, JavaScript, PHP, the whole ML family, Clojure. On the other hand, C didn't even traditionally have array literals — it just had a special curly-brace initializer syntax you could use with arrays as well as other aggregates.
- haldean 12y agoTo add to your list of languages with square-bracket array/list/vector initializers (see also [0]): Aikido, Coffeescript, E, F# (sorta, uses pipes too), Groovy, Haskell, Matlab, Nimrod, Postscript, Vimscript. [0]: http://rosettacode.org/wiki/Arrays http://rosettacode.org/wiki/Arrays
- hyperpape 12y agoYeah, let goes back at least 40 years: http://en.m.wikipedia.org/wiki/ML_(programming_language) http://en.m.wikipedia.org/wiki/ML_(programming_language)
- adrusi 12y agoLonger, LISP had it in 1958, a full 56 years ago.
- VMG 12y agobecause you shouldn't confuse people by naming things the same when they are different
- gavinking 12y agoExactly, thanks!