Friday, December 28, 2007

Reading Scala

After working a bunch in Scala the other day, and continuing to obsess over it, I've realized something.

Reading the code Scala language source code is perfect code reading material.

I had said that I needed some good code to read. Scala is perfect for this. Here are the reasons its good for me.

  • It's really good code
  • Its easy to read (I guess these two go together nomally)
  • It has a really nice mix of OO and Functional Programming (which I need to get better at anyway)
  • Its got a compiler written in Scala compiling to Java bytecode. :)
  • Its a langauge for god sakes, and I want to do language design so I should look at more language implementations
But, are those the same reasons its good for someone else to read? Maybe not, but I think Scala is still great for other people to read, beginners, professionals, and Ph.d's alike.

  • The first two points hold true: Its really good code, and its easy to read.
  • Beginners could easily read the data structures code in Scala collections. They could learn their data structures, learn FP, and learn OOP better all at once.
  • Theres a wealth of stuff for more advanced people to read.
    • The Actor Model for instance, which is Scalas concurrency stuff built on top of Doug Lea's fork join.
    • Langauge Designers could read it and learn a bit.
    • Compiler writers could read it and learn a bit.
    • Software Engineers could read it, and read the examples to learn a few things:
      • How to do things better in their own language
      • What they are missing stuck in an ancient language.

As I said before, It's probably helpful to read java.util.concurrent and the java collections stuff, and I'm sure theres a whole lot of other code thats great to read too. But, I'm getting worn out when it comes to Java. I'm ready to move on. Scala is new and fresh and exciting, and, I'll learn more by doing it.

No comments:

Post a Comment