"Quality code", in my experience, often means "code that looks like how I would have done it". In other words, it's usually pointless nitpicking and you're better off not engaging in it. Of course, there's some convergence on this topic because certain programming influencers successfully pushed their opinions onto many people who choose not to have opinions of their own which is something that happens in every field…
It's OK if your code is just good enough
81–90 of 149 posts
Re: It's OK if your code is just good enough
#82the typical collaborative implementation environment is a disaster. we are baking a cake, slowly over weeks and months. we aren’t sure why or who’s at fault, but we are absolutely sure it looks awful and tastes worse.
the only silver lining is that the solution to this disaster is hiring more collaborators. jobs and ubi all around.
microservices obviously didn’t quite work, but were an idea in the right direction. we need to collaborate at a higher level than code. we need to work in a bakery together, but each bake alone.
then we can easily evaluate the quality and pace of each other. there is no ambiguity of individual responsibility.
when my cake is bad, i should feel bad. i should look around the kitchen for better cakes, and ask their baker what they do that i don’t.
when my cake is bad and i don’t care, my boss should move me to less important cakes, or out of baking all together.
Re: It's OK if your code is just good enough
#83Different levels of code quality are important for different teams / projects. Teams that are still discovering the domain and defining patterns should aim for a lower quality so they can iterate more easily. In this mode, knowing that code was written quickly and is fine to throw away / reshape is critical. Aiming for Very Good is likely to be a waste of time here. In other projects, the domain is clearer, or the sy…
The internal facing problem is getting a team to agree to differing quality gates for different parts of the system - the absolutely knowable and the arguably unknowable parts should not be written with the same mindset if you want to maintain velocity. If you get lucky with the org chart you can fake some of that quality diversity via code ownership, but that's a rough approximation at best. People seem to prefer picking something static and not thinking about it too much, rather than having to reason about every feature. I'm curious to see what we try next to deal with this.
Re: It's OK if your code is just good enough
#84I've never seen a PoC that was allowed to have the time to be cleaned up properly to make it to the Good Enough phase. Management types tend to want to take the PoC and move it directly to production and assume you're incompetent if you push back.
Re: It's OK if your code is just good enough
#85Earlier quoted context omitted.
I have raised it in the past and will do so again. One of the problems is the manager has no software engineering experience and his view of "working norms" often go against mine. Some of my complaints are fairly basic: test/review your own work before asking someone else to review it. This should be applicable regardless of industry.
time to go next?
Re: It's OK if your code is just good enough
#86Upfront, I mostly agree with the post. However, I may be a tad famous about striving for perfection in my code. [1] [2] Why? If "good enough" is good enough, why do I go further? For a few reasons: 1. I want the industry to be more professional [3] where it matters, and I need to set an example. 2. The kind of software I write already has alternatives, so mine needs to be far better to get adopted. And it does. [4] 3…
Re: It's OK if your code is just good enough
#87Earlier quoted context omitted.
That's also what I thought as well. This is the kind of overabstracted code Java gets a bad reputation for and I would not want to maintain that.
One of the biggest problems when discussing code quality is that there are almost no objective standards. What looks like "good well-named" variables to one person is "overcomplicated garbage" to another, and there's nothing to inform us on which person is correct. The closest thing we have is "does this code do what the user wants it to do". To me, this is the only question that really matters.
Re: It's OK if your code is just good enough
#88I once saw a 5000 line file of shit-tier code making a business something like a million bucks cash per day. It was a single huge function, called from cron every 5 minutes. No locking to prevent concurrent runs if it took longer than five minutes to execute. No exception handling. One giant nearly incomprehensible everything-function. Global variables. Bugs everywhere. Easily hundreds of thousands of dollars of net…
Re: It's OK if your code is just good enough
#89don’t get caught up in dogma and ideology in search of the “right” answer. Don’t be a “fanboy”. There is no such thing as the “right” or “best” solution because every engineering decision has tradeoffs.
You have to make rational, pragmatic, decisions based on the facts on the facts on the ground.
Re: It's OK if your code is just good enough
#90I once saw a 5000 line file of shit-tier code making a business something like a million bucks cash per day. It was a single huge function, called from cron every 5 minutes. No locking to prevent concurrent runs if it took longer than five minutes to execute. No exception handling. One giant nearly incomprehensible everything-function. Global variables. Bugs everywhere. Easily hundreds of thousands of dollars of net…
It’s great until there’s some new regulation or costumer requirement and it can’t possibly be added to the monstrosity and so you lose those millions until you can rewrite, which takes months.
In general, I agree. I don’t write code that bad, even for prototypes. That said, I worry a lot less about being super meticulous DRY and best practices in my prototypes that in 90% of cases will never touch millions in value. Done is better than perfect.