12

All means are fair except solving the problem

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.

15 minutes agolinkregister

Aren't you supposed to return a 0 status code when "yea done!" and some other status code when it wasn't done?

2 days agoPaulHoule

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.

a day agoyosefk

"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 stop doing that".

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

a minute agokubb

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.

a day agoPaulHoule

We still seem to have fairly bad tooling for advanced debugging use cases.

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

IDEs seem to conk out at click to set breakpoint.