Sep 14, 2011

Everything in a Single File

You may have noticed that I prefer to write my Scala examples as a single listing, I also only use what is built into Scala, no third party libraries.

The advantage for me is that I don't have to find some other place to host the code, and it saves me the trouble of having to explain how to set things up in order get the code to run. The advantage for you, the reader, is that you can simply copy and paste into a xxx.scala file in your Scala IDE or editor of choice, compile, and expect the code to work (at least if you use the same version of Scala as I do).

The downside is that I may have to roll my own implementations of readily available components, and that the programming style will not lend itself to TDD. For the kind of toy projects I currently do, I think the trade-off is worth it, and creating my own components can be great fun. Not invented here syndrome, here I come :)

Of course, I won't go to extremes with this philosophy, a particular subject may require another approach.

Stay tuned for The Dysfunctional Web Server, my toy web server component that I'll use in future labs.

No comments:

Post a Comment