Why (almost) all production code is garbage
Tags: discuss
Published: 2022-07-21 04:15:47

This is probably my last article in my myth busting series where I tell the raw and unfiltered truth about stuff I've learned during my 40+ years of software development in total, and 25+ years as a professional. The idea is to propose alternative methods to create software, with the objective being to get rid of superstitious belief systems, dogmas, and assumptions, to replace these with _stuff that works_.

The dirty secret of our industry is that _almost all production code is garbage_. The reason is complexity and over engineering, combined with Kool Aid marketing, implemented by companies wanting you to chose their stuff, such that they can grow their market share, and earn more money. This is often coupled with lock-in strategies, resulting in that once you've chosen your vendor and technology stack, changing it mid streams requires _rewriting everything_.

I have a solution to the problem, and it's basically referred to as SHIFT+DELETE refactoring. This is why I chose a photo of myself wearing a t-shirt illustrating the process, albeit in a funny way. If you don't get it, read the text of my t-shirt once more ... ;)

At this point some readers might object and claim that I've got my own company, with our own solutions, implying I've got financial incentives towards having others choosing our stuff, and that the differences between my company and most other companies are small - However, this is simply not correct. Yes, I do have a company, and yes we have financial incentives for you choosing our stuff - But, first of all, we have based our entire value proposition upon simplicity. Secondly, our stuff is in its entirety open source, permissive style. Third of all, our incentives are to have you use our stuff, and pay us money - But in order for that to happen, you must either start a new project, create a new micro service with our stuff, or as I would happily propose in regards to your legacy garbage; Do the SHIFT+DELETE refactoring process.

Hence, our incentives are much better aligned towards your employer's incentives, and your incentives, being (I hope) to deliver high quality products, delivering whatever your employer needs for it to deliver, such that you don't suffer a (nother) nervous breakdown a year down the road, due to having to maintain a mountain of garbage.

> Contrary to other companies, we believe in great products telling our story, conveying our message, doing the marketing for us. AKA; Why spend 5 months doing that which you can do in 5 hours?

If we can succeed with the above marketing plan, we will have permanently changed the software development industry, since others will copy our strategy, resulting in an increased amount of innovation the world hasn't collectively seen since [Gutenberg](https://dev.to/polterguy/what-software-developers-can-learn-from-gutenberg-5bpa).

From a risk assessment point of view of course, this is much more risky than just keep on piling garbage upon garbage, adding more garbage to the world, using Kool Aid marketing strategies, locking in our customers, by delivering (sigh!) yet another [message broker](https://dev.to/polterguy/you-should-probably-fire-your-kafka-developer-j9l) or [NoSQL database](https://dev.to/polterguy/sql-is-almost-always-superior-to-nosql-361g), preferably built with some [OOP rubbish methodology](https://dev.to/polterguy/oop-a-software-development-mass-psychosis-9n4), resulting in the world growing further away from its beauty of simplicity, such that we can make money by continuing this _"middle of the road garbage strategy"_.

My bet with the Creator though, is that truth matters, quality wins in the end, and people will somehow enjoy simplicity once given a choice.

## I repent, FoxPro was better

My first job as a professional software developer was for a small company with 40 employees. We were delivering ERP systems, and our primary platform was FoxPro. FoxPro was a 4th generation programming language, so easy to use, you could create new software in hours using it. However, it had few if any OO mechanisms, it was naive at its core, and as Kool Aid marketing managers started tempting me with OOP and complexity, I fell for it. I apologise for that ...

FoxPro had _"issues"_; It was difficult to scale, it couldn't deliver web apps, it was Windows only, etc, etc, etc. However, at its core there was extreme beauty, that allowed its users to deliver in 1 hour what you would need 50 hours to do in C# or C++. Hence, I confess to you.

> I modelled Magic after FoxPro!

[Magic](https://github.com/polterguy/magic) is to modern web application development what FoxPro was for desktop development 3 decades ago - Minus the Windows lock-in, with the ability to scale, yet keeping true to the _"do in 1 hour what you need 50 hours to do in other platforms"_ philosophy at its core.

## Return to innocence

The first program I ever wrote was on an Oric 1 in 1982. I was 8 years old. The program was as follows.

```
10 PRINT "THOMAS IS COOL"
20 GOTO 10
```

The simplicity of being able to create software using constructs such as the above, inspired me to becoming a software developer, resulting in a comfortable life for me. My sadness on behalf of today's kids, is that it is impossible for them to reproduce the feeling I had. If a kid today wants to learn software development, he's got to spend 12 months learning OOP, HTML, CSS, C#, and God knows what more before he or she can even reproduce the simple code above in a _"modern programming language context"_. And unless we can fix this problem, society as a whole is at risk. We need paths for our children to more easily learn, the same way we easily taught ourselves what we know. And OOP, Kafka and NoSQL is _simply not it_!

I want to finish with a video I believe illustrates what I'm trying to achieve. It's arguably got nothing to do with programming, yet still everything to do with programming. I'll let it speak for itself. Thank you for reading ...

{% embed https://www.youtube.com/watch?v=Rk_sAHh9s08 %}