Sérgio Lopes Sakabatō, the reversed blog!

I am NOT a python programmer!11 Jan 2013

That I am not!

I’me used to use whatever tool I need for the various projects I have to work on, it doesn’t matter if I like it or not, I use what I need. I’ve used programming languages I don’t like, languages I feel are easy, languages that are just strange, etc., so I’m not one to just give up easily when I have some trouble working with any new technology or programming language but Python may be that one language I can’t use.

Since I’ve been working in my new job I’ve felt like I was back in my engineering course: several different programming languages and systems, all requiring my attention, strange mixes and several projects each with its own oddities. But there is one particular project that has a backend created in Python that I ended up as the sole maintainer, and that’s where I really got in touch with Python…

I’ve wanted to start developing in Python for quite some time now, never managed to get a project with it but have had the change to do some small changes to open source projects that use the Python programming language, never did anything useful but the basic syntax and rules was not something new to me. So I picked up the server code, did my best to follow the installation guide (a simple set of strange commands) and dived head on into an already live project built by someone else that no longer works in the project (so yeah, no support from the original developers :) ). Let me say, I don’t understand what is “easy” about Python or why is it a programming language that everyone seems to say it is “easy to read”…

You write your sentences backward!

To be fair it may seem a nicer way to write conditions but it just collides with the many years of writing “C like” conditions, I know I can write using the common construct _IF THEN _ but there are many places in the code where the conditions are written in one line as _ IF THEN _, it's just strange! It makes it harder for me to read and I can't wrap my head around it

The way my code looks should never affect what it does!

This is my biggest issue with Python code, indentation matters, and it matters a lot. If I mistakenly add a space (yes I use spaces not tabs) it breaks the code, if I don’t really notice that I didn’t properly align a piece of code because I was just testing something the code breaks, if my stupid IDE just starts mixing tabs and spaces all bets are off (happen before I realized PyDev was using tabs and some files had spaces and some already had mixed settings and it was a mess).

Why would it matter how I present my code? I have and IDE with rules that sets the look of the code depending on what I’m working on, I can’t do that with Python, if I change the way it is displayed I’m actively changing what the code does. I hope it makes sense to you (yes, I know you are using Python!) because it makes no sense at all to me.

It is NOT easy to read!

Maybe it is again my years of looking at curly brackets as block delimiters, or having delimiters at all, or maybe it is the tool I’m using but I often get lost scrolling up and down just to try and see if that last line is still inside the IF block, or if the code I wrote ended up inner into the function instead of being for the class or something simple like that, some times I even find myself counting spaces to see where I am writing the code (seriously :( ). I had to tell PyDev to show the white space chars and now have little dots all around my code, not easy to read at all I must say.

What wacky tech stack is this?!

This is probably not Python’s fault, but the server provides an API using an nginx server that is setup to communicate with some supervisor system that then handles all the applications instances, which in time is implemented using the Flask framework with SQLAlchemy module and SQLAlchemy migrate to manage database updates, some WTF (I must agree the name fits well) module that is just annoying to use and expand (and by that I mean add new forms or pages) and countless other modules that eat so much memory I had to start writing things in a more “lower level” way (like remove the module that was used for images and just use the convert command or drop ORM code for hand-written SQL in more complex queries because the client apps would just get no reply whatsoever from the server when the process broke)… and to install all this you first get easy_install to “easily install pip” that seems to be easier than the first (they seem to be the same to me), oh and don’t forget the virtualenv… really? I mean the server only handles this damn application do I need those virtual environments for anything else but make any update harder?

Bad experience or just not my thing…

I don’t know if it is the server code that is a mess and badly written (exceptions as application flow control is nice, but I particularly like the exception code that breaks the server or the non-existing exception code were we know exceptions may be thrown thus breaking the server) or if all the strange and possibly more complex than needed server stack, or even if it just me, but I can’t seem to like the Python programming language or the way it works, it is not an easy language for me nor something I enjoy doing, it actually gives me a lot of pain and suffering to develop in this language.

Now, I understand that language is used by many companies and developers (yes I know Google uses it, but I also believe they make mistakes like any other company :) ) and I understand that I may be fighting against the language due to my C and Java background but in the end I don’t really want to start any other project using this technology, I have one server code to maintain and upgrade but I won’t really start on any other python project if I can run from it :)