Scala: A Prologue (Or The Learning of a Language)

Borrowing an idea from Will, I’ve decided that I will be detailing the progress I make as I teach myself a new programming language: Scala. I’ve heard nothing but good things about it and have toyed around with a couple of (simple!) tutorials. I’m impressed enough to have ordered a book which I expect to receive sometime toward the end of this week. While this is simply a prologue to the actual play, I would like to discuss my motivation for sharing this.

First, I don’t have a particularly good recollection of my first steps taken with any programming language early on in my education or life. The first one I learned–contrary to popular belief–was not PHP; it was Perl. It’s almost embarrassing to admit, not so much because I find Perl to be a terrible language (although it is something of a write-once language), but because most hackers cut their teeth on languages closer to bare metal like C. I’m sure I still have some of my first Perl programs available, and I’d be hard pressed not to blush were I to browse them, all while wondering who the idiot was writing such awful code! I wish I had written a journal during those early days to record my first few steps. Though my memory of that particular time period isn’t great, I do recall some months of playing with Perl and CGI all to print random quotes to a web page. That’s what fascinated me most, and I think that was what spawned my love affair with web application development.

Second, I’d like to record mostly for my own future reference my steps through a language that differs significantly from the ones I currently know. I have quite a few under my belt (Python, PHP, Java, Perl, C#, and VB.NET–though the latter two are virtually identical thanks to the CLR with only syntax placing a wall between them) these days, and I think it’s generally a wonderful idea to have a history available for reference, either for personal fulfillment or as a utility available to others. Since hindsight is often viewed through rose-colored glasses, it should be interesting both to myself and anyone else reading this future work (even years from now) to peruse the sorts of “gotchas” I encounter–and what I find easiest to grasp. If nothing else, it might equip future Scala coders with some tools to combat the inevitable stumbling blocks they’re bound to encounter.

Third, I think this might be a great way to encapsulate my own thoughts on the learning process. Perhaps I could grant some insight on what happens inside a developer’s mind as they learn a new language especially one that exists outside their comfort zone. Scala combines the worlds of OOP and functional programming offering features I’m certain I have yet to understand. I’ve never delved into a functional language before (Python borrows some ideas from functional programming, mind you), and I expect to get caught by a hitch or two along the way. For current Java programmers, my work here may offer some clues as to the sorts of things you should expect to both enjoy and suffer along the road. Not that I wish to imply you’ll suffer through the language; rather, I’d like to hint that there are certain things that might not immediately seem intuitive to the Java developer. Nevertheless, being a JVM-hosted language, Scala presents us with some distinct advantages. There is also a .NET CLR-hosted port of Scala, too, for those of you living in the kingdom of Microsoft. Suffice it to say that there’s a little something for everyone.

Finally, I’d like to offer this as an analog to Will’s project I mentioned earlier. He came up with this idea some months back (it’s still on his blog, in fact), and I commended him on the utility of the notion. It’s such a great idea, I’d like to present my own implementation of it–but from a different perspective. Indeed, this project in particular–this recording of my own experiences–might serve itself to him as a guidebook of should he choose to do any sort of programming and more importantly extend that programming into other languages. Programmers these days don’t get by with a single language alone. I’ve read from sources too numerous to list that the average programmer should take the time to learn at least one language per year during their career. No, they won’t jumble themselves together–though you might notice a couple of conflicts (indented formatting habits while switching from Python to PHP or terminating lines with semi-colons while switching from Java to Python).

Along these lines, it’s important to point out that once you learn a language, the general rule of thumb is that it gets easier to learn others. Perhaps this has something to do with the formation of synapses that make the learning process more streamlined rather than establishing a particular bias toward certain constructs, syntaxes, and idea abstraction. This holds true, I think, for both natural (spoken) language and programming. Those in my circle of peers who know at least one language other than their native tongue have a much easier time grasping new ones, and I certainly know from experience, personal and otherwise, that learning programming languages becomes easier as more and more make their way into one’s skill set.

Scala looks to be a great general purpose language. It even has a web framework called Lift that can operate on any fairly modern servlet container (like Tomcat), so there’s some utility to be had from it outside the domain of generic applications. Its allure to me lies in its management of higher concurrency, which is something that still seems slightly awkward in languages like Python and Java. (To be fair, C# has advantages over Java mostly because it is newer, but there are still other things I like most about Java’s model–many of which Python borrows.) If nothing else, perhaps this coming project of mine will make (or break) your decision to adopt Scala.

Don’t expect this writing style to be formative for my future narration on this topic. Academic-speak and structure is something I enjoy, but I also enjoy writing entertaining works of literature. Thus, when I actually write the Real Thing, I hope it’ll be fun. You may grow to love or hate it. It may even take a month or two–maybe longer–to write in its entirety, but the results will be worth it. I promise.

Until then, stay tuned for the Links of the Week coming Wednesday or later. I have a few things in the queue for this week, so LotW might be delayed. If so, I apologize ahead of time.

Update Links of the Week will probably wait ’til Friday. I’ve been pretty busy, and I’m going to be putting together a tutorial on vBulletin tutorials for my own purposes. I know Will really finds the LotW entertaining; I apologize ahead of time, but I’ve really been a little busy.

Also, I’ve fixed some mistakes in this post and rephrased a few parts to make clear some of my original intent. It still isn’t perfect. I couldn’t finish my updates in Firefox due to persistent crashes, and if there’s something missing, I’ve noticed that Chrome didn’t open the original version of the document when I went to edit it. Weird.

***

5 Responses to “Scala: A Prologue (Or The Learning of a Language)”

  • Heck yes, Ben! I think this is flippin’ awesome!

    Man… you should have seen me. I was giving a presentation in Advanced Web Page Design that involved your site (I hope you don’t mind– I was almost certain I asked you, and I had the little legality talk.) Then I saw the first post. I couldn’t help but rush through the presentation and read the article as soon as possible.

    You’ve kicked me back in gear and motivated me to go through and get back on track with my coding. School has just been so overwhelming I had nearly forgotten.

    Thanks man… and I hope you enjoy the experience.

  • Benjamin writes:

    hahahahahahaahahah

    Your peers were probably thinking “OMG he even got mentioned on some random blog on the Interwebs!” when they saw your name pop up here. Now they’ll be envious. It’s great.

    Anyway, I hope you get some time so you can get around to actually working on your own narrative. It’ll be interesting, particularly for me, since I haven’t much recollection of my early days with programming languages. I’m sure it’ll bring back fond memories. But be sure to take your time as there’s no point in rushing it!

  • Dude, they totally were… Hahaha! “OMGUH WILL UR ON TEH FRUNT PAGEZ!!!”

    But yeah, school has been a real beasty. So far I’ve got all classes at a 98 or better with the exception of one… that’s balancing on a close 91. I will, however, be getting some free time. When it comes around, I’ll be hitting up some code, and I have no intentions of rushing anything. I screw up that way… big time ;)

  • Benjamin writes:

    That’s awesome. It amuses me that teenagers will never change; they’re generally easily amused (and impressed) by some of the more simpler things in life. It’s a shame we lose that sense of wonder as adults…

    Good news that you’re straight As this semester. That’s really excellent work. I’m impressed!

    Really, don’t rush; certainly not on a busy schedule. Though I don’t remember much about my early days, I do recall that one of the more difficult ruts I encountered was from rushing headlong into the world of coding. The disappointment of knowing you can’t write what you want (or simply not knowing enough to know what you want to write) is a real killer. One thing that helped me was to write small applications that had little point; start small, work big. Write a random quote generator, a small adlib-like script, or even something that transcribes things from a class you’re taking into the world of programming (implementing math in code is always useful). Heck, even writing a question/answer quiz system can be a huge help. The biggest hurdle when you start is not knowing what to write. I think that holds true for writing, too.

  • Thanks man… Its really hard and stressful to keep A’s alone, much less A+’s!

    And its ironic, because I have the same exact problem you do! I have a lot of trouble deciding what I want to code that is within my abilities. I have a tendency to try to jump into stuff that’s way over my head, and end up getting frustrated =/ I’ve got some great resources though (as you well know :P) that I think will help me get going on a decent path. When I have time, I’ll go ahead and try to find a starting point!

Leave a comment

Valid tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>