6 ms·
It's taken... I dunno, 50+ years?... but it's nice to see more and more code being written that doesn't assume programmers are superhuman beings with an IQ of 2
by jerf 10y ago
It's taken... I dunno, 50+ years?... but it's nice to see more and more code being written that doesn't assume programmers are superhuman beings with an IQ of 250 and infinite concentration and working memory. We need all the help we can get, so that we can focus as much of our precious, limited cognitive firepower on what really matters. When even John Carmack is talking about getting all the help he can from his development environment [1], you really ought to listen.
[1]: http://number-none.com/blow/john_carmack_on_inlined_code.html http://number-none.com/blow/john_carmack_on_inlined_code.htm...
- hinkley 10y agoPair debugging is an exercise in patience that I often lose. If I had a dollar for every time I asked someone "Okay, look for other uses of this variable" and they grab the mouse and stare at the screen because THEY'RE READING THE ENTIRE FILE LOOKING FOR A PIECE OF TEXT, instead of using any of the dozens of search mechanisms at their disposal, I could retire and write self-help books for programmers. Stop trying to white-knuckle everything all the time, you masochistic people. Use tools like a sentient creature is supposed to.
- quantumhobbit 10y agoMaybe the other person in the pair is forgetting to use their tools because they are stressed out by the aggressive person standing over their shoulder looking for any excuse to grab the keyboard?
- kctess5 10y agoSometimes, this might be the case, however after the nth time of nicely saying "oh btw you can just do [insert shortcut] and find it right away!" it's hard to not get frustrated. I have definitely worked with people who for whatever reason, absolutely refuse to learn their text editors and debugging aids.
- hinkley 10y agoUsually this becomes an interpersonal issue when you're working with someone who has a track record of only changing 90% of the code that needs to be changed to implement a feature/bug fix because they keep missing one spot where the information is used.
- hinkley 10y agocough I have no idea what you're talking about. Mostly I think the exploratory phase of debugging is a battle between your limited short term memory and your imagination. It's a think you need to do alone and without someone stopping you to ask why every fifteen seconds. I think that's why people are so big on repro steps, so they can go off and start the process of elimination without having to dump state while defending checking possibility A before checking possibility B. I think the only reason (besides tenacity) that I fix bugs that others gave up on is that I have tricks that let me walk the code faster, which lets me make forward progress on deduction before I forget WHY I was looking under this rock in the first place. My debugging practices look not unlike a guy looking for his missing keys. You have to be careful about when to hit him for questions, and most of the time it's better to just start your own parallel search if you want to help.
- kbenson 10y ago> which lets me make forward progress on deduction before I forget WHY I was looking under this rock in the first place. There's nothing quite as deflating as finally getting to the end of diagnosing a particularly pernicious bug just to have the understanding trigger the realization that you've encountered this bug before a year or two prior, spent just as much time originally figuring it out, and had somehow forgotten about it the interim. Yay for wasted days of our lives.
- erikpukinskis 10y agoWhenever I unravel a hard-to-diagnose bug, my first step is always to put a better error message in the place where it would have been properly diagnosed.
- kbenson 10y agoSure. I can't recall the last bug that brought this feeling (sigh, the circle continues), but I vaguely recall it being a weird interaction or behavior when interacting with some remote system, and it wasn't in fixing a bug that popped up, but in implementing a new feature or system that interacted in a similar way, but the prior implementation was either in a different project or had since been discarded. I know that's vague. That probably means I'll encounter this again and not identify it as the same problem. :/ I think I need to make a concerted effort to get more sleep.
- coldtea 10y agoYeah, it's not that. Lots of programmers inherently don't use the tools at their disposal... something which also shows on the code they right...
- mixedCase 10y agoMaybe tooling doesn't always go deep enough where it matters. For example, your spell checker didn't help you at all in that last sentence.
- pjmlp 10y agoA good example, graphical debuggers. Already in late 90's I couldn't believe what UNIX coders considered state of art, versus what we had on Mac/Windows/Amiga environments (the ones I knew before UNIX).
- lmm 10y agoMaybe sometimes. I've certainly worked with someone who explicitly said "if your first instinct on seeing an error is to reach for a debugger you're probably not a good programmer", and as a result he'd spend hours tracking down a bug that could be solved in minutes by someone willing to actually use tools. Even more unfortunately, a lot of the junior programmers on the project listened to him and wouldn't use debuggers either.
- mrob 10y agoIt's your fault for saying "look for". They're doing just that. They're using all their available brain power thinking about the code so they don't have any to spare to interpret unclear instructions. Instead say "search for", or if that's still unclear say "control-F for" (or whatever shortcut activates search).
- donw 10y agoHave you tried suggesting that exact trick (using search rather than scanning) to your pair whenever they default to the Mark One Eyeball? Having paired quite a bit, it's rather amazing how many programmers just don't know the full utility of their existing tooling. Not because they are stupid, but just because they never made that particular connection. I have been on the receiving end of this dozens of times, and it is one of my favorite things about pairing as a programmer: where my pair shares a neat trick that saves me a notable amount of time and/or aggravation.
- cmontella 10y ago> it's nice to see more and more code being written that doesn't assume programmers are superhuman beings I would say that most compilers don't even assume the programmer is human. The root cause of bad errors is that they emanate from the compiler, and are reported from the perspective of the compiler. That's why you get errors like "can't access method undefined of undefined", or the hell that is C++ template errors. Sure, the errors make perfect logical sense from the perspective of a compiler, but they make my human eyes bleed. My favorite is a single missing semicolon that causes a cascade of unrelated errors, none of which indicate there's a missing semicolon. grammars, parsers, compilers, and languages as a whole should be designed for humans first. Even if it makes the language implementation a little more complex, human users will benefit greatly and thank you for it.
- boznz 10y agoI think that is why ADA became popular for mission critical stuff as you can inform the compiler a lot more about the constraints and so in effect make the compiler more user friendly. (Disclaimer happy to be corrected as I have never used ADA but I just finished listening to the podcast on embedded.com and thought it relevant)
- msbarnett 10y agoThe biggest correction I have is that it's not an acronym -- Ada, not ADA.
- eatbitseveryday 10y ago"ADA" as an acronym is more easily know as "Assistant District Attorney".
- nommm-nommm 10y agoI read ADA first as Americans with Disabilities Act (https://www.ada.gov https://www.ada.gov). In all seriousness, Ada the programming language is named after a person - the English mathematician Ada, Countess of Lovelace known as "the first computer programmer" ( https://en.m.wikipedia.org/wiki/Ada_Lovelace https://en.m.wikipedia.org/wiki/Ada_Lovelace)
- overcast 10y agoReading HN comments, I assumed everyone is a superhuman with an IQ of 250 and infinite concentration.
- qwertyuiop924 10y agoAre you even reading the same website as me?
- D-Coder 10y agoNot all of us.
- telotortium 10y agoJust wait until the next politics thread.
- smcl 10y agoDid you post the right link? That one was about John Carmack inlining some function calls and eliminating weird branching to (potentiall) reduce bugs/errors. Or am I missing something?