frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

This Code Is CRAP (2011)

https://testing.googleblog.com/2011/02/this-code-is-crap.html
49•luispa•1h ago

Comments

thinkingemote•1h ago
(2011)
bogardon•1h ago
2026 Google would never have some "fun" like this
verdverm•45m ago
One of the many reasons leadership needs to change, they are now more aggressive towards exploiting their customers, especially in cloud, Kurain is ruining that platform, but the investors like it
svachalek•57m ago
Wow! Did not expect this blast from the past this morning. I worked with Alberto and Bob at the same startup long ago. Hello to any other Agitators who found this today.
rdevilla•1h ago
(2011)
huurtehoog•1h ago
Title is editorialized. Original: "This code is CRAP" referring to code in review as Change Risk Anti Pattern.

Also, (2011)

GranPC•1h ago
I believe the "This" might have gotten swallowed by HN's title normalizer.
badc0ffee•54m ago
This title normalizer is crap.
GranPC•49m ago
In its (admittedly weak) defense, if the submitter edits the title back during the few-minute window after submitting where this is possible, the normalizer does not kick back in. But it is a bit opaque, in the sense that the poster needs to: realize that the title has been changed; know that they can edit the title (but not too slow!); and know that it won't be filtered through again.

I have no idea what the website would look like without it, but I have a feeling it does more good than harm.

hunter2_•48m ago
What is the "good" when considering the lack of aggressive truncation/overflow concerns here?
DANmode•41m ago
Neutering Popular Science clickbait titles “This Koala has a Secret Trick!”
richardbarosky•1h ago
The pendulum has swung too far in the direction of class, function, cyclomatic complexity (and here, CRAP) and similar idiotic metrics.

This reminds me of a talk Sandi Metz did called "All the Little Things" where she covers the Gilded Rose kata. In the talk, she reworks her solution until there's almost nothing left showing the essence of the problem being solved.

The cyclomatic complexity metric is touted at each step as a proxy for goodness of design and removal of complexity. However, a weakness of the measure itself is that it doesn't account for the control flow indirection that happens through OO method dispatch itself.

At the same time, Kevlin Henney's talk called "Gilding the Rose" takes the same kata and arrives at a far more sane solution he works up to and reveals at the end.

Short functions used to be hot. Uncle Bob used to proselytize "The first rule of functions is that they should be short. The second rule of functions is that they should be shorter than that." Now emphasizing the benefits of longer functions is pretty trendy. https://github.com/johnousterhout/aposd-vs-clean-code

This industry is pretty idiotic sometimes ¯\_(ツ)_/¯

lumost•56m ago
I suspect that we could bring this measure into the modern world with a little help from either DFS or ai.

Something like abstractions traversed during interpretation, lines of abstraction v.s. functional implementation, or logic statement dispersion.

It was hard to pin down what was abstraction vs. implementation, but it's much easier now.

bunderbunder•37m ago
The thing is, AI has no idea when an abstraction is good or not.

The reductio ad absurdum here is that, if abstraction can just be assumed to be bad for quality and maintainability, then perhaps we should go back to hand writing machine code for non-microcoded sequential execution CPU architectures. Conversely, if that idea sounds as preposterous to you as it does to me, then you’re stuck conceding that at least some abstractions are mostly good. So then, before you can automate deciding which ones should and should not count against a code quality metric that’s computed automatically, you need to find an operational definition that can be applied deterministically.

Anonyneko•1h ago
>Note: This post is rated PG-13 for use of a mild expletive. If you are likely to be offended by the repeated use a word commonly heard in elementary school playgrounds, please don’t read any further.

Mild as this ironic passive aggressiveness is, can't imagine something like this in modern sterile corporate messaging.

dionian•1h ago
funny enough, the disclaimer comes after the term is used in the title and url.
hunter2_•44m ago
"repeated use" seems to be doing the mitigation work here, though it does seem unusual that someone offended by the repetition would be unoffended by a one-off.
dooglius•1h ago
There's a good chance it'll be scrubbed now that it's frontpaged here
octantes•26m ago
don't be evil!

every bit of humanity went with the motto

fallat•1h ago
> CRAP1(m) = comp(m)^2 * (1 – cov(m)/100)^3 + comp(m)

and

> Here’s why we think that CRAP1 is a good anti-pattern to detect. Writing automated tests (e.g., using JUnit) for complex and convoluted code is particularly challenging, so crappy code usually comes with few, if any, automated tests.

This is so wrong.

The formula uses code coverage as a fundamental metric, when in reality, a lot of people write code "correct from construction", so coverage is not even applicable. Many times too, people only care the use cases they care about work perfectly.

There are also many other reasons code is not tested, not because it's complex, but because it's simple.

aomix•1h ago
I have a goal to make the codebase at work cargo-crap compliant and enforce it with CI. I let an agent run overnight with it once and the diff touched like 40% of our codebase which is untenable for a single merge. So for now I’m doing it piecemeal as the opportunity presents itself.
googenheim•45m ago
Google is crap

Are we just writing tautologies now?

VCFundedGenYer•2m ago
No, we were writing them in 2011.
almondfestival•43m ago
I'm sure this method has evolved and/or been supplanted over the last 15 years, but one thing that struck me reading this is how much the dynamics of unit test coverage have changed in recent history, with AI-generated commits containing 10x as many unit tests (many of them kind of silly and tautological) as in the olden days. Gonna need to update some of those coefficients in their CRAP1 formula... Or maybe test coverage has/will become too noisy a parameter to use at all.
acedTrex•41m ago
> Or maybe test coverage has/will become too noisy a parameter to use at all.

It already is, ive banned unit tests via ci checks from our codebases, they were not particularly useful before LLMs and now they are a net negative.

We require int and some e2es and that does all that units do and more.

bunderbunder•27m ago
Anecdotally, I’ve found that codebases that enforce code coverage metrics often have worse behavior coverage than ones that don’t.

It’s a classic example of Goodhart’s Law in action. Code coverage metrics only measure what percentage of code the test suite causes to run. But it’s very, very easy to write tests that run code without actually confirming that it produces correct output for all possible inputs. And it’s very, very easy to assume that a module with 90+% code coverage also has 90+% behavior coverage, and then become complacent about reviewing the suite for proper behavior coverage.

Founderarcstone•31m ago
Every time I see a software update I cringe inside.
bluGill•28m ago
A measure is only good if I take action on it and in turn make things better. There are a lot of things that are easy to measure, but there is no useful action I should take on the measure.
bunderbunder•12m ago
Yes, but also all too often “useful” is interpreted to mean “moves the metric”. If that metric is merely a proxy for some more tangible outcome then that may not be good enough.

The one that tech tends to stumble on most often is velocity-type metrics. The problem there is that you can’t pay the bills with velocity. And velocity metrics tend to favor cheap shovelware features that cohere poorly over anything that involves having the team slow down on churning out code long enough to work out elegant solutions to subtle problems.

onionisafruit•18m ago
I've seen a couple of tools to calculate the CRAP score. I haven't used them in anger though.

For Rust there's https://crates.io/crates/cargo-crap, and for Go there's https://padiazg.github.io/go-crap/

GranPC•40m ago
It's more of a gut feeling than anything else. I don't know what the normalization rules are, but I think we mostly notice the normalizer when it mangles something [1], and not when it's just quietly humming along. Someone with more spare time could probably figure out a dataset of original to normalized titles and measure that.

[1]: Example from the frontpage right now: "How Big Are Factorials?" probably got normalized to "Big Are Factorials?" originally, based off other previous manglings I have seen previously.

andai•44m ago
Maybe it's invisible when it works as intended, but the only times I notice a title has been changed, is when it's changed back to the original title, stripping most of the valuable context in the process. De-editorialization, I suppose.

(Or when the auto-renamer does a funny!)

Jtsummers•22m ago
You get an hour or so to edit the title. There is ample time to fix it if the auto-edits mangle it. The submitter just has to look at the submission after hitting submit one time to see if there was a problem.
hunter2_•49m ago
While that might be the case, best to normalize that: Title Normalizers are Crap.
layer8•47m ago
Submitters can rectify the title after submitting.
bunderbunder•45m ago
A while back Hillel Wayne did a talk (whose name I forget) on what empirical evidence on software quality actually says.

As I recall, he concluded that there’s really no support for then-popular ideas like short functions, reducing cyclomatic complexity, avoiding explicit branch statements and loops, or TDD. (Tests yes, just not TDD.)

He made a pretty strong case that only two principles are particularly robust. One was that limiting code volume is good. The other is that working people too hard is bad.

eadler•32m ago
This talk.

What We Know We Don’t Know • Hillel Wayne. (2019, April 28). Hillel Wayne. https://www.hillelwayne.com/talks/what-we-know-we-dont-know/

Isamu•38m ago
>cyclomatic complexity metric is touted at each step as a proxy for goodness of design and removal of complexity. However, a weakness of the measure itself

Amen, it’s hard to push back against an opaque term (cyclomatic!) when it isn’t really a measure of goodness, it’s a measure of branching, kind of a normal thing in code.

Early on I found that code with low cyclomatic complexity was just usually extremely verbose, lots of passing this to that while avoiding the branching necessary to get something done.

And yes, you can game the metric by hiding the complexity among the confusion of objects and components.

kps•11m ago
> it doesn't account for the control flow indirection that happens through OO method dispatch itself

Every indirect call is a conditional branch, where the condition can be arbitrarily far away in time and space.

Small Programming Tricks

https://will-keleher.com/posts/small-programming-tricks-matter/
88•signa11•1h ago•60 comments

Dream-RSI: Recursive Self-Improvement through Evolving Worlds

https://arxiv.org/abs/2609.14858
105•bananaflag•3h ago•30 comments

Mistral X Mozilla: Private, Multilingual AI Browsing

https://mistral.ai/news/mistral-x-mozilla/
385•vertigoruntime•9h ago•125 comments

Introducing System One Models and Jev

https://typesafe.ai/blog/introducing-system-one-models-and-jev
1716•albelfio•22h ago•460 comments

Tell the speakers that you liked their talks

https://ohhelloana.blog/tell-the-speakers/
115•whisper2020•1d ago•30 comments

Claude Cowork and chat are now one Claude

https://claude.com/blog/cowork-is-now-claude
51•vertigoruntime•1h ago•67 comments

Show HN: An e-ink frame that hears birds and draws them as 1800s illustrations

https://github.com/arnegiacomo/fugleramme
1881•arnemunthekaas•1d ago•223 comments

How big are factorials?

https://eli.thegreenplace.net/2026/how-big-are-factorials/
35•ibobev•1d ago•13 comments

Apple Reference Image: A New Approach for Verified Photography

https://security.apple.com/blog/apple-reference-image/
433•imwally•15h ago•292 comments

Hackers Got Inside a Flock Camera

https://www.wired.com/story/hackers-flock-camera-data-shows-how-system-works/
285•driverdan•4h ago•139 comments

The Google Play app review process now regularly takes longer than a week

https://gultsch.social/@daniel/117280438824908947
272•inputmice•6h ago•250 comments

Can we stop with the uptime percentages?

https://blog.jim-nielsen.com/2026/stop-with-the-uptime-percentage/
57•surprisetalk•1h ago•56 comments

This Code Is CRAP (2011)

https://testing.googleblog.com/2011/02/this-code-is-crap.html
49•luispa•1h ago•39 comments

Scaling Golang CI by Replacing actions/setup-go

https://www.cloudx.ai/posts/setup-go
50•peterldowns•4h ago•6 comments

Prisma's pgbouncer=true on Supabase made every query 4 round-trips (postmortem)

https://blog.simbastack.com/four-round-trips-six-months/
6•asenna•1d ago•2 comments

Show HN: How Stale Is Your AI? Release age and training cutoff for 20 models

https://stale.jock.pl/
37•joozio•4h ago•25 comments

Kyber (YC W23) Is Hiring a Forward Deployed Engineer

https://www.ycombinator.com/companies/kyber/jobs/eturrAR-forward-deployed-engineer
1•asontha•5h ago

The DeepMind Institute

https://institute.deepmind.com/
17•vertigoruntime•3h ago•1 comments

An update on Wayback Machine access

https://blog.archive.org/2026/09/15/an-update-on-wayback-machine-access/
652•ChrisArchitect•23h ago•339 comments

Original Sony PlayStation 2 security chip 'broken wide open' after 26 years

https://www.tomshardware.com/video-games/playstation/26-year-old-sony-ps2-security-chip-broken-wi...
194•rbanffy•5h ago•53 comments

Measuring Gauss-Seidel loop-carried dependency and fixing it via loop unrolling

https://loiseaujc.github.io/posts/blog-title/make_gauss_seidel_great_again.html
16•loiseaujc•1d ago•3 comments

Salesforce Global Outage

https://status.salesforce.com/products/all
228•mabil•6h ago•135 comments

Show HN: I made a flight simulator, except you're just a passenger

https://inflightsimulator.com
340•rkotcher•2d ago•189 comments

Anatomy of a Texture

https://agentlien.github.io/texture/
25•Agentlien•3h ago•4 comments

Gemini 3.8 Live and 3.8 Live Extended Thinking

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-3-8-live-gemini-3-...
473•leumon•23h ago•314 comments

Doing Everyone Else's Job

https://yosefk.com/blog/doing-everyone-elses-job.html
175•luu•1d ago•84 comments

Why I'm still bearish on LLMs after Navier-Stokes

https://dank.systems/posts/2026-09-15-ai-bear.html
397•jaykru•23h ago•503 comments

Intelligence per Watt: Measuring Intelligence Efficiency of Local AI

https://arxiv.org/abs/2511.07885
132•pythonic_hell•2d ago•44 comments

DeepSeek v4.1 Flash Is Now Our Best Hacking Model

https://enclave.ai/blog/deepseek-v41-flash-is-now-our-best-hacking-model
116•talhof8•5h ago•42 comments

OpenAI expands ChatGPT ads with Sponsored Agents

https://openai.com/index/reimagining-advertising-with-ai/
133•vertigoruntime•3h ago•132 comments