14 ms·
Graham’s Guide to Learning Scala
- MaxGabriel 14y agoDoes anyone have something like this for Clojure?
- jcurbo 14y agoYou might check out the book "Seven Languages in Seven Weeks" which has a chapter on Clojure (and Scala, Ruby, Io, Prolog, Erlang and Haskell too). I took a class that used it and I thought the format was quite good.
- braco_alva 14y agoThanks for mentioning the book, after reading your comment I looked for the book, and it looks pretty good, probably the next book I'm going to buy. Thanks!
- manaskarekar 14y agoJust pick up the video series from Rich Hickey himself http://blip.tv/clojure http://blip.tv/clojure And 'Programming Clojure' (among others). It's a nice concise read. (http://www.amazon.com/Programming-Clojure-Stuart-Halloway/dp/1934356867 http://www.amazon.com/Programming-Clojure-Stuart-Halloway/dp...) Edit: blip.tv is terrible for navigation. You have to click a few times to go to page 5 of the channel. Start there.
- sherjilozair 14y agoGreat blog post! I wish someone has this kind of tutorial for Haskell.
- lazyfunctor 14y agoThis kind of tutorial for haskell will be great! I think LYAH is a good starting point for haskell beginners.
- sousousou 14y agoHow To Learn Haskell: http://acm.wustl.edu/functional/haskell.php http://acm.wustl.edu/functional/haskell.php
- tokipin 14y agothe Coursera course "Functional Programming Principles in Scala" just ended but they're keeping all the content online until the next run of the course the lecturer, by the way, is the designer of Scala https://www.coursera.org/course/progfun https://www.coursera.org/course/progfun
- mintplant 14y agoPrevious title: "Do something useful over the holidays: Learn Scala"
- donwb 14y agoPerfect timing! Learning Scala is exactly what I'm doing over the long weekend.. Great post!
- thebluesky 14y agoAlso check out: http://blog.typesafe.com/free-pdf-from-typesafe-scala-for-the-impatien-64715 http://blog.typesafe.com/free-pdf-from-typesafe-scala-for-th... In my experience most people find that the best introduction.
- donwb 14y agoThanks! will do.
- pknerd 14y agoWhy are you learning it? It's a serious question no trolling.
- donwb 14y agoMore of an academic exercise, just to further my understanding of other languages/frameworks (I'm looking into Play! also)
- mukaiji 14y agoAnyone has a good summary of Scala vs Go? I know a bit of the former (with typeface for high-concurrency) and was wondering what Go might have to offer.
- irahul 14y agoGo is far simpler and smaller. You can learn go in an evening. It comes with a nice standard library, but the ecosystem isn't as lively as what you get on JVM. But if you have native library for a task, using it from Go is straight forward. Web frameworks are in their infancy. Writing network programs in Go is a pleasure. You write code in the natural way(no callback spaghetti) using go-routines, and go takes care of making it non-blocking. The go oop is structural sub-typing based. Though it might seem lacking at first glance, it's actually quite wonderful. Bottom line: Learning go is far simpler than learning Scala. Read and write some programs, and make up your mind. Here is an example you should read through to get a feel of the language. http://golang.org/doc/codewalk/sharemem/ http://golang.org/doc/codewalk/sharemem/
- mukaiji 14y agogreat response. thanks!
- bad_user 14y agoC is far simpler and smaller than Go. Languages are optimized for different things, depending on their context. They all have a place.
- irahul 14y ago> C is far simpler and smaller than Go. Mentioning Go is simpler than Scala is to point out the difference to OP, and to emphasize that trying out Go doesn't take much effort. > Languages are optimized for different things, depending on their context. They all have a place. I am not denying that. That's why I said - Read and write some programs, and make up your mind.
- 14y ago
- hakaaak 14y agoThe two problems I have with Scala are: (1) it tries to be too much by allowing optional types and the clarity of the code suffers- either embrace duck typing or don't, (2) Play v2 killed all chance of it becoming a decent web developer's go-to language. For those that are learning Scala just for the hell of it, great. But, don't intend to make a career out of it unless you've checked into other languages first, like Ruby, Python, Haskell, Go, Clojure, etc.
- bretthoerner 14y agoCan you give concrete examples of both?
- coopdog 14y ago1) The typing isn't actually optional, you just don't have to write it as long as it can be inferred, which is the best of both worlds. If you're ever unsure of which type it is just mouse over in the ide, or specify it and wait for an error 2) not sure what you mean here
- millennium2 14y agoI try to understand what you try to say and have several interpretations, but sadly none of them seem to make sense. What do you mean with 'optional types' and what does that comment about Play have to do with Scala? Care to explain?
- deleted 14y ago[deleted]
- eeperson 14y ago1. I'm not sure I understand the complaint about arguments. From you example it looks to me like the problem is that Scala requires type declarations and supports default arguments. I don't understand how this is worse than the equivalent Java example. I also don't understand how the Ruby version is inherently better. The only difference seems to be static vs. dynamic typing. 2. I don't understand how Play 2 screwed over Scala developers. It seems like Play 2 is much better for Scala developers. Scala is now a first class supported language instead of just an add on module. I also don't understand how Play 1 was 'the' thing that was bringing web developers to Scala. It wasn't in any way a core part of the framework. It was just something you could optionally use. Scala is something you could optionally use in any Java web framework.
- RyanZAG 14y agoScala was looking pretty nice till I got to this: http://www.codecommit.com/blog/scala/scala-for-java-refugees-part-6 http://www.codecommit.com/blog/scala/scala-for-java-refugees... Not convinced on Scala being a good language to use for multi-person projects anymore. Same as with C++, you would have to heavily push code reviews and coding standards (disallow everything from that link?) in order to have even slightly maintainable code...
- bad_user 14y agoThat's only a superficial impression and I recommend you give it a second chance. If you're worried about the equivalent of "open classes" from Ruby, first of all in Scala implicit conversions are always scoped and statically type-checked, and second, that article is out of date.
- seanmcdirmid 14y agoCan't you use traits and type member to simulate open classes? At least, this used to be possible, but then the compiler stopped letting us define type member bounds recursively around the time I left the project. Implicit conversions are a poor substitute to real open classes.
- luu 14y agoAnother resource for learning Scala is Werner Hett's 99 problems in Scala: http://aperiodic.net/phil/scala/s-99/ http://aperiodic.net/phil/scala/s-99/. I tried it after doing Odersky's Scala class (https://www.coursera.org/course/progfun https://www.coursera.org/course/progfun). If you've done the class, it's not a bad way to get some practice with constructs that weren't particularly useful in the class. If you haven't done the class, the problems are simple enough that you could probably learn scala by just working through the problems and googling for relevant syntax. They start to get more involved around problem 50, but, by that point, you'll have a good grasp of the syntax. If you want to try them out, I have unit tests for the problems I've done (only up to 58, so far) here: https://github.com/danluu/ninety-nine-scala-problems https://github.com/danluu/ninety-nine-scala-problems. The tests are pretty rudimentary; I'm sure there's at least one github repo that has more comprehensive tests, but I looked around at tens of repos of other people's tests on github when I first started and I didn't find much. P.S. If you're in Austin, there's a Scala group that gets together that isn't a meetup, and hence, isn't findable from Graham's link in step 9: https://groups.google.com/forum/#!forum/austin-scala-enthusiasts https://groups.google.com/forum/#!forum/austin-scala-enthusi.... The majority of the folks there actually use Scala in real production code.
- JohnCohorn 14y agoThe ATX group is indeed a good one.
- pohl 14y agoThank you for the repo of test suites!
- millennium2 14y agoThat article looks seriously outdated. I think everyone following that advice will get a bad first impression of the language.
- bad_user 14y agoI don't think this is a good guide for Learning Scala. The Introduction from scala-lang.org and a Tour of Scala are not good introductions. They are meant as a TL;DR that will leave you scratching your head and reading the list of features without the larger context of a language is an awful way to learn about that language. IntelliJ IDEA with the Scala plugin is a good IDE, but the article should have included a link to the Scala-IDE plugin for Eclipse. It's not friendly for beginners to make them install a plugin, which is why Typesafe is already providing a download of a completely configured Eclipse here: http://typesafe.com/stack/scala_ide_download http://typesafe.com/stack/scala_ide_download Also, when starting out with a language I would rather use a plain text editor and the compiler directly, because complicated tools bring with them complicated problems ... Hello World with just the compiler is just one text file that you can directly execute, versus the notion of whatever a project is in an IDE. And you should start with the REPL anyway. "Scala for Java Refugees" is an article series that's out of date and not that good frankly. There already is a comment here from somebody saying he was scared when he saw in that series the usage of implicit conversions - a feature that in Scala 2.10 is considered experimental, for really advanced use-cases and that has to be enabled manually, as for most purposes there are better solutions available - but on the other hand, the context of a feature matters a lot. Implicit conversions are great for dealing with the "expression problem" and through their means, Arrays (a fundamental JVM data-structure with a broken interface) behave like plain Seqs in Scala, while Strings are considered to be lists of chars (as in Haskell or Lisp). I didn't like Alex Payne's "Programming Scala" book. It's boring, it's poorly organized and it's out of date - for instance a big part of it involves dealing with Scala's Actors, but Scala's Actors were terrible, which is why in Scala 2.10 the implementation in the standard library gets replaced with Akka, which is the defacto standard anyways, but it also has a slightly different API and concepts. Actors are also the kind of powerful construct that's not easy to tame, being an awful way to start learning Scala ... before Akka Actors, look into Scala's Parallel collections, or into Akka's Futures and Promises or into ScalaSTM. Speaking of Parallel Collections and Futures and Promises, no mention of Scala's Documentation project? http://docs.scala-lang.org/overviews/ http://docs.scala-lang.org/overviews/ A much better introduction to the language is "Scala for the Impatient", a book that wasn't mentioned and one third of the book (enough to get you started) is available from Typesafe's website: http://blog.typesafe.com/free-pdf-from-typesafe-scala-for-the-impatien-64715 http://blog.typesafe.com/free-pdf-from-typesafe-scala-for-th... You also cannot write about learning resource, without mentioning "Programming in Scala" by Odersky, a wonderful book also meant for human beings. Its only problem is that it's a tome of information and you may not have the patience for that, but it's not a hard to digest book so if you've got the time and patience, then this is THE book you should read: http://www.artima.com/shop/programming_in_scala_2ed http://www.artima.com/shop/programming_in_scala_2ed And you must also mention "Scala in Depth" by Joshua Suereth, which is like the equivalent of "Effective Java", a ~ 300-pages book you definitely must read once you're done with "Scala for the Impatient": http://www.manning.com/suereth/ http://www.manning.com/suereth/ On the other hand the Coursera Course taught by Odersky on Function Programming is awesome. I've took it and it was worth every minute of it.
- account_taken 14y agoJust read Twitter's Scala guide. Best resource for learning Scala on the web.
- pknerd 14y agoCan anyone tell me why one needs to learn Scala but not something else like Go or Node.js? Some other buzz word?
- seanmcdirmid 14y agoNo. I mean, you should learn what you want to learn; there is no strict set of new technologies that you should learn and others that you shouldn't. Sorry we can't provide you with better guidance.
- djb_hackernews 14y agoAdd to resources/community #scala on irc. When I was doing Scala app dev, it was a wonderful place with a small group of really helpful people.