4 ms·
Whatever works so I can fix it and be home on time. I will even print (in paper) the code and step through it with a pen. Again, whatever works. Also, will we
by pryelluw 2y ago
Whatever works so I can fix it and be home on time. I will even print (in paper) the code and step through it with a pen. Again, whatever works.
Also, will we ever move forward from these sort of discussions? Back when I was a mechanic no one argued about basics troubleshooting strategies. We just aimed to learn them and apply them all (as necessary).
- johnnyanmac 2y agoBased on the "lucky 10k" and the size of the internet, likely not. I'm sure if you find a mechanics enthusiast forum you will in fact find these relatively trivial arguments. It's just the nature of the beast.
- pryelluw 2y agoI’d say programmers are taught to nitpick away at arguments by default. The nature of the code review is to verify that the code I wrote meets certain (opinions) standards. Hence nitpicking is built into the profession. Maybe one day it’ll improve. Till then, I’ll continue arguing about everything there is :-)
- bee_rider 2y agoI wouldn’t say programmers are taught to nitpick, so much as look for non-obvious problems. The nitpicking comes as a side effect. Maybe it is cargo-culting.
- shadowgovt 2y agoI find the key thing to avoid arguments is to not make the options adversarial. Present them as options. "If you like X, you may also like Y." Leave it to the audience to discriminate when to apply the tool.
- pryelluw 2y agoYes, good approach. Do you ever feel like the internet has been turned adversarial? Flame wars are as old as email but not the default.
- chrsig 2y agoeternal september; people new people are continually learning new strategies. You're correct, the real issue comes down to 1. making sure those printf statements don't wind up in prod, spilling potentially sensitive data or corrupting a data stream 2. making sure that non-printf tooling is built so that only printf debugging isn't used We tend to get caught up in false dichotomies.
- nxobject 2y agoRe 1: the recent iTerm2 fracas. Yikes. https://news.ycombinator.com/item?id=42579472 https://news.ycombinator.com/item?id=42579472
- chrsig 2y agoouch, i didn't even know about that
- Cthulhu_ 2y agooof, iterm's done a few bad releases recently, first with their AI integration and now this sloppiness. I think they're feeling the heat from competitors like Warp, especially now that it's removed the "create an account" barrier to entry.
- torstenvl 2y agoI use a DBUG() macro that wraps fprintf to stderr when a DEBUG is defined and NDEBUG is not defined, or otherwise is nothing.
- skissane 2y ago> Whatever works so I can fix it and be home on time. I will even print (in paper) the code and step through it with a pen. I’ve found before that sometimes I can’t see what’s wrong with the code on my screen but I can when I print it out. I think the printed page activates different regions of the brain compared to looking at a computer screen
- jclulow 2y agoYou should try other things that force the brain to begin interpreting something again as new input; e.g., I have found success with changing the font, or the colour scheme, or looking at a diff rendition of a change, or looking at the file with less(1), or even reading the thing in reverse order, provoking a similarly new context where I see stuff I won't have seen staring at the editor for an hour previously. Another thing printing usually induces is that you simply stop looking at it for at least a few minutes before looking again, and a break often helps too! Printing is obviously fine if you like doing that, but I've found there are lots of ways to shake yourself loose and more thoroughly review your own writing.
- pryelluw 2y agoI increase the font size and just stare. Tends to work, too. Maybe we should be compiling them somewhere …
- __MatrixMan__ 2y agoIf I'm looking for something and can't find it despite all signs pointing to it being nearby, I'll try to continue looking while upside down. It's often helpful for I think the same reasons that you describe. One time, I was looking for a set of keys which had been tossed over the aisle partition in a grocery story and promptly disappeared. We tore that place apart and still couldn't find them. So I was laying on my back on the aisle floor so I could see the search area with my head upside down, and there they were. They had bounced and were hanging from the bottom of one of the shelves. When in doubt, do something weird.