Sometimes it’s good to stop writing code. I was tired of my code. It’s messy. I started with good intentions in the beginning, but then…
Anyway now I’m starting over all my project. I want to write good software.
I spent time studying other people’ code and my book on Go programming. I also watched documentaries about how programming languages were born: extensive videos about C++ and Python… I really liked it. Very nice and interesting.
The last thing I learned about Go programming is about testing. In Go, it’s simple. I’m splitting my code in small packages (modularization) and each package in many files. Each package takes care of a single part of the project. Each file takes care of a single part of the package. And then, it’s very nice to write a test-file for each file. That test-file is used to test just that file.
I already put many functionalities inside packages. Now I can test each of them alone. Proceeding in this way is very nice and tastes like real software engineering. It’s cool.
Today I started severing the “TUI” part of the code, moving it into the view package. This package will take care of printing on the screen. The windows, with their frame… I did all these things already, but in a chaotic way, now I started over with the “frame”. This is something I could not do before: separating the window frame’s code and testing it. It’s beautiful. I can test all kinds of frame regardless of the rest of the project. While the project is on development, I can test any single part of it separately.
