4 ms·
I don't much about Scala, but looking at the examples on http://www.simplyscala.com/ http://www.simplyscala.com/, it looks like the language has a lot of syntac
by jcarreiro 15y ago
I don't much about Scala, but looking at the examples on http://www.simplyscala.com/ http://www.simplyscala.com/, it looks like the language has a lot of syntactic sugar. Scala users, is that an accurate assessment or I am misjudging it?
- riobard 15y agoNo. On the contrary, Scala has a very minimal syntax. Syntactic sugar are rare in Scala.
- jcarreiro 15y agoThanks. I'll have to check it out, I love learning new languages. Can you recommend a good Scala book?
- tilltheis 15y ago"Programming in Scala" is a good one, I've been told. The first edition is available online at http://www.artima.com/pins1ed/ http://www.artima.com/pins1ed/ .
- ondrasej 15y agoDefinitely Programming in Scala - http://www.artima.com/shop/programming_in_scala http://www.artima.com/shop/programming_in_scala. You might find some parts of the book a little boring if you already have experience with functional programming, but it is one of the best books about programming languages I've read (I've only read the second edition, not the one that is available online, but I guess, the first one will be OK as an introduction too).
- dxbydt 15y agodon't buy the wampler book as a 1st book. too many forward references, you are constantly flipping pages. also, portions of the scala api are a work in progress. constructs for multidimensional arrays have changed several times. i may recommend the wampler book when they come out with a rewrite, say in a few months time. Now it seems too rushed. Some of it reads like a collection of blogposts. Also wampler's idea of functional programming is very basic. No details on commonly used functional data structures or functional pgmming algorithms. More like "functional pgmming is X as opposed to OO pgmming is Y". Okasaki's book ( http://news.ycombinator.com/item?id=1138979 http://news.ycombinator.com/item?id=1138979 ) needs to be written in Scala. That'll sell a boatload of copies. Even a modest attempt at that would work for a start. That's an awesome book.
- stayjin 15y agoThere is a PDF book called "Scala by example". It is a hands on approach that I find very interesting, because you learn by trying out applied cases.
- runT1ME 15y agoI disagree. The following all mean the same thing (off the top of my head): obj.( (a, b) => a + "." + b) obj.(_ + "." + _) obj { (a,b) => a + "." + b } Seems to me that's syntactic sugar. The flexibility of Scala is the source of my love/hate relationship with the language. That being said, it's still my favorite thing to code in when I get the opportunity...
- Meai 15y agoScala has to be the worst offender of language complexity I have ever seen. A language isn't supposed to make you feel smart, it's supposed to be easy to read, maintain and write powerful code in. Have you had a look at larger Scala codebases? Every single code line needs to be read consciously, quickly scanning over code is impossible with Scala.
- dxbydt 15y agoI think you should look at DSLs. Seriously. You can code a domain specific options parser in scala so that your final code actually looks like this - "@ $20 spot, price 5 calls, @ $25 strike, 59 days to expiry" This is as simple as it can get. In fact, the senior quants literally say the above line word for word. So its practically English. Can't get any simpler than that. Reference: http://www.scala-lang.org/node/1403 http://www.scala-lang.org/node/1403
- smcj 15y agoI had a completely different experience. Code is very readable, because it describes what it does and not how.
- spullara 15y agoReadable but not editable. The person editing or debugging your code needs to know how it does it.
- jrockway 15y agoHow much Scala have you read and written? I hear "xxx is too complicated" quite often, and it's always from people whose experience is having visited the language website once or twice. Of course code is hard to read if you don't know the language.
- gtani 15y agohttp://stackoverflow.com/questions/1483212/list-of-scalas-magic-functions http://stackoverflow.com/questions/1483212/list-of-scalas-ma... http://stackoverflow.com/questions/2662984/what-are-all-the-instances-of-syntactic-sugar-in-scala http://stackoverflow.com/questions/2662984/what-are-all-the-...