Posted by Jeremy Voorhis
Wed, 27 Sep 2006 17:55:00 GMT
As a professional programmer I am devoted to my ongoing education, and sometimes this leads me to learn new languages. My criteria for learning languages does not hinge on their practicality for my everyday use – in fact, it is likely that I will only use one of the following languages for profit – but new languages can arm me with new problem solving skills and deepen my understanding of programming in general.
Each of the experiences I am setting forth here are accessible. That does not mean they are easy, but language implementations and tutorials I will reference are all freely available online.
Ruby – The (Poignant) Guide
I won’t repeat here how I learned Ruby, but I will give some credit to Why’s (Poignant) Guide to Ruby. The guide is presented in a surreal comic book world with talking foxes and man-eating goats, but highlights many crucial aspects of Ruby including blocks and meta-programming. If you are learning Ruby, have a playful attitude and want to learn Ruby quickly, spend a few hours with the Guide – and don’t say I didn’t warn you!
Text: Why’s (Poignant) Guide to Ruby
Language: Ruby
Important Concepts:
- Fundamentals of Ruby
- Blocks
- Meta-programming
Erlang
I was vaguely aware of Erlang as a functional language for some time, but my curiosity was aroused after a discussion with Jason Watkins about object-orientation in Erlang. Erlang’s distinguishing feature is its process model (Erlang processes, not operating system processes). Once established, Erlang processes can then communicate with each other via message passing, and closely resemble the Actors Model. Each process can maintain some state through recursion and communicate with outside processes by passing them messages, making them very similar to objects in common OO languages.
The Erlang tutorial is well-written, although it helps to have some prior knowledge of functional programming. If you are interested in challenging your understanding of object-oriented programming, take a look at Erlang.
Note: Ian Bicking wrote a good article about Erlang processes.
Text: Getting Started With Erlang
Language: Erlang
Important Concepts:
- Concurrency, actors model
- Object-orientation
- Functional programming
Prolog
I’ve known about Prolog for a long time and understood some of its principles, but trying it out was completely different. After googling one day, I found a good tutorial that introduced me to the language. I learned about constraint programming, programming with goals rather than statements and expressions, and running the program “backwards” to find the parameter-space for a given solution. The tutorial also challenged my knowledge of destructuring and recursion.
The example programs in the tutorial are good, and include such problems as coloring regions on a planar map and identifying animals by their attributes. It also explains how Prolog does what it does and includes more advanced topics, such as prototyping and processing a grammar that resembles the English-language.
Note: for an interesting constraint programming example in Ruby see Jim Weirich’s solution to Ruby Quiz #70.
Text: prolog :- tutorial
Language: Prolog – SWI-Prolog worked well for me.
Important Concepts:
- Logic programming
- Constraint programing
- Destructuring and recursion
Posted in Languages | 5 comments
Posted by Jeremy Voorhis
Sun, 30 Jul 2006 22:22:00 GMT
This morning after refreshing my blogroll, I noticed that I had received a chain letter. Here is my response.
What was your technical background before you started learning Ruby/Rails?
My earliest flirtations with web development involved Perl and MySQL, and my first professional programming job involved PHP and Microsoft SQL Server. I later moved on to working with .NET on Windows. While Visual Studio was sometimes inescapable, I claimed the Mono platform and Emacs as my development environment whenever I could.
How long ago did you start?
I have programmed professionally since 2003. I have been a full-time professional Rails developer since March 2005.
What were the two most useful resources to you in the learning process (not counting The Agile Book or the Pickaxe Book, which we’ll assume everyone knows about)?
Regarding learning the Ruby langauge, the most helpful resources have been community-based. Ruby Quiz, the #ruby-lang channel on freenode.net, the Ruby Talk mailing list (although I mostly browse the archives), fellow bloggers, and the erratic Poingant Guide to Ruby.
Because the Ruby language has such varied influences, it also helps to understand them as well. Many folks who see Ruby for the first time comment that is looks “Perlish”. On the surface level it bears a resemblance, but my nominal experiences with languages like Scheme and Smalltalk have contributed more to my mental model of Ruby than Perl.
Tell us the story of how you came to learn Rails:
Prior to Rails, I had been experimenting with Nant, NUnit, NHibernate and different approaches to the model-view-controller architecture on .NET. Rails was a natural fit because it encompassed a familiar toolset, but in a smaller, more easily comprehended package.
Three Ruby bloggers to whom you’re passing the baton:
Posted in Rails, web development, Ruby, Languages | no comments
Posted by Jeremy Voorhis
Tue, 23 May 2006 22:45:00 GMT
On Monday, InfoQ published my, Agile Asset Management with Ruby DSLs. This article is about my experience using internal Ruby DSLs for digital asset management. An example of a site which the DSL supports can be found at http://media.nikefootball.com/. (You might also recognize this site from my Globalize slides.)
If you’d like to kick the tires on our asset complier, you can check out the project on the PLANET ARGON trac, or just install the gem like so:
sudo gem install asset_compiler
While I have been focusing on internal DSLs with Ruby, a friend of mine, Topher Cyll has been focusing on external DSLs using an s-expression parser he wrote. In his article, If It’s Not Nailed Down, Steal It, he walks us through pattern matching, destructuring, parsing s-expressions and finally creating a tiny LOGO-like language using an s-expression based external DSL that creates SVG graphics. The article is a worthy read, and it challenged my assumptions of what Ruby as a language is capable of.
Posted in Languages, DSLs, Ruby | no comments
Posted by Jeremy Voorhis
Tue, 02 May 2006 22:10:00 GMT
In his book, Aspects of the Theory of Syntax, Noam Chomsky insists that we make a distinction between language competence and performance. Competence refers to one’s knowledge of a language, while performance refers to one’s ability to practice that language. When discussing language performance, Chomsky introduces the term acceptability. In Chomsky’s words, utterances are acceptable when they are “perfectly natural and immediately comprehensible without paper-and-pencil analysis, and in no way bizarre or outlandish.” Chomsky goes on to describe some structural heuristics for acceptability of the written word. Some things that contribute to the decay of acceptability are repeated nesting of an element, self-embedding of an element and nesting of a long and complex element.
He goes on to suggest that these patterns limit acceptability because they work against the finiteness and decay of human memory. He may not have had programming languages in mind while he wrote this passage, but the same limitations when communicating in English stand when communicating in Ruby or some other programming language.
Simply put, if you are writing software for a human first and a computer second, keep your statements concise and refrain from gratuitous nesting and run-on statements when possible. The interpreter may find your code very acceptable, but you also have a human audience which includes yourself. Look back on some code you have written two weeks ago and ask yourself – is it acceptable?
Posted in Languages, Ruby | 3 comments