3 ms·
That's insane, what could those 3 engineers possibly be doing for 3 days? - const, reference and function argument should be pretty obvious from the code conte
by vntok 8y ago
That's insane, what could those 3 engineers possibly be doing for 3 days?
- const, reference and function argument should be pretty obvious from the code context
- LastNameCol seems like self-describing... of course you would have to know that you're debugging an application that talks to databases, but eh
- marcinzm 8y agoMost likely tracking down what originally populated the variable and how it's used. I'm assuming the code base was large and spaghetti like. I'd say it's somewhat akin to proving a negative. Sure you get that it's a const, reference and function argument which likely refers to the Last Name Column. However is that all it is? Or is there more meaning in the name? Meaning that could be crucial to understanding how the application functions? Does one of the characters mean function reference or does it refer to something else? Apparently not in this case but how can you know without investigating?
- wild_preference 8y agoSpending time to understand the author’s intent of some code is one of the hardest parts of reading code. It’s like when you find a nil-guard in a function. You can’t truly refactor it until you know whether it was added defensively just-in-case or whether nils can still exist in the system at the function’s callsite, calling for further upstream examination. There’s a certain hell in trying to follow a code base where every function is infected with ‘if (!arg) return’.
- AgentME 8y agoAfter dealing with code absolutely plagued with that pattern, languages with non-nullable types are amazing (Flow, Typescript in strict mode, Kotlin, Rust, ...) and I don't think I'm ever going to voluntarily switch away from them now.