Readit News logoReadit News
britch commented on How good engineers write bad code at big companies   seangoedecke.com/bad-code... · Posted by u/gfysfm
pdimitar · a month ago
Here's mine from my most recent consulting engagement:

"We understand and recognize that this feature we asked of you absolutely cannot be done without the database denormalization you warned us is necessary several weeks ago, but we are still unhappy with you that you couldn't make it work without it and so we are ending our cooperation."

Consider yourself privileged.

I do all sorts of root-cause analyses and I don't sit to code until I am reasonably sure I'll make a positive impact. Long gone are the days when I started coding enthusiastically after hearing just two sentences.

It was still not enough.

I'll not start a flame war -- too tired for it -- but let us just say that some stereotypes exist for a reason.

britch · a month ago
That's fair I appreciate you taking the time to respond, that's a helpful example
britch commented on How good engineers write bad code at big companies   seangoedecke.com/bad-code... · Posted by u/gfysfm
pdimitar · a month ago
Your analogies don't work. Nobody pushes a cook or a bricklayer so hard that they cannot have a basic level of quality to their work. A meal that makes a customer sick or an entire floor of a building collapsing due to bad bricklaying is the limit the managers in those areas generally don't cross.

Not the case in commercial programming. If you manage to pull a heroic and still deliver something that does not fall over in a near-impossible deadline and with a lot of pressure then you are actually doing a huge disservice to yourself because the leadership will think "welp, obviously he can do it in those conditions" and next thing you know, next time around it will be even more difficult.

"Give them an inch, they will take a mile". Sadly this proverb very often applies to business people.

Most commercial programmers are extremely squeezed. I started daydreaming for another profession lately but yeah, ain't happening in my 40s with a very unstable financial situation.

I've read your sibling comments. It seems like you were on the other extreme and it does seem to me that now you are overcompensating by being too sympathetic with business and management. Whiplash effects are very understandable while one is still trying to find their balance. Still, don't give those people too much credit.

britch · a month ago
What do you mean by basic level of quality?

What are you being pressured to do to meet a deadline that's on the level of building collapse?

"skimp on the tests" or "do this hard to maintain fix as the solution" is maybe the hardest I've gotten pushed. Are people telling you to skip auth to hit a deadline?

britch commented on How good engineers write bad code at big companies   seangoedecke.com/bad-code... · Posted by u/gfysfm
fragmede · a month ago
The bricklayer's building that falls over, or the cook that makes food that tastes bad and no one wants to eat and makes people sick isn't going to have a job for very long, however. And of course, the job of "cook" runs the gamut from minimum wage at a shitty diner, to being very well paid at a Michelin star restaurant. So shipping code > beautiful code, but three years from now, that one "quick and dirty hack" just to get the next version out the door has become three hundred hacks, and that tech debt is a liability preventing any movement, either fixing existing bugs or in shipping new features.

So maybe not every line of code needs to be even more beautiful than the last, but there's clearly a balance to be had. And yes, sometimes the business people are right. Sometimes they are wrong, however.

britch · a month ago
I think we're both arguing for balance here

When I started programming I wanted everything I wrote to be museum-ready. I was slow as shit and waaay too precious about code. As I've matured I realize that's not a good way to work.

I think my lowest acceptable quality bar is still pretty high (and I'm fortunate to work somewhere that is valued). But as time has gone on I've tried to emphasize speed and knowing when something is "good enough"

I feel that it's an important skillset for the profession, but often craft-oriented engineers dismiss it at "business people not understanding"

As always this depends a bit on where you work and your projects

britch commented on Abuse of the nullish coalescing operator in JS/TS   fredrikmalmo.com/blog/js-... · Posted by u/fred_
kennywinker · a month ago
Sure, but in that case string | undefined is the correct type, and turning it into string | “” isn’t helping anybody.

It’s the difference between:

if (fooBarDisplayName) { show div }

And:

if (foobarDisplayName && foobarDisplayName.length > 0) { show div }

Ultimately, type systems aren’t telling you what types you have to use where - they’re giving you tools to define and constrain what types are ok.

britch · a month ago
I'm not sure I follow the point you're making

My example is we want to skip the div if empty or undefined. We can't throw on assignment so we leave it as as string|undefined.

When we go to display, we have to check if the string is empty anyway, right? What if it's empty in the DB or API response?

No matter what the display-component is doing something to prevent showing the empty string.

` if(fooBarDisplayName.length) { show div } `

or

` if(fooBarDisplayName?.length) { show div } `

I'm not sure what we gain by leaving it as `string|undefined`

---

If there was a "NonEmptyString" type maybe I could see where you're coming from.

I guess you could argue treating `string` like a `NonEmptyString` type seems error prone. The compiler can't verify you've done the check. At some point someone will set a string when it's empty or not do the necessary check.

You'd want a separate non-string type to make sure it's actually been parsed

britch commented on How good engineers write bad code at big companies   seangoedecke.com/bad-code... · Posted by u/gfysfm
pxc · a month ago
I think, sadly, that's often "the job". My career has been good so far, all things considered, but I think it would probably be better if embracing that idea came more naturally to me.

One of my first strange and unpleasant realizations in transitioning from studying computer science to "working in the real world" came in a 1:1 meeting with my manager at my first job out of school. I was complaining about code quality both in the context of some of our existing codebases and some new code one of my peers (also a junior developer) had recently written. When the light bulb finally lit up in my naive little head, the question I asked my manager with a sense of horror and outrage was "... so you're saying they wrote bad code on purpose?". The painful thought was that I, too, would (or had already) found myself tasked with pushing code that I knew sucked, for reasons entirely unrelated to architecture or design or other purely "technical" constraints.

I used to fantasize about moving into a different software niche, maybe in safety critical systems, where correctness is more highly valued. But recently I'm coming to realize that the thing I crave (and miss from my school days) is the joy of the craft— something involving elegance and taste in a way that even the strictest standards of correctness doesn't necessitate.

I think for the most part, truly excellent code isn't something many businesses perceive themselves as needing (even if many practical benefits can flow from its virtues). And, probably, for many businesses, such indifference is right. So excellent code, where it exists, is probably more often "gotten away with", half-snuck in by stubborn engineers who are productive enough to burn time injecting some extra consideration and effort into their code, than it is commissioned by a business which understands that it wants good code.

britch · a month ago
I think about this a lot. My belief is professional programmers should not be artists.

I think about other professions. A cook cannot spend time making every dish perfect. A bricklayer isn't perfectly aligning every brick. Even in movie-making there's a shooting schedule. Things go wrong and the best filmmakers know how to keep the production moving.

I love the craft of programming, but I see a lot other craft-oriented programmers who want every line to be beautiful. If you want to write code poetry in your off-time, that's your business. But that's not the job.

At work we are bricklayers and cooks. We practice a craft, but also have time constraints. I try to do my best work while working at pace. Sometimes my code could be better, but it's not worth the time to fix. Ultimately the thing we make is the running software, not what's under the hood. The business people are sometimes right

britch commented on Abuse of the nullish coalescing operator in JS/TS   fredrikmalmo.com/blog/js-... · Posted by u/fred_
britch · a month ago
Early errors are good, but I think the author overstates the importance of filtering out empty strings

---

I disagree that erroring out when the app doesn't have ALL the data is the best course of action. I imagine it depends a bit on the domain, but for most apps I've worked on it's better to show someone partial or empty data than an error.

Often the decision of what to do when the data is missing is best left up the the display component. "Don't show this div if string is empty", or show placeholder value.

---

Flip side, when writing an under the hood function, it often doesn't matter if the data is empty or not.

If I'm aggregating a list of fooBars, do I care if fooBarDisplayName is empty or not? When I'm writing tests and building test-data, needing to add a value for each string field is cumbersome.

Sometimes a field really really matters and should throw (an empty string ID is bad), but those are the exception and not the rule.

Deleted Comment

britch commented on There is a huge pool of exceptional junior engineers   workweave.dev/blog/hiring... · Posted by u/mooreds
britch · 3 months ago
I was confused by why "use of AI" was a top-level requirement of this, but I see now that weave is AI-driven "engineering output measurement" company, down to the individual contributor level.

I can understand why you would have better luck hiring eager new-grads than seasoned engineers. I'm sure some IC find the weave stats useful, but it also sounds like a toxic manager's dream. I can understand why more senior engineers would steer clear.

britch commented on A computer upgrade shut down BART   bart.gov/news/articles/20... · Posted by u/ksajadi
IshKebab · 4 months ago
Yeah I was pretty blown away when I visited San Francisco just how archaic it was. In the same place you have driverless cars you have a metro payment system from like 70s USSR or something.
britch · 4 months ago
I mean the answer is in the question--why are the self-driving cars (largely funded by billion-dollar private companies and VC) available in the same city as this anarchic public transit system (funded by largely by regional taxes and ridership fees)
britch commented on AI therapy bots fuel delusions and give dangerous advice, Stanford study finds   arstechnica.com/ai/2025/0... · Posted by u/pseudolus
ddp26 · 5 months ago
What's the base rate of human therapists giving dangerous advice? Whole schools, e.g. psychotherapy, are possibly net dangerous.

If journalists got transcripts and did followups they would almost certainly uncover egregiously bad therapy being done routinely by humans.

britch · 5 months ago
Someone raises safety concerns about LLM's interactions with people with delusions and your takeaway is maybe the field of therapy is actually net harmful?

u/britch

KarmaCake day655July 20, 2018View Original