Mar 17
2008

Learn as Many Languages as You Can (or just learn Scala)

Posted by Christopher Diggins in Programming Languages

cdiggins

Nick Plante recently reminded me in his blog of the advice in Pragmatic Programmer to learn one programming language a year.

I say why wait? If the Sapir-Whorf hypothesis has any bearing on computer programming (which I believe it does) then you can give your programming skills a big boost by cramming a bunch of languages in your head now.

However, you need to leave your safety zone and learn a properly disjoint set of languages so that you can effectively expand your thinking, and deepen your general understanding of programming.

Assuming like many of us you are of a predominantly C++/Java background then I recommend learning the following languages in roughly the following order, and as quickly as possible.

  • Ruby - Ruby does a great job of showing how powerful a dynamic language can be, and leverages powerful ideas from Smalltalk, Perl, and Lisp.
  • Scheme - Scheme is a dialect of Lisp with some pretty hardcore implementations. Make sure you can wrap your head around call/cc and be sure to learn what "lambda" does and what the different "let bindings" are for.
  • PostScript - PostScript is a neat way to experience the power of stack-based programming. It looks like a toy but it isn't, millions of printers around the world run it all the time.
  • Prolog - Prolog can make solving a large class of  programming problems a snap to solve. It is also easy to implement in your language of choice.
  • ML - ML is one of the favourite languages used by computer scientists. I suggest learning algebraic data types (sum types and product types) then to move on quickly to Haskell.
  • Haskell - I find Haskell makes the most sense only after knowing Scheme and ML. Go crazy with pattern matching, but avoid using monads unless absolutely neccessary because they are cheating! You will be sorely tempted to resort to using them all over the place.
  • Erlang - See how easy distributed programming can be.

Getting some experience in this set of languages as soon as possible, would really catapult you forward to a new level of programming. You will gain new insights into solving programming problems in whatever language you happen to be using. It will also make transitioning between languages a snap.

Of course, not everyone has the time to or energy to learn a whole set of new langauges. So if you have to choose only one new language for the time being then my recommendation is Scala. Scala is very accessible to programmers from different backgrounds. Scala provides access to type inference and advanced techniques used in languages like Haskell, but still supports common Java idioms and dynamic programming.

The Scala by Example [pdf] online book for example was heavily influenced by the the famous Scheme book: Structure and Interpretation of Computer Programs. The fun thing about Scala, is that you can slowly introduce yourself to new concepts and still be an effective programming using a programming style that you are more accustomed to. The more time you spend with Scala, the more you realize that you can do with it, and it can take you quite far.

For the highly motivated, I have compiled a list of URLs at http://www.plre.org/languages.html of roughly a hundred programming languages if you want to survey the landscape of programming languages more thoroughly.



Comments (13)Add Comment
Flaming Thunder
written by Dave Parker, March 19, 2008
If you are interested in leaning a new language, I would recommend Flaming Thunder at http://www.flamingthunder.com

Some of Flaming Thunder's features:

- Interval arithmetic.
- Number theoretic transforms for O(nlog(n)) multiplication of big numbers.
- Easy CGI scripting for website development.
- Supports 32- and 64-bit platforms.
- Cross-compiles for FreeBSD, Linux, Mac OS X (Intel-based) and Windows.
- Programmed entirely in assembly language.
- Takes less than 140K of disk space.
- Easy enough for elementary school students, the program to write "Hello world!" is: Write "Hello world!".

Flaming Thunder is the only language in the world that I know of that has built-in support for CGI scripting and that generates compiled CGIs. Plus, you can cross-compile the CGI scripts for your Linux server on a Windows or Mac, then ftp up the compiled CGIs.

Flaming Thunder is new enough that early adopters can not only learn a new language, but can actually influence the development of the language.
One more: FORTH
written by joe public, March 19, 2008
FORTH. It may be on the shortlist, but it really should be right up here, because low level may be doubleplus unfancy, but it is pretty important to understand something of regardless. And it's much easier than assembly.
Processing & ActionScript
written by Nick Plante, March 19, 2008
Well, as we've discussed, Scala is definitely the next thing on my list (whenever I eventually find time to dig in) but I'd like to mention a couple others that I feel are worthy of note (albeit rather niche): Processing and ActionScript.

Both are fantastic for bringing a visual context to the art of development, and Processing in particular is a great framework for learning. ActionScript, an ECMAscript descendant, has come a long ways since v1.0 and if you want to take advantage of Flex or AIR for building web-enabled applications, well, it's something worth considering anyway.
FORTH
written by Christopher Diggins, March 19, 2008
In a draft of this blog article I did include FORTH, but to keep the list truly disjoint I dropped it in favour of PostScript. PostScript also makes it possible to perform functional programming (e.g. lambda expressions).

For those interested in getting close to the metal with FORTH I recommend learning to implement it via this literate programming tutorial.
jonesforth
written by Jack Woehr, March 19, 2008
jonesforth is indeed pretty cool.
...
written by Alex Ott, March 20, 2008
There is very good book about different programming languages - Advanced Programming Languages Design by Finkel. It's available for free at ftp://ftp.aw.com/cseng/authors/finkel/apld/.
Literate programming
written by Dave Parker, March 20, 2008
Christopher Diggins refers to a:

> ... literate programming ...

Flaming Thunder is the only programming language I know of that's designed with literacy in mind.

English: sentences end with periods.
Flaming Thunder: sentences end with periods.
Java, C, C++, etc: sentences end with ;
Basic, Python, etc: sentences end with
Lisp: sentences end with )
Stack-based languages considered harmful
written by Devon McCormick, March 25, 2008
I don't understand why people embrace prefix languages like Scheme and Postscript. When you say something is simple, you say it's as simple as "1+1", not "(+ 1 1)". Stacks are great for computers but maybe not so great for people or maybe they just don't map well to the way I think.

Anyway, the languages on this list look like a lot of the same old suspects (well, ok, maybe not Prolog). For one that will really stretch your brain, try J (jsoftware.com). You'll either love it or hate it and most people seem to hate it. I, however, find its concentrated power exhilarating.
HP Calculators
written by Chris Roeder, March 26, 2008
The author of the previous comment obviously never had an RPN calculator. I found I adapted to the stack pretty quickly.

...I found my old HP-41 last year. Unfortunately the batteries were still in it. Covered in corrosion it wouldn't boot.
Touts quick fix
written by Jack Woehr, March 26, 2008
Emery board the contacts!
HP's suffer corrosion
written by Chris Roeder, March 27, 2008
I appreciate the sentiment Jack. It gets inside, and I lost
patience after a few hours.
http://www.msdsite.com/hpcalcs/hp41/tips/41tips.html
Still Considered Harmful
written by Devon McCormick, April 08, 2008
My comment on "Stack-based languages considered harmful" is based, in part on my experience with RPN calculators.

Chris Roeder's comment about "adapting" to the stack re-inforces my point: if it weren't bass-ackwards, you wouldn't have to adapt to it.
McCormick Misses the Point
written by Chris Roeder, February 03, 2009
If better programming languages were more like English they would be. The article's point about learning other languages is to stretch the way you think. I liked the HP because it stretched me to think in stacks, and it wasn't that hard. "If it weren't bass-ackwards, you wouldn't have to adapt to it." Exactly! Its the adapting to it that is the point of learning some of these languages. Adapting to a stack, in particular, because it's such a pervasive data structure in programming in general is a good thing.


Write comment
You must be logged in to a comment. Please register if you do not have an account yet.

busy

Get your FREE Subscription to Dr. Dobb’s Digest today!

Dobbs Code Talk Quick Poll

This time next year, your most important operating system (host and/or target) will be:

Look Who's Code Talking


Marti Konstant
City: Chicago

Hans Uhlig
City: Woodland

Alexander von Zitzewitz
City: Lexington

Magnus Martensson
City: Malmo

Diego Silang
City: Pittsburgh

Kathleen Kerns
City: Reston

Dobbs Code Talk Tags

.NET abstraction Ada Adobe Agile Ajax algorithm Algorithmic complexity ALM Analogical reasoning Android Anecdotes Apple Application Development AppStore Architecture and Design ARM Artificial Intelligence Artificial Life Assembler Programming Audio files AVX AWK Banking Bazaar Best Practices Blender Books Brain computer interfacing Build C C Programming C Sharp Cartoon Category theory Cellular automata Clojure Cloud Computing Cobol Cocoa Coder Of The Month Cognition as compression Collaboration Common Process/Frameworks Compilers Computational humour Computational narrative Computational politics Computer Science Computers in art computing pioneers concurrency Conferences Consciousness research Contest Contest140 contests CPlusPlus crime CSharp D Programming Data Centers Databases Debugging Delphi Deployment design Design Patterns Digital Signal Processing Distributed Django Documentation DSL dynamic language Eclipse EDA education Emacs Embedded Systems Encryption engineering Erlang Etymology Excel exception handling Facebook Financial computing Five Questions Flash Flash Lite Flex Forth Fortran Fraud FreeBSD Fun Functional Programming gadgets Games Gender Git gnuplot Go Google Graphics GUI hardware Heron High School High-Performance Computing History Holographic reduced representations HTML5 Humanity Humour Hungarian Notation Identity Inkscape Innovation Intel Interview iPhone J2EE Java JavaFX JavaOne JavaScript language engineering Legal lex LINQ Linux Lisp Literate Programming Logic Programming m4 Mainframes Make Mathematica Mercurial Mesh messaging Metaprogramming Microsoft MID Miscellaneous Musings ML Mobile Software Mobility modeling modular programming multicore Music MVC myblog Natural Language Processing Networking Neural networks newspeak Nokia numerical computing Object Rexx ObjectiveC Office Office 2007 Online spreadsheets OOP Open Source Openaccess publishing OpenBSD OpenSolaris Operating Systems Optimization Oracle Pair Programming Parallelism Concurrency Parsing Pascal Patents Patterns Performance Perl PHP Podcast Pop11 Poplog Privacy Processing Productivity Programming Language Implementation Programming Language One Programming language semantics Programming Languages Programming Style Project Management Prolog Psychology Public understanding of science puzzle Python QA Quantum Computing Quotes Rails Realtime recls Requirements Research practice REST Review RIA rich internet applications Robotics Ruby SaaS Software as a service Scala Schadenfreude Science fiction Screencast Scripting SD Best Practices Search Security Semantic Web Silverlight Snobol SOA social Social Networks Society for the Study of Artificial Intelligence a Software Development Methodology and Management Songs and poems Spending Priorities Spreadsheets SQL Startups Statistics Storage String pattern matching Survey Teaching Testing The Business of Programming The Dobbs Challenge The Future Theory Topology Transhumanism Travel on the Job Twitter Types Unix Upgrade Usability Use Cases USENET User Experience User Interface Design Version Control video virtual machines Virtualization Visual Studio Visual Studio Sponsored Post WCF Web Development Windows Windows 7 Windows Live Wireless WOA WPF X Window System yacc

Subscribe to Dr. Dobbs Newsletter

Email:
Dr. Dobb's Update
Delivered twice a week, Dr. Dobb's Update provides unbiased and objective news, commentary and technical features spanning the entire software development marketplace.

Latest Comments

Jonathan's Last Day at Sun
For the 8 years I worked there, it was fantastic. I worked there under McNealy and I have undying admiration for the guy. I only knew Jonathan periphe...
Implementing Thread Local Storage on OS ...
Back in the day, I did a fair amount of work with PThreads. Wonderful design. Some quirks, but basically really, really nice. Although I wrote a lot ...
More Technonecrophilia with Snobol One-L...
Yeah, It's probably identical except for the (embedded) copy number, I would think. Once it became freely distributable, the copy I've been distribut...
More Technonecrophilia with Snobol One-L...
There's a spitbol-3.7-win.exe at http://code.google.com/p/spitbol/downloads/list . I found it via Dave Shield's blog page http://daveshields.wordpress...
Jonathan's Last Day at Sun
Sadness.

The Latest From Our Member Blogs

How To Select Trainees
Written by Joel Wiesen   
01/27/10
Hiring the right trainee can be harder than hiring a trained programmer.  One approach is described at my website: http://www.aprtestingservices.com/business/lpat/
 
Technical Job Interviews
Written by Keith Kerlan   
01/20/10
What is the best way to interview for software developer positions?  I've been on both sides of the job interviewing table, but have been on the interviewee side of some not too  great inter
 
Timers/timeouts in multi-threaded event-loops
Written by Christof Meerwald   
01/03/10
The traditional way to integrate timeout handling (or timers) in (single-threaded) event loops was to just pass the appropriate timeout value to the select/poll/epoll syscall. While this works fine
 
C vs C++
Written by Issam Lahlali   
12/04/09
I think that the debate "C vs C++" will end when the two langages died, and each one have its advantages and inconvenients, the choice of one instead of another depend on the application c
 
Great Jobs at CISCO
Written by Brent Rogers   
11/30/09
Hello! I am a recruiter at CISCO. We have a number of great jobopportunities at CISCO right now. Please take a look at the job links listedbelow and please send me an updated resume if you are interes
 
OK Labs, ST-Ericsson, and the Mobile/Wireless Ecosystem
Written by Steve Subar   
11/17/09
Two weeks ago, OK Labs and ST-Ericsson announced the selection of OK Labs as ST-Ericsson's mobile virtualization partner. To earn this coveted position, OK Labs prevailed in a rigorous evaluation
 
C++ Ninjas Needed in Santa Clara, California
Written by Brent Rogers   
09/30/09
Hello! I am a recruiter at CISCO. Our PostPath teamin Santa Clara is building a new Email SaaS business at CISCO. We are looking forsenior developers with Zimbra expertise to help us accomplish this t
 
Fighting Fragmentation with Mobile Virtualization
Written by Steve Subar   
09/21/09
Last week Motorola and T-Mobile announced the launch of a new and innovative Android-based smartphone, the Cliq. This attractive, feature-rich slider handset happens to build on a chipset and firmware
 
Insights into Router Design: Unit Testing of Networking Protocols
Written by Rajesh Kumar Venkateswaran   
09/07/09
  Unit testing is a software validation methodology through which a programmer tests individual modules or units of source code. If the programmer has been responsible for developing a networ
 
Insights into Router Design: Implementation of Networking Protocols
Written by Rajesh Kumar Venkateswaran   
09/06/09
  Modern data networking consists of a large number of networking protocols, each of which has its own domain of applicability. Some run on end stations (also called hosts), some on enterp
 
Insights and Innovations in Networking
Written by Rajesh Kumar Venkateswaran   
09/05/09
Networking devices such as routers and switches have evolved quite a bit over the past years, both in the service provider network and in the enterprise. It is a challenge to build these devices, bo
 
reddit threads community
Written by Christof Meerwald   
08/30/09
I have just started a threads community over at reddit to cover topics such as multithreading, concurrency and parallel programming. Feel free to join if you are interested. -- cmeerw.org 
 

The Latest From Dr. Dobbs

DDJ