frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

All means are fair except solving the problem

https://yosefk.com/blog/all-means-are-fair-except-solving-the-problem.html
21•akkartik•2d ago

Comments

PaulHoule•2d ago
Aren't you supposed to return a 0 status code when "yea done!" and some other status code when it wasn't done?
yosefk•1d ago
Indeed you're supposed to, but that way if someone calls exit(0), it looks like the program worked fine, when in fact they committed some debug code and made the program no longer run to completion. "Yay, done" was put in for the scripts to flag this sort of thing, presumably based on experience.
PaulHoule•1d ago
I can say up until 2005 or so I was a real believer in printf() debugging but I deliberately switched to using a debugger as much as possible around that time. I found that no matter how hard people "try" if they modifying the code to do debugging there is some chance these get checked in -- whereas you can investigate many things with the debugger without checking anything it.

Some applications have more trouble with setup and teardown than others. Like I knew a professor who kept sending me C programs that would crash before main() and some systems have a lot of trouble with "crash on shutdown" which might be a problem (corrupted files) or a non-problem.

XorNot•1h ago
We still seem to have fairly bad tooling for advanced debugging use cases.

There's no good reason you shouldn't be able to have an IDE maintain a text overlay of debugging points which is solely supplied as breakpoint scripts to the debugger instead.

IDEs seem to conk out at click to set breakpoint.

quietbritishjim•43m ago
> I was a real believer in printf() debugging but I deliberately switched to using a debugger

This really does not need to be an either/or. They have different uses. You can stick in 20 printfs and get a quick feel for where the bug is far quicker than stepping through the code - especially if you set a breakpoint and hit run, only to realise that you've overshot. You can run the program 10 times with different parameters and compare the results with printf much more easily than you could with a debugger. But, once you've found the rough area, a debugger is much better for fine grained inspection, and especially interrogating state with carefully written watches.

I do get your point about the risk of leaving in some trace by accident. But it feels like overkill to throw away such a valuable tool just because of that.

kubb•1h ago
"People deliberately misuse the very mechanism that was designed to indicate successful completion, so we added another, flawed detection mechanism based on IO, because there's no way they'll do the thing that they should have learned in the first year of school, and just call exit with any other argument than 0 on irregular completion".

Gosh I thought the engineering culture was bad where I work.

roughly•34m ago
Brother, have I got bad news for you about all the places outside your door.
ryandrake•33m ago
Yea, whatever you do, don't solve the actual problem! This reminds me of solving a buffer overflow by just blindly increasing the size of the buffer until it no longer crashes.
linkregister•1h ago
It's POSIX convention to write to stderr for anything that's not strict program output. I have seen 2>&1 far too often in scripts. I don't worry about it and happily write error messages to stderr whenever my scripts exit without a 0 status code.
ryandrake•26m ago
Another thing that gets screwed up a lot is: Comand line usage help/information should be printed to stderr if it was invoked because the user passed an invalid option to the command line, but it should be printed to stdout if the user invoked the application with -h, --help or similar. Reasons:

1. If you mess up the command line to the program in a script or pipe, and get a bunch of usage output in stdout, a downstream consumer of that stdout might think its legit program output and try to parse it.

2. If your user actually calls the program with -h or --help, they might want to |less through it to read it on a small terminal screen. Output that to stdout.

3. Generally, you can always tell if something is going wrong by grepping for errors or warnings a single stream (stderr), or by looking for a nonzero exit code.

But your general principle applies: Output expected by the user -> stdout. Output incidental to the program's operation or errors -> stderr.

johnfn•37m ago
But the whole idea is that a warning is a warning. Solving a warning can be deferred, and a warning doesn't cause execution to fail. Your warning was transmuting itself into an error. I feel like "All means are fair except solving the problem" is the wrong conclusion to draw here. If it should have been solved immediately, it should have been an error in the first place. (And then you should have politely bumped the version so that you don't immediately break the code of all your dependents.) If there is no need to solve it immediately, then "all means are fair" to convert it back to a warning as was originally intended.
chadgpt2•8m ago
Was this FOSS or commercial?

If it's commercial software, you're paid to make it work, no matter how stupid that may be.

If it's FOSS, you can tell the user to deal with it and close the ticket.

Google broke reCAPTCHA for de-googled Android users

https://reclaimthenet.org/google-broke-recaptcha-for-de-googled-android-users
334•anonymousiam•4h ago•117 comments

AI is breaking two vulnerability cultures

https://www.jefftk.com/p/ai-is-breaking-two-vulnerability-cultures
173•speckx•5h ago•75 comments

You gave me a u32. I gave you root. (io_uring ZCRX freelist LPE)

https://ze3tar.github.io/post-zcrx.html
87•MrBruh•3h ago•50 comments

Cartoon Network Flash Games

https://www.webdesignmuseum.org/flash-game-exhibitions/cartoon-network-flash-games
247•willmeyers•6h ago•80 comments

AWS says data center overheating in North Virginia disrupts services

https://www.reuters.com/business/retail-consumer/amazon-cloud-unit-says-data-center-overheating-n...
60•christhecaribou•19h ago•27 comments

Non-determinism is an issue with patching CVEs

https://flox.dev/blog/achieving-rapid-cve-remediation-in-an-era-of-escalating-vulnerabilities/
22•mathewpregasen•1h ago•7 comments

Looking at the data behind prediction markets

https://asteriskmag.com/issues/14/are-prediction-markets-good-for-anything
27•kqr•1d ago•11 comments

David Attenborough's 100th Birthday

https://www.bbc.com/news/articles/cp3pww9g0p5o
362•defrost•10h ago•67 comments

Serving a website on a Raspberry Pi Zero running in RAM

https://btxx.org/posts/memory/
177•xngbuilds•7h ago•71 comments

Mux (YC W16) Is Hiring

https://www.mux.com/jobs
1•mmcclure•1h ago

All means are fair except solving the problem

https://yosefk.com/blog/all-means-are-fair-except-solving-the-problem.html
21•akkartik•2d ago•13 comments

An Introduction to Meshtastic

https://meshtastic.org/docs/introduction/
354•ColinWright•11h ago•135 comments

AWS data center outage hits trading on Fanduel, Coinbase

https://www.cnbc.com/2026/05/08/aws-outage-data-center-fanduel-coinbase.html
10•bigflern•1h ago•0 comments

Dirty Frag: Universal Linux LPE

https://github.com/V4bel/dirtyfrag
15•unbeli•2h ago•1 comments

Meta Shuts Down End-to-End Encryption for Instagram Messaging

https://www.pcmag.com/news/meta-shuts-down-end-to-end-encryption-for-instagram-dms-messaging
39•tcp_handshaker•1h ago•17 comments

Wi is Fi: Understanding Wi-Fi 4/5/6/6E/7/8 (802.11 n/AC/ax/be/bn)

https://www.wiisfi.com/
8•homebrewer•2d ago•1 comments

My first in-prod corrupted hard drive problem

https://blog.pavementlink.ch/2026/05/07/my-first-corrupted-hard-drive-problem/
33•r1chk1t•3h ago•23 comments

Compound drivers of Antarctic sea ice loss and Southern Ocean destratification

https://www.science.org/doi/10.1126/sciadv.aeb0166
6•littlexsparkee•59m ago•0 comments

Rumors of my death are slightly exaggerated

1435•CliffStoll•2d ago•223 comments

Teaching Claude Why

https://www.anthropic.com/research/teaching-claude-why
43•pretext•5h ago•5 comments

Mojo 1.0 Beta

https://mojolang.org/
255•sbt567•20h ago•167 comments

US Government releases first batch of UAP documents and videos

https://www.war.gov/UFO/
204•david-gpu•10h ago•316 comments

Poland is now among the 20 largest economies

https://apnews.com/article/poland-economy-growth-g20-gdp-26fe06e120398410f8d773ba5661e7aa
861•surprisetalk•10h ago•716 comments

PC Engine CPU

https://jsgroth.dev/blog/posts/pc-engine-cpu/
113•ibobev•8h ago•50 comments

Roadside Attraction

https://theoffingmag.com/essay/roadside-attraction/
13•aways•3h ago•3 comments

Man finds $1M worth of Yu-Gi-Oh cards in a dumpster

https://www.404media.co/man-finds-1-million-worth-of-yu-gi-oh-cards-in-a-dumpster/
87•danso•2d ago•25 comments

Maybe you shouldn't install new software for a bit

https://xeiaso.net/blog/2026/abstain-from-install/
806•psxuaw•23h ago•427 comments

Show HN: GETadb.com – every GET request creates a DB

https://www.getadb.com/
22•nezaj•6h ago•26 comments

Ask HN: We just had an actual UUID v4 collision...

266•mittermayr•15h ago•228 comments

Podman rootless containers and the Copy Fail exploit

https://garrido.io/notes/podman-rootless-containers-copy-fail/
109•ggpsv•9h ago•23 comments