language fluidity
- 4 minutes read - 772 wordsI have learned a lot of programming languages over the course of my life. So I wanted to do two things:
- Discuss a few effective ways to pick up a new language.
- Discuss a few references that I’ve found helpful for some languages. I should start with a disclaimer: I do enjoy learning new languages, but mostly I enjoy creating things in those languages. I’m not sure all the effort I have spent learning many languages would not have been better spent learning many fewer languages to a deeper level, but I do feel like it is extremely important to learn principles, not languages, and to use the best tool for a particular job. Many times principles are most clearly illustrated with contrast between languages, and many more times a particular tool has been a patently poor choice for a particular job.
That being said, it’s important to know your “first tongue” languages in significant depth.
Projects for New Languages
Starting in a language can be bewildering. Formal courses provide an obvious route if you know less than a couple of different languages. These can be formal courses that teach a particular language, such as An Introduction to Interactive Programming in Python or Functional Programming in Scala, or they might be courses like Computational Investing, which teach investing topics with a strong computational/Python slant. Finally, Codecademy is another a great option because it walks you through the basics and gives feedback on actual code you write.
The trouble with those kinds of courses is that they waste a lot of time discussing basics of computation: data types, function calls, conditionals, and looping. While this is great for beginners–and even beginners to a different paradigm like functional programming–it is tedious to relearn for loops for the 30th time. Once I understand the basic nouns and verbs of a particular language, I usually jump right in to some problems.
- The “99 Problems” lists are truly fantastic. The original was P-99: Ninety-Nine Prolog Problems; I’ve seen specialized lists for Lisp (L-99), Scala, and Haskell. You can also find solutions for tons of languages, such as this list of Python solutions.
- Another great resource (and in fact, what I used to learn Python) is Project Euler. I also really enjoyed working through some bioinformatics problems on a site called Rosalind.
- Translate a (small-ish) project of yours to a new language.
- Implement a (small-ish) algorithm in your chosen language: K-Means, Newton’s Method, or some numerical linear algebra routines are some great options. The key is not necessarily to write industrial grade code (because you probably can’t compete with existing implementations of those algorithms), but that there are industrial grade codes out there to compare your solutions with.
Resources for particular languages
I can’t start a list like this without calling out two references in particular:
-
Structure and Interpretation of Computer Programs: An undeniably fantastic introduction to computation.
-
Code: The Hidden Language of Computer Hardware and Software: An undeniably fantastic introduction to computers themselves, from the individual wires on up. I’m going to limit this list to just four languages: C++, Haskell, MATLAB, and Python:
-
C++: I highly recommend Accelerated C++: Practical Programming by Example, which was my refresher to C++ in about 2010. After reading through that, it’s probably worth reading Effective C++, Effective STL, and More Effective C++, all by Scott Meyers. While Accelerated C++ will get you up to speed on the basic syntax, the others will teach you good C++ style and structure. This is critical, because C++ has a lot of pitfalls and it’s worth the effort to avoid them.
-
Haskell: I don’t know Haskell nearly as well as the other languages in this section, but I did enjoy working through Real World Haskell and Haskell the Hard Way. I also really enjoyed Write Yourself a Scheme in 48 Hours and JEKOR’s Redoing Make (Haskell From Scratch) videos–both were extremely convincing arguments to use Haskell.
-
MATLAB: Data-Driven Modeling & Scientific Computation: Methods for Complex Systems & Big Data by J. Nathan Kutz is hands down the best and most comprehensive MATLAB reference I know of. The hard part about learning MATLAB is that often, you are learning a great deal of mathematics as well. This book steps through a lot of it, taking third-quarter calculus as the baseline.
-
Python: I learned Python long enough ago that I have forgotten exactly what I read while I was learning it, but two resources I do remember liking a lot were Dive Into Python by Mark Pilgrim and How to Think Like A Computer Scientist by Allen B. Downey, which also has a free pdf version.