Just another scripting language
Initial thoughts on Python, from a JavaScript developer's perspective
Up to this point, I’ve spent my entire career in JavaScript. For better or worse, I really have enjoyed it. There is a lot of variety of problems you can solve with it. It also really leans towards being full-stack. You can write code for the browser, as well as a backend web server using Node.js. Setting aside whether it is the best language for the backend (it probably isn’t), it is still incredibly flexible. You also have native event-driven patterns. If there are SDKs for a given service, JavaScript will be one of them. It has become prolific. I think part of that is also fueled by the advent of TypeScript. While it does have its problems (particularly at service boundaries), it expanded the developer base of JavaScript.
With all that being said, I’ve started to dive into Python at my new job. It definitely wasn’t my next choice in languages to learn, but it has the most packages for interacting with AI (and that’s just the tech stack). The backend server is using the Django framework. I find it’s design kind of unintuitive, but that’s also probably because I’ve not really built software with frameworks. I’ve always done it “the hard way” with mostly raw JavaScript. Sure, I used Express on the web server side to simplify things a bit, but that’s a tiny framework compared to Django (and it admittedly isn’t the best anymore). I’m not super deep into it all yet, but my initial experience has been sub-optimal (AKA, more to come as this job progresses).
Python and JavaScript have lots of similarities, but a lot of that comes down to the fact that they are both scripting languages. They are really good at one off script implementations, but managing and maintaining larger repos can get a bit out of hand. I’ve dealt with large monorepos in JavaScript that deploy multiple services. It can be painful. Don’t get me wrong, lots of work has gone into making them capable of lots of functionality and implementations. There are a plethora of web server frameworks. The package ecosystem options are endless. Just about anything you can think of has a package that solves the problem (or ten). They are really popular languages, especially for getting started.
What I mostly don’t like about Python is the “magical” nature of it. Part of that is Django, but some of the native “Python-isms” are still weird. Don’t get me started on **kwargs (keyword arguments). Trying to sleuth through the code to figure out where a particular argument is used in the class chain is painful. Speaking of classes, they feel bolted on and almost an afterthought, which is fine, but bothers me. Lots of things “just work”, but trying to figure out why can be frustrating. I want to understand why and how it works so that I can debug and solve problems.
The business side of my brain says “great, we can do some things faster”. The engineer in me says “I’m tired of just another scripting language and want to expand my engineering expertise”. I know there is a lot to learn with Python, but it feels like more of the same. Because it kind of allows you to “do anything”, it’s so easy to fall into bad patterns. Not that this is much better in JavaScript, but I’ve learned those already. Been there, done that. I also miss the functional side that isn’t as easy to do compared to JavaScript. It feels limiting. Not necessarily better or worse, just different. My buddy always talks about how great it is, but he isn’t an engineer. He wants it to just be easy and work. I want to fully understand things to build better software. It’s a tradeoff, but one I don’t really want to make.