
Trends in modern programming language syntax - johndcook
http://rdallasgray.github.io/blog/2013/05/11/mod-lang/
======
olalonde
> CoffeeScript makes parentheses optional in many cases (as does Ruby)

This is one thing that really annoys me with Coffeescript. I personally find
the lack of parentheses makes the code harder to read (since it's sometimes
ambiguous where the parentheses should be) but faster to write.

> An important consequence of this is implicit returns: because every
> construct must return a value, all functions must return a value, whether
> return is called explicitly or not.

Same concern here. When working with someone else's code, it is sometimes
unclear if the author intended the last expression to be the return value or
it just happened to be the last line of code and it is safe to return
something else.

The lack of parentheses and implicit returns also makes it hard to maintain a
consistent code style guide as there are too many ways of writing the same
thing.

~~~
jfb
I'm really not a fan of these optional syntactic elements -- I don't find that
they aid comprehension. It's like optional braces in C; I get the idea --
reduce conceptual overhead, make the intent of the code clear -- but in
practice, it's just nasty.

I wonder if this is why I like scheme, or if scheme is why I like simple
syntax.

------
k__
Does "return unless x is 5" really do what I read?

return unless x is 5

"reads" like

if( x !== 5 ) return;

but I guess it's more like

return (x !== 5);

~~~
morpher
The way it reads is the way it works, which is why it is a nice syntax.
Although,it is actually: if (!(x==5)) return;

------
sodiumphosphate
I wish someone would write a CoffeeScript for C++.

~~~
BruceIV
C++ is a beast of a language that has semantics which are pretty much too big
to keep in your head - I think the best potential for this is some of the new
languages targeting some of the same ends (Rust is closer to the capabilities
of C++, but Go is more mature and has better tooling).

~~~
Roboprog
Alas, "Go" was forced to look sorta like C, even though it really acts more
like Modula with closures and garbage collection. (ignoring that C & Modula
are both just redressed Algol)

Go is more of a C-like counter example of the things the author is talking
about, with its authoritarian use of K&R curly brace formatting, and not
making statements into expressions.

