Python: from complete hate... well, to at least a more friendly coexistence
Tags: python, django
Published: 2018-10-14 03:14:48

---
title: Python: from complete hate... well, to at least a more friendly coexistence
tags: python, django
published: true
---

<img style="width: 30%; height: 30%" src="https://thepracticaldev.s3.amazonaws.com/i/g7u3c0pjraykgd4wi4w8.jpg"></img>

>Disclaimer: well, I used to write a blog on my native language, the weird and so gramatically cluttered Brazilian Portuguese. Some rules on "tupiniquin's"language are extremely strange even for native speakers. But, in English, it's practically my debut (I tried to write most of this without consulting translator). I write comments sometimes, but I'm not a "English practitioner". So, sorry for any mistake, and feel free to comment any correction you judge necessary<h6>

On start of graduation, many I.T. students learn a programing language and join it's "advocates team". On my case, it was with one of the most criticized, but even that way, still popular, vm-based languages: Java.

Our teacher was a Java enthusiast. After learning object-oriented paradigm, rich interfaces with JavaFX, and a little bit of Android, I was so excited and even not considered the possibility of doing something else without the Oracle's programming language... until my current project arrives in the horizon...

With a scientific initiation program, my college have research projects for software development (or systematic reviews) started by teacher's ideas. One of my professors created a framework to solve one of the biggest problems on Brazilian higher education: deal with the self-evaluation report, required by the Ministry of Education, which on, an ideal world, have to consider all the spheres who constitutes the institution, in axes and dimensions specified on a technical note publicized by INEP (National Institute of Educational Studies and Researches).

And, what's the problem? It demanded a software tooling... in a legacy application developed in Django, so called SUAP - Sistema Unificado da Administração Pública (in direct translation: Unified System of Public Administration). This application have data from teachers, administrative personnel, students, and so many people who studies, works or have some function on two institutions: the Federal Institute of states of Paraíba (IFPB) and Rio Grande do Norte (IFRN), and was originally developed by the last one, and adopted by the first one. But on my campus, among students who had to deal with it, this system has an extremely negative reputation.

As a Java programmer, deal with an indentation-based programming language wasn't anything good at start. And with a project with a so big scope, we tried to start as soon as possible. And things, few times after, become more and more complicated. 
The code doesn't have any documentation, and development environment requires a so complicated setup in a Debian-based Linux distro. The configuration of this environment, which was passed to us via document, was our first problem. Some dependencies are outdated, and our little knowledge about Linux made things quite complex. So, I decided to "radicalize": I tested in the past a so friendly distro called Deepin (from China), and we tried to do things on a so outdated version of Ubuntu. I ditched this system from academic machines, and tried, with success, to do the procedure on it. We win the first battle... but there's was another one.

A developer's guide, provided by the previous developers, was so poor. Don't had details about how Django works, and how application itself works. We tried to do our activities only with a reading of few slides of a short-duration course, and with answers in Stack Overflow. We tried to do the possible to follow the product prototype. But then, I started to figure out how unproductive it was: the code was so complex, cluttered, and unstable. I started to pass my afternoons cursing the language, the code, the everything trying to find a solution for random problems... There was a day I was so distressed that I have to come out of the room to pass 30 minutes - 1 hour to put my head on place, breath some air, and get calm with some coffee (I was distressed in other occasions, but nothing that intense).Our teacher even considered requesting a Rest-API from veteran team, to we start to re-do all application using Angular, PHP or something else. Fortunately, it wasn't necessary.

Finally, after reading some legacy code and some lines of Django documentation, I decided to ditch all "adapted" code, and trying to doing things just with documentation and inspired by own legacy code. And things started getting better. On few months, we started to mature on Django development. I started to understand that my hate, and the hate of previous developers before me, was anything but lack of proper knowledge, justified by an extremely poor documentation on the code. So, I started not only to care about the quality of my code and trying to follow good practices on Django, but started a documentation on this system to help other Java enthusiasts on my campus who, probably sometime after my conclusion, will have to deal with it.

Now, if Python isn't being my favorite programming language, at least I don't hate it anymore. I'm so used with it sometimes, when writing JavaScript, I started forgetting to put the "{" on end of if statements (actually, I'm so relaxed that even this makes me laugh). I started become more and more curious about Django, and discovered some of its specialities, and I started to feel the same thing I felt when started doing interfaces with JavaFX. I become enchanted with developing stuff in a more suitable way again.
 
I'm still considering myself a so regular, starter, not so skilled Python developer. But at least I'm not a distressed one anymore.