Python Noob

I’ve been programming for pretty much 30+ years. You’d think by now I would have touched more common languages. Turns out that there are more languages than I care to know about (I’ve used 7 of the top 10, and about 12 of the top 20), and that not all common languages are useful all the time. It also seems that I’ve skirted two popular programming languages: JavaScript (or ECMA Script) and Python.

The former has been on purpose. JavaScript just makes my skin crawl. I’ve avoided it at all costs knowing something better would eventually happen. It’s been 10+ years. I’m still waiting, although signs are promising I can skip it entirely. It’ll be better for my sanity.

The latter, Python, was avoided as it also made my skin crawl a little. It was never used anywhere I worked either, so I never looked in to it much. Version 3 went mainstream, and so I took the plunge. Wait, there is more to this. I did actively avoid it as version “anything before 3” was about as bad as JavaScript with language design. How it became so popular I don’t know. How I can be such a hypocrite, considering that I tried R which is significantly worse? It is because I am my own person, and I can make my own damn mistakes! So there! Time to correct them.

To be honest, Python was always a back-of-the-mind interest for me. First off, it was popular and is mentioned in just about every conversation about data science; something I’d dabbled in (a.k.a. I cleaned up some data and analysed it, #data-science /sarcasm). Though version 2 was still main stream, and version 3 apparently broke everything, there were pitch forks and witch hunts (I doubt there were, but there was a lot of muttering about version 3 not being compatible with 2 and how all the libraries would be broken). Anyway, I waited it out.

Ultimately, it was when version 3 became main-stream and version 2 was on the chopping block that I honestly thought the time was right. Version 3 cleaned up a lot of the bad of version 2. I think version 3 is more of the language it should have been all along. It’s a clean language and full of libraries to do just about anything. It’s quite a good looking language to boot.

So I took the plunge.

The rabbit hole deepened.

Now I like it a little.

Or maybe I like it quite a bit.

Actually, I like the language a lot. I mean, who couldn’t like anything inspired by Monty Python (granted, after version 2)? So I experimented with it and did a Udemy course (almost complete, #COVID-19 has derailed everything). I now know everything that there is to know. No, not really. I am scratching the surface. I like what I see, and I love the style of the language.

What makes it interesting?

First off, indentation/white space is significant. It’s the first language I’ve used where indentation has real meaning. Okay, I did COBOL during my studies, but who writes that now? Although maybe I should dust that off as I believe COVID-19 has required a return of COBOL skills or something? Anyway, I digress. It’s interesting as indentation is the scope and there are no curly braces. At first, I thought I wouldn’t like it much, but it turns out it’s quite a nice way of writing code. Not only does the indentation make the code flow better, but you can actually see where the various scope levels are. It’s a readable language.

Look, it‘s early days so far and my history with new languages of late is patchy (I never seem to get going beyond a quick start; my foray in to Haskell and R come to mind). I think this might be the one though! I’ve even written a Toxic Bunny BAG file parser, and it’s not an awful implementation. Let it be known it’s already a far better implementation than 1994-C-me. I’ve improved just mildly since then.

What is not right?

I’m still in the air about some class “magic” that happens. I’m used to first class constructors and properties and overriding. Having def __str__(self): be a thing is a little weird right now. I don’t think it’s awful, but it is still a little weird. I don’t like “magic” in programming languages, but I’m sure I may get the hang of it; the “magic” will turn in to “it’s just how it works”.

Is it better than «insert my other languages here»?

Depends. I made the majority of my living off of C, C++, T-SQL, and C#. I doubt Python will usurp those languages in my income stream. Is it better than any of them? It’s hard to say. I think it’s a good language, but at least two of the four I listed are probably my go to languages should I ever find myself heading back to full time development.

Is it a fun language? Hell yes.

Conclusion

Python is fun. Python is interesting. And Python has a lot of libraries for just about anything; from game development to data science to medical analysis. It’s unfortunately not the fastest language, but performance is not its main criteria.

Anyway, please look forward to my new love affair (don’t tell my wife or kids) and wait for many new posts on the subject. Or not, you just never know with me…