4 ms·
I can read a line of code and tell you that it's storing a pointer in this array cell and removing this other pointer and incrementing this integer by 6 and so
by wredcoll 8mo ago
I can read a line of code and tell you that it's storing a pointer in this array cell and removing this other pointer and incrementing this integer by 6 and so on. None of that tells me if that is the correct thing to be doing.
Detecting obvious programming errors like forgetting to check for an error case or freeing a variable or using an array where a set should be is, usually, obvious, and frequently machine can and will point it out.
Knowing that when you add a transaction to this account you always need to add an inverse transaction to a different account to keep them in sync is unlikely to be obvious from the code. Or that you can't schedule an appointment on may 25th because it's memorial day. Or whatever other sorts of actually major bugs tend to cause real business problems.
I mean, sure, if someone documented those requirements clearly and concisely and they were easy to find from the section of code you were reviewing such that you knew you needed to read them first, then yes, it becomes a lot easier. My experience as a professional programmer is this happens approximately never, but I suppose I could be an outlier.
And yes if you want to be extremely literal, some code is easier to read than write. But no one cares about that type of code.