Your first coding language: what's wrong with Python

I saw this post the other day that got me thinking about how I learnt to #code.

It was a great opportunity for me to revisit a post I wrote nearly a year ago on the subject: So you want to code? (Lawyer Edition)

The original poster concludes on why getting people to learn #Python as a first language is bad:

Remember how pythons kill. Not with teeth or venom, but by embracing you and slowly squeezing. The only reason we use this language is because everyone else does. We can discuss what's better, but we need to acknowledge that python is not good.

This might suggest that people shouldn't learn Python as a first language, but once you study the substance of his complaints, it doesn't hold water:

  1. Package hell: it's true that this is a problem with Python, especially when compared to installing something on Windows. I'm not sure how to “solve” this. The basic idea, which works for many installation instructions for python, is to create a virtual environment. I haven't had much problems with this issue once I understood the point of isolating your program's environment.

  2. For some strange reason, using for loops is slower than other ways of iterating: nobody is stopping anyone from using for loops. Besides, computers are so fast these days, whatever differences in performance is likely unintelligible to a beginner.

  3. Unhelpful error messages: I have never experienced great error messages when I was a beginner, and they were always bewildering, frustrating and unhelpful at first. JavaScript wasn't an exception. It's a learning curve, and if you're serious about coding, you need to figure this one out in any language.

  4. It's slow: seems similar to problem 2.

As I read my old post, I realised I never made any recommendations on #programming languages. This is the relevant paragraph.

So, this is my suggestion: don’t aim to conquer programming languages or produce full-blown applications to rival a LegalTech company you’ve always admired on your own. Focus instead on developing proof of concepts or pushing the tools you are already familiar with as far as you can go. In addition, look at no code or low code alternatives to get easy wins.

I am a firm believer in using the best tool for the job. For example, web development in Javascript is miles ahead of any other language. Though I've dabbled in the growing list of Python projects which promise to match React and Next.js, it's not meeting my expectations. Having said that, I seem to be delaying myself whenever I have to do some frontend work. I guess I am not looking forward to coding in #Javascript.

So, if you want my opinion on what should your first programming language, I would recommend Python for the ecosystem, the docs and the “batteries included”. In an imperfect world, it's the best.

Author Portrait Love.Law.Robots. – A blog by Ang Hou Fu