Sigh... I can't believe I am, yet again, participating in this Scala thread hijacking :-(
On Thu, Jun 2, 2011 at 9:23 AM, Kevin Wright <[email protected]>wrote: > > It's everything. Support for concurrency is a big drive behind Scala, and > actively encouraging and easing immutability is a big part of that. > We've been through this already: there is hardly anything in Scala-the-language that encourages immutability. Nothing. It's all left up to the developer to use vals and immutable collections and write their code in a referentially transparent way. Scala offers nothing over Java in this particular area. Nothing. > Hopefully a future effect system in the language will even be able to > enforce it. > > As Martin also pointed out on StackOverflow ( > http://stackoverflow.com/questions/6085576/why-does-scala-choose-to-have-the-types-after-the-variable-names/6086795 > ) > moving the position of the type is a great help to readability. > Let's face it: the main drive behind this syntax is for type inference. While I agree it's a bit easier to read, I would certainly not call it a "great help to readability", and you can be sure that legions of developers who only know C-like languages will find it less readable. > > Compare > HashMap<Shape, Pair<String, String>> shapeInfo = makeInfo() > to > val shapeInfo: HashMap[Shape, (String, String)] = makeInfo() > > The name of the value is far more apparent in the second case > Again, this is highly subjective. I happen to agree with you on this but I can't really blame anyone for favoring either of these forms over the other, and neither should you. Scala's grammar is approximately 1/3 of Java's. When counting > non-whitespace lines from the respective BNF descriptions of the two > languages, as taken from the official specifications. > Please, let's not do this again. There is no official Scala specification (not in the same, rigorous terms that the Java grammar is defined), and grammar size is really not a measure of the complexity of a language. I promise you I can come up with a grammar that one tenth the size of Scala's and that no human will be able to write a well formed program in. -- Cédric -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
