Recently I’ve been taking the very good CodeCademy course on the Python programming language. I’m doing this for several reasons. A number of my colleagues use Python, and I’ve been using their code and libraries. Knowing what I’m doing might be a good idea. Also, Python seems to be more of the language of choice these days instead of my perennial favorite, Perl. Plus, Python struck me as a clean, sparse language where you can do a lot with fewer syntax quirks getting in the way.
But doing so has set me to thinking about learning a new programming language and the things that one must forget from previous ones. I first learned computer programming in the early 1980s with BASIC. From there, I learned some FORTRAN and Pascal. Perl became my go-to language for writing web CGI programs. Also for data wrangling.
From BASIC I learned the very bad strategy of using GOTO statements to jump around in my code. It took me years to shake the bad habits that such an idea engendered. Pascal helped me to think in terms of modules or subroutines which I of course took with me when learning Perl.
But in making the transition from Perl to Python I’ve found a few “gotchas” that come from hard-to-break habits. For example, typing. With Perl, you can simply treat a string like an integer and it just goes along and treats it like an integer. With Python, you first need to change it from a string to an integer (e.g., “int(x)”).
Hard-to-break habits, outmoded ways of thinking about the solution to a problem, the requirement to learn a new syntax — all of these and more can make it difficult to transition to a new language.
Which brings me to the essential problem with programming languages — there are too damn many of them, and there are more all the time. If I had to give someone advice at this point about coding, I would say learn as few languages as you can get by with, and learn them only well enough to do the task at hand. Because otherwise, you’ll just be trying to unlearn it all someday.