Day 15 – Reorganizing

Every project needs to be organized in one way or another. There isn’t one ideal way, so most projects are organized suboptimally according developers’ abilities and experiences. It’s a hard problem, we, developer, have been trying find best way to do it since 1970s, so no judgement here.

It has come the time to split SlothCMS and Toes language with its template engine. Main reasons to split those two even though Sloth depends on Toes were modularity and testing. Toes are mostly independent on Sloth and new features can be added without dealing with the whole Sloth.

As for the testing I am still looking for a good structure of things. Sloth’s codebase structure is based on codebase with which I work at my day job. It is modified to my liking as it wasn’t useful to split code by languages since there will be no SPA for Sloth, someone else will need to make it, SPAs on personal projects aren’t my cuppa. So now it’s split between flask app’s, database’s and script’s folder. The last folder is at the moment empty and if it’s used it will contain independent scripts that will be executed by cron or manually.

On the other hand Toes structure is resembling Python project a lot more. After five months of working in Python in the evenings and on weekends without a senior developer near by I am starting to resemble a Python developer in my style of coding, not just out of place front-end developer with Java habits1. Make no mistake it’ll take me with same pace at least five more months before I stop considering myself a dangerous Python developer.

Breaking into a new language like Python from Java or Front-end languages without a more experienced developer is hard because the conventions are different and as usual there are very few tutorials beyond the basics excluding setting up projects. So when it came it implement testing for Toes I felt lost because I went alone on this adventure.

Fortunately author of Patrick’s Software Blog wrote about setting up testing more complex project, projects where tests need to be in a separate directory. Even though it was complicated, dyslexia is strong these days, to follow Patrick’s steps Toes project structure is something that I am content with. One thing was still missing, ability to debug tests. This time my look up abilities found Don Jayamanne post about unit testing in VS Code.

  1. I respect Java developers and I don’t want to do Java