Thursday, November 24, 2022

Orientation

When working on a large piece of software, the single most important goal is needing to get a really good piece of code out there that has no immediate defects.

That is, software being a list of instructions, the underlying quality of that list is the key thing to focus on. If you need to do ten things, then neither less nor more than ten is correct. You need ten things, you should create code that does ten things.

Thus, the fundamental tenet of software engineering then is that it is far better to produce no code than to produce bad code. That is, not having done anything at all is better than having produced a crappy program, since that code will just make things worse.

So, there are 3 simple rules to help make the code good. Any and everything should be all about getting goodness into the code.
  1. The code will solve the problems it was written to solve. Not partially, but completely.
  2. Any unexpected weirdness external to the code will not keep the code from solving the problems it was written to solve.
  3. As the focus expands to solve more and larger problems, the code can also expand to correctly solve more and larger problems.
Then #1 is all about analysis and design. You can’t solve something if you don’t know what it is that you are solving. If you do a poor job of figuring out the problem, then the solution will be partial, which is bad.

#2 is all about error handling and interfaces. Other computers or people cannot disrupt the code. It still works, at worst it slows down, but it still works. It will produce the solution, even in the craziest of circumstances. People will still be able to get the solution, even in the craziest of circumstances. It’s not enough to just get it to work, it has to always work in order to not be bad.

And #3 is about extensibility. The next release is not the last release. Systems just keep growing, and we want to make it easier to grow as it gets larger and more complex. So, the code is readable, the fundamental behaviors are documented, and it’s not so hard to onboard a bunch of new developers to build out more stuff that correctly fits into the old stuff.

If you cover those 3 rules, then you’ll get good code. But to do that the focus needs to be on covering those rules, if it is misdirected onto anything else, you’ll end up with bad code.

No comments:

Post a Comment

Thanks for the Feedback!