TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Is all code crap?

42 pointsby rreyes1979about 3 years ago
Or have I been unlucky for the last 20 years as software engineer?

38 comments

ravenstineabout 3 years ago
All code? Nah.<p>Other people&#x27;s code? <i>Of course.</i> &#x2F;s<p>Most code? Yeah, I kind of think so, actually.<p>The demands of business will always be at odds with engineering, and everyone is at different levels in their coding journeys, and everyone&#x27;s got different opinions on what code should be. It&#x27;s a tug of war where no one actually wins but everyone gets a consolation prize that hopefully makes it worth it.<p>Code sometimes surprises me, in a good way, and it also disappoints me a lot of the time. I can&#x27;t really say that My Way TM is better. The disappointment mostly comes from a lack of will from the rest of an organization to not take steps to make things better, even when the writing is on the wall that they will <i>have to</i> sooner or later.<p>In short, yeah, it&#x27;s kinda bad, but it&#x27;s also not so bad. Something we all need to do, I think, is accept that what we were taught that coding would be like is fantastical. I guess I was influenced early on in such a way that I believed that one day the code would actually get better. With a handful of exceptions, it usually doesn&#x27;t. Unless one is lucky, our job is to <i>make it work</i> and to <i>figure it out</i> when it&#x27;s not working.
评论 #31214920 未加载
Ruryabout 3 years ago
Maybe. I find myself strangely finding code less and less crappy the more as I&#x27;ve grown as a developer (currently 11 years). Or perhaps, a lot happens to be crap, and it just doesn&#x27;t bother me anymore like it use to? Somehow I rarely find myself frustrated with coding anymore, whether that&#x27;s involving other people&#x27;s code, or my own.<p>I think part of it is just realizing there is no perfect code, as there&#x27;s a tradeoff with everything. Acknowledging that someone else was wanting to optimize for something (e.g. efficiency, performance, robustness, scalability, time to implement, ease of maintenance, readability, handling a particular problem) and that it came with a cost at one or more of the other categories, and you realize that the strengths of anything can also be its weakness (and vice versa). It&#x27;s why languages that are easy to understand, are often criticized to be verbose. Why code minifiers can improve performance, at the cost of readability. Additionally, sometimes the problem isn&#x27;t fully defined when code is getting written, so it&#x27;s hard to simply blame code for bugs that do crop up. It&#x27;s simply unfinished code in such scenarios, not necessarily crap code.<p>But that said, there is definitely objectively bad code out there. I&#x27;d say if you see code trying to solve a given problem, but doing it a much more complicated way than is necessary (by like orders of magnitude, not just a couple of degrees), then it&#x27;s clearly crap, as it isn&#x27;t good at any of the categories mentioned above, let alone at its intended purpose.<p>I&#x27;d say I come across undoubtedly bad code less often than not.
AnimalMuppetabout 3 years ago
I think all code has at least one axis on which it is crap.<p>For example, I think it&#x27;s very hard to have code that is as fast as possible, and also is very readable. It&#x27;s hard to have code that has a good UI and is also not verbose. It&#x27;s hard to have code that is both complete and easy to change. So for every code you run into, you can say &quot;this is crap because X&quot;, and there will be at least one X for which you are right.<p>But some code is much <i>worse</i> than other code. There <i>is</i> code that is generally good quality, even if it is rare.
评论 #31212288 未加载
anonymousiamabout 3 years ago
Blame the &quot;patch after sale&quot; culture embraced by Microsoft. Most software houses are perfectly fine with shipping bad code, and then patching it once enough customers complain.<p>I come from a culture of space-flight software where it needs to be right the first time or the mission fails. Good software is possible, it just costs more.
评论 #31212323 未加载
adam_arthurabout 3 years ago
Education doesn&#x27;t really stress readable code. Thus, must in industry don&#x27;t care about it either. I&#x27;ve met plenty of uber smart people that write crap code (it works, but poorly maintainable, hard to read).<p>The engineering&#x2F;quality side of SWE matters way more in 90% of roles than the comp sci theory... so the whole training system is pretty backwards.<p>But industry will move to higher and higher level abstractions over time, just like bit manipulation questions don&#x27;t get asked in interviews anymore. And I suspect serverless will neuter the design interview to a pretty great degree over the next few years.<p>At least personally, I&#x27;ve found interview questions that are light on theory (but still contain some), and heavy on coding to provide a signal that correlates much better with real world performance.
khedoros1about 3 years ago
The code that I just finished writing is perfect and beautiful. It&#x27;ll be crap next week when I forget that I wrote it.
TimJRobinsonabout 3 years ago
It gets worse the more edge cases and &quot;what ifs&quot; it can handle. Code that looks beautiful generally only works in the happy cases.
评论 #31212396 未加载
blacksmithguabout 3 years ago
Any actively maintained codebase always devolves into crap. Scopes change, technology shifts, bugs patched; code quality monotonically declines as you trend away from the assumptions the program was written with.<p>No amount of rigor and discipline can stop this trend. If you truly care about high code quality, design your programs to be small and modular, and redesign them when assumptions change instead of repeatedly patching them.<p>Rewriting is often unsuccessful as well, though. So practically speaking: best get used to the smell.
Gualdrapoabout 3 years ago
According to Sturgeon&#x27;s law[0], not _all_ code can be crap, &#x27;just&#x27; the 90% of it.<p>[0] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sturgeon%27s_law" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sturgeon%27s_law</a>
评论 #31212325 未加载
mikequinlanabout 3 years ago
No.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;torvalds&#x2F;linux" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;torvalds&#x2F;linux</a><p><a href="https:&#x2F;&#x2F;referencesource.microsoft.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;referencesource.microsoft.com&#x2F;</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;redis&#x2F;redis" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;redis&#x2F;redis</a><p>I am sure there are lots of others.
评论 #31212668 未加载
linkddabout 3 years ago
Programming is the art of adding bugs to an empty text file.
评论 #31212238 未加载
drewbug01about 3 years ago
Only other people’s code is crap.
评论 #31212169 未加载
cbanekabout 3 years ago
Honestly, yes.<p>Code is a liability, not an asset. Over time it decreases in value, it is forgotten, misunderstood, and everything will change around it. Many times I&#x27;ve been happy to replace a custom system with an off the shelf one, just to reduce the amount of code I have to worry about.<p>Even if you keep working on it, requirements change, the code becomes a tangled mess and requires refactoring, tests need to be more complicated, you have to support more operating systems, etc.<p>At best it does what it needs to do well enough to pay for itself, and then some. Until it needs more work! You don&#x27;t realize it&#x27;s crap until it goes wrong and you look under the hood usually either.
jeffdoolittleabout 3 years ago
The code itself matters little. It&#x27;s a fools errand to attempt to write &quot;good code&quot; while glossing over, or outright ignoring, information hiding and dependency management.<p>Structure, testability, documentation and automation of the system give you a fighting chance.
toomuchtodoabout 3 years ago
It’s beauty is directly proportional to the revenue it generates.
评论 #31212300 未加载
评论 #31211990 未加载
评论 #31212019 未加载
Genboxabout 3 years ago
Yes, it mostly is.<p>Understanding systems, algorithms, design patterns etc. takes time. Nobody ever starts out writing a solution that incorporates things they don&#x27;t know. That&#x27;s why we have education, training, certificates etc. to rectify that and have people start out with some sort of foundation instead of from scratch.<p>It is rare I come across something I would classify as _good engineering_. It is mostly just crap.<p>Only artisans put any value into being succinct, using appropriate algorithms and data structures. Everyone else struggle with getting it to work. I think that paradigm covers just about any field of engineering out there.
dustingetzabout 3 years ago
commercial code is developed under time to market pressure, cost minimization pressure, and organizational pressures, which typically include a dramatic lack of accountability and perverse incentives. And, the most essential elements of a business (without which you don’t have one) is sales and finance, not code quality. so yes
mbrodersenabout 3 years ago
“Crap” is in the eye of the beholder. It is an attitude problem more than a code problem. The worst developers I have ever worked with thought that <i>everything</i> was crap. Either because they were extremely arrogant, and code that wasn’t done their way was automatically “crap”, or because they had real trouble understanding code written by other developers, no matter how skilled and experienced those developers were. The smartest developers I have ever worked with can jump into <i>any</i> code base, written in <i>any</i> style, and be productive <i>fast</i>. They might make fun of some parts of the code, but they know there are often good historical reasons why the code was done that way, and they will be the first to admit that they themselves probably have done stuff like that in the past. So in conclusion, if you think all code is crap, <i>your</i> attitude might be the problem more than the code.
nowherebeenabout 3 years ago
People only care about outcomes. They don’t care about code quality until they can’t change anything without breaking it.
评论 #31212188 未加载
captainblandabout 3 years ago
It seems like there are a fair few coding &quot;ideologies&quot; around which sort of interact with different paradigms and languages, but sometimes multiple exist within those spaces... and every other ideology&#x27;s code is &quot;crap&quot; to the others. So don&#x27;t worry, your code is definitely crap to somebody!
ffhhjabout 3 years ago
Read John Carmack&#x27;s reply to someone saying Doom&#x27;s code is beautiful:<p><a href="https:&#x2F;&#x2F;mobile.twitter.com&#x2F;id_aa_carmack&#x2F;status&#x2F;290886163454128129" rel="nofollow">https:&#x2F;&#x2F;mobile.twitter.com&#x2F;id_aa_carmack&#x2F;status&#x2F;290886163454...</a>
评论 #31212027 未加载
评论 #31212020 未加载
slaterabout 3 years ago
It&#x27;s spaghetti all the way down.
评论 #31212200 未加载
4oo4about 3 years ago
My code is great when I&#x27;m writing it, but becomes crap when I run it and find all the bugs. Code I wrote any day other than today was basically written by a different person, and thus also crap.
roelesabout 3 years ago
Most engineering is crap, when you look at it close enough. It&#x27;s like embroidery. In order for the front to be pretty, you take all sorts of ugly shortcuts at the other side.
mbrodersenabout 3 years ago
Whether code is “crap” is completely irrelevant. What matters is whether it (1) solves the problem it was intended to solve (2) how long it takes to add features&#x2F;fix bugs. The 2nd part depends more on the developers than the code. Great developers can jump in and be effective in most code. Bad developers can’t even be effective in code written 100% by themselves! In other words, developers matter a lot more than code.
flamesofphxabout 3 years ago
Absolutely, the great huge heaping volume of horse dung in human history.. bit by bit, the highest density load of garbage one could collect..<p>YEAH HUMANS!!
User23about 3 years ago
There’s an important distinction between program correctness and program pleasantness. A program can be incorrect but still quite pleasant. Video games have many exemplars. Roughly speaking correctness means satisfying some specification and pleasantness means pleasing the program’s users (or owners, which usually means commercial success).<p>Given that context, what do you mean by crap?
评论 #31212639 未加载
krappabout 3 years ago
If it does the job, it isn&#x27;t crap.
评论 #31212181 未加载
rektideabout 3 years ago
Code isn&#x27;t crap. But developers haven&#x27;t gotten a whiff of better. We still build in a trashform useless protoform, haven&#x27;t explored into what might actually help.<p>The platforms &amp; systems we build upon have not significantly improved in noticeable ways. And most critically, there are zero innovations we work with that have included users. All software improvements have targetted developers, development experience, and at no point have we tried to bring a wider world onboard (XOPC being perhaps the only notable exception the last decades). Software is fallen and trash. Code is fine, and good, and noble, but none of these developers have any chance of building a single solitary lone good thing: for all that we build upon is shaky burning platforms of no merit or worth.<p>Software is shit. We are shit, just trash people. We have been whipped into building solutions, fixed un-soft coercive services, into building complete &amp; totalizing things. This is bass-ackwards, wrong: anti-soft. What&#x27;s actually important is building extropic systems, is sharing what&#x27;s happening, is making basic soft systems. We&#x27;ve fallen away from the soft in software. Everything is wrong, we fail to serve the &quot;soft&quot;ware cause, we are misaligned to help the world, and we could do much better. Alas.<p>We could pivot on a dime. We could decide to start unlocking potential, not gating it, at any time. I view work&#x27;s like Karlicoss&#x27;s exploration of all their systems[1] as a starting place, as what software ought do by default, ought assist this species with. But they fight to help advance an equitable basis: against countless resistive piece of shit systems. This should be expectable.<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31187346" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31187346</a>
jpcapdevilaabout 3 years ago
Haha, most code evolve into crap. But crap can solve real user &amp; business needs.
rufflezabout 3 years ago
Umm… no. I really don’t like the subtext of this question
georgeoliverabout 3 years ago
The old saying is that familiarity breeds contempt, but from what I&#x27;ve seen, in software it&#x27;s the opposite.
outside1234about 3 years ago
I don&#x27;t know about crap, but it every line of code is a liability, not an asset.
quantum_stateabout 3 years ago
An interesting question seems to be: is it inevitable?
wglbabout 3 years ago
Just 94% of it. See Sturgen’s Rule
sys_64738about 3 years ago
It&#x27;s art.
minrootabout 3 years ago
No
评论 #31212164 未加载
tptacekabout 3 years ago
Yes.