2 ms·
> I think one should definitely try to make code pieces as modular as possible Absolutely. That's the key. Modules and layers; each with its own project identi
by ChrisMarshallNY 7y ago
> I think one should definitely try to make code pieces as modular as possible
Absolutely. That's the key. Modules and layers; each with its own project identity and lifecycle. loose-coupling, minimal APIs, and reevaluation phases at the completion of every module.
If you do this right, projects can be almost "Lego" simple, with the ability to rapidly reconfigure to adapt to changing requirements.
Here's an example. Yesterday, I was working on a "UUID scrubber" for the Bluetooth project I was working on (https://github.com/RiftValleySoftware/BlueVanClef https://github.com/RiftValleySoftware/BlueVanClef). I started by having a private class function to do the scrubbing, but realized that this would be something that could be useful for any similar project, so I broke it off, and added it to my toolbox project (https://github.com/RiftValleySoftware/RVS_Generic_Swift_Toolbox/blob/master/src/Extensions/RVS_String_Extensions.swift#L363 https://github.com/RiftValleySoftware/RVS_Generic_Swift_Tool...). That meant that I also had to write a unit test for it, and then update my Carthage include.
Took, like fifteen minutes, and I now have a permanent tool for scrubbing UUIDs.
Another habit that I developed, was making every project I do, including "one-off" experimental projects, "ship quality."
I simply cannot put too much stress on the need for maximum quality. As a lone developer, I just cannot afford bugs. It's imperative to do it right the first time.
The general argument against a high-quality process is that it is inefficient and slow.
Unless you make it a habit.
"We are what we repeatedly do. Excellence, then, is not an act, but a habit."
-Aristotle (Probably, but these attributions should always be taken with a grain of salt)