How Scala Changed My Programming Style
artima.com
artima.com
The essential idea behind the post is this: using a language like Scala can make you use a mainstream language like C# or Java differently. By using a language that makes immutability the default it teaches you when mutable state is actually necessary and when it isn't. This will lead you to write code in whatever normal language that also has less mutable state, and fewer side effects. It will therefore be easier to test and have fewer bugs.
And, no, I have not written any Scala books and have no Scala-related products/services to sell you.
My guess would have been that they were excited about Scala before they wrote the book.
Documentation as a side effect of types is somehow better than a system designed for good documentation?
"code completion in IDE"
See 1
"execution speed"
See LuaJIT, Self, Javascript ... etc
The reasons people often give to justify losing (types) so much flexibility (late binding) never add up to me.
Not that pre- and post-increment are ever that intuitive or transparent...
In C++, it's suggested to do ++i because it will sometimes result in fewer calculations if i is an object with overloaded increment operators.
Mainly I was taught that situations that require i++ are less common, more subtle, and easier to get wrong, so programmers should make them stand out by using ++i everywhere else.
as: FOO; while (BAR) { BODY; BAZ; }
Hence, ++i and i++ mean the same in this context. The difference, as mentioned already, is that i++ creates a copy of i.
Anyway, even in C, ++i and i++ change the value of i and evaluate to a value. So there are two values: the new value of i, and the value of the expression. In the case of prefix ++, the two values are the same. In the case of postfix ++, the two values are different. If you ignore the value of the expression, then ++i and i++ can be used interchangeably. The compiler will probably figure this out and produce the same code.