Hacker News

New stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Gnome 51 Released with Improved Frame Scheduling, Many App Improvements(phoronix.com ↗)
    discuss
  2. We killed our in-app AI chat and made the agent a first-class user(sensefold.app ↗)
    discuss
  3. Omarchy on Mac(github.com/omacom ↗)
    discuss
  4. Whiteboard Defense(twitter.com/mitchellh ↗)
    discuss
  5. Show HN: Ivx/AI Chat, AI client that doesn't track you (with a better GUI imo)(ivx.run ↗)
    discuss
  6. As Someone Who Has Written This Blog Post,(zachholman.com ↗)
    discuss
  7. Numerical Tours(numerical-tours.com ↗)
    discuss
  8. IPC Panic, a 4-call kernel panic in Apple XNU, up to macOS and iOS 26 included(seriot.ch ↗)
    discuss
  9. Inside the MIT Report on How AI Is Eroding Campus Culture(learningcurve.fm ↗)
    1comments
  10. GitMir just released Vibe, it's like Claude on steroids(gitmir.com ↗)
    discuss
  11. Mercury Books – Accounting Software Built into Your Bank Account(mercury.com ↗)
    discuss
  12. Hacking a Xiaomi Mi Band 4 to Run Super Mario Bros(qwertyforce.dev ↗)
    discuss
  13. Fedora 45 beta drags the Linux console into the 21st century(theregister.com ↗)
    discuss
  14. AI Agents Work. So Why Is Memory Becoming a Problem?(medium.com/majid.fekri ↗)
    discuss
  15. Show HN: LaunchPad-Lite – Open-Source Next.js 15 with Better Auth and Drizzle(github.com/bzdevelopments ↗)
    discuss
  16. Show HN: OpenDocBot – bring your own model to Word, Excel and PowerPoint(opendocbot.com ↗)
    discuss
  17. Agents: The New, New Kingmakers(redmonk.com ↗)
    discuss
  18. An Educational GEMM Ladder for Helios GPUs(amd.com ↗)
    discuss
  19. Lumai Iris – First Optical Computing System(lumai.ai ↗)
    discuss
  20. Jev means structured output is interesting again(seangoedecke.com ↗)
    discuss
  21. What is LLMjacking, and why should IT pros care?(itbrew.com ↗)
    discuss
  22. Column built an issuer processor from scratch(column.com ↗)
    discuss
  23. Set aside human extinction hypotheticals: can we keep AI from persisting itself?(keydiscussions.com ↗)
    discuss
  24. Elon Musk Trains His Political Chaos Machine on the U.K(wsj.com ↗)
    discuss
  25. Vira: Parking control and vehicle registration platform for Norway(mutaz.no ↗)
    discuss
  26. Digit 5 Sets a New Bar for Humanoid Robot Safety(ieee.org ↗)
    discuss
  27. A.I.'S Effect on the Work Force Is Showing Up in Wages(nytimes.com ↗)
    3comments
  28. Combino – AI-Powered Daily Word Game(combino.io ↗)
    discuss
  29. With 1 Extension: $20K in Bounties from Anthropic, Perplexity, Google, Microsoft(forever.security ↗)
    5comments
  30. Nobel Laureate Michael Kremer Picked as World Bank Top Economist(bloomberg.com ↗)
    discuss

Code Is Crap

36 pointsby 45m agotesting.googleblog.com
29 comments
33m agoHN ↗

2026 Google would never have some "fun" like this

9m agoHN ↗

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

21m agoHN ↗

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.

35m agoHN ↗

Title is editorialized. Original: "This code is CRAP" referring to code in review as Change Risk Anti Pattern.

Also, (2011)

24m agoHN ↗

I believe the "This" might have gotten swallowed by HN's title normalizer.

13m agoHN ↗

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.

12m agoHN ↗

What is the "good" when considering the lack of aggressive truncation/overflow concerns here?

5m agoHN ↗

Neutering Popular Science clickbait titles “This Koala has a Secret Trick!”

4m agoHN ↗

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.

8m agoHN ↗

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!)

13m agoHN ↗

While that might be the case, best to normalize that: Title Normalizers are Crap.

11m agoHN ↗

Submitters can rectify the title after submitting.

32m agoHN ↗

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 ¯\_(ツ)_/¯

20m agoHN ↗

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.

1m agoHN ↗

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.

9m agoHN ↗

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 of statements and bare 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.

2m agoHN ↗

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.

32m agoHN ↗

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.

27m agoHN ↗

funny enough, the disclaimer comes after the term is used in the title and url.

8m agoHN ↗

"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.

24m agoHN ↗

There's a good chance it'll be scrubbed now that it's frontpaged here

31m agoHN ↗

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.

24m agoHN ↗

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.

9m agoHN ↗

Google is crap

Are we just writing tautologies now?

8m agoHN ↗

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.

5m agoHN ↗

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.