It started with a script...
Situation
Recently we prepared the compilation of GnuPG with the help of a convenient download script for the sources, including libraries. For today it was planned to unleash the source code from pandora's boxes aka the bzip2 tarballs and move around with the first steps. But then things started...
SNAFU
The plan was a little software project with a few shell scripts to construct a reproducible environment for compiling and testing GnuPG. No big deal, right? Wrong! It might seem surprising, but even after publishing a single script and preparing the second one things started running out of control. The original approach might have had a chance to work for a single file project with a growing shell script, but splitting the tasks into several scripts required thinking deeply and refactoring early. Yes, refactoring became necessary after the release of the first file. Almost unbelievable. I know about projects which have been running into the wrong direction for far too much time, making wrong decisions from the beginning or defering the necessary code refactoring for arbitrary reasons over and over. It's quite easy to see wrong doing somewhere else, but this time I was prepared and trained to observe myself and my own project. Something felt wrong - time to pull the emergency brake.
Code of Problems
One major problem is the fact that all the scripts work on the same data pool, with the filenames defined - where? Define them in each script? This will lead to hell style code maintenance. Especially the software version numbers will change with time, and the proposed target path will vary with user preferences. Do you want to change the path name in a whole bunch of files? Or do you prefer a single configuration file? Do you think I want to update the version numbers in a gazillion of files? Let me make an educated guess about your thoughts and wishes... of course no sane human being wants to edit the same stuff in a bunch of files over and over.
Clean Code Correction Proposal
Since I already introduced a folder bin
, another folder etc
. is the logical option, and to include shared code yet another one: lib
There is another problem left to be solved: initial distribution of the code. People familiar with git can use this method, but maybe a single starting script for beginners would be a good idea. And finally: the repository. It feels like it's time to move away from the incubator repository since meanwhile it became clear which direction the journey takes. These are the remaining minor questions, but regarding the big think (this is poet slang for... you'll figure it out) I guess I can draw the line: the deed is done. There is refactored code already, but not uploaded yet, because some work still needs to be done. However, this won't take too much time since we have clear sight now.
Hopefully normal operation will resume with the next blog post regarding this topic.
WP: Code refactoring
WP: SNAFU
To be continued...