4 ms·
Thing is, trying to create a perfect first version actually takes more time and mental energy than having a defined good base, creating a first draft and testin
by frostwarrior 4y ago
Thing is, trying to create a perfect first version actually takes more time and mental energy than having a defined good base, creating a first draft and testing it.
Here are some tips from personal experience:
1) Program with refactoring in mind beforehand. Things like SOLID, Hexagonal Architecture or even MVC help make refactoring easier.
2) Practice a bit with SOLID principles in your language. Once you get the gist the first time, every project after that is just copy and paste. Upload that base project to a personal git repository if you like.
3) If your project doesn't have to be lightning fast then prioritize legibility over superb efficient algorithms. For example, directly operating and mutating an array may demand less CPU cycles than mapping and parsing an array into controllers and descriptive functions. But unless you can wrap that in an accessible way, it will make further development hell.
4) Software engineering is weird. Unlike other engineering fields, our requirements and constraints change all the time, and the product is never meant to be static. The more flexible a program is to develop and refactor, the more it will maintain its quality over time. Even a perfect and fast program will crumble over time.
The "I don't have time for good code" is a mental trap and a sign of either nearsightedness, or letting oneself be dragged by anxiety. It's our job to at least make notice when development is badly managed.
Leaving that aside, I assure you that once you have a good boilerplate project, every program built on top of that will be fast and flexible. And any bugfixing will be straightforward.
- lobstrosity420 4y agoThank you for the tips! SOLID has indeed been an excellent tool in dealing with this. Unfortunately, there are a few issues at my current day job that make even your principles a band aid. 1) We have a "project board" composed of non technically inclined managers who set deadlines independently, this has resulted in an environment where everything is for yesterday. Once something works, I'm already late for the next thing. 2) My teammates are not really well versed in SOLID principles, so my good boilerplate project I've set up at the beginning of the product cycle has already been mangled (I wish I had time for mentoring). Indeed, it is our duty to raise these issues but if you are powerless to change the org structure it is best to let go (and update your CV). I'm just venting a bit here I hope you don't mind :)