News for hackers. Stuff that matters.
Re:On navigating a large codebase by Aeolun on Sunday February 14, 2021 @05:59AM (#26131278)
> good code is self-documenting

I still believe this to be more or less true.

The important part there is that you have to write good code though.

Re:On navigating a large codebase by disgruntledphd2 on Sunday February 14, 2021 @06:26AM (#26131418)
So, the advice is bad, as most people (including myself, no doubt), will write mediocre code, just by the shape of the distribution (assuming it's normally distributed, which is a strong assumption, but without data it's probably reasonable).

Advice that relies on people caring about their craft/having the skills to do the work well doesn't scale, so it's bad advice where those things aren't true.

Re:On navigating a large codebase by magicalhippo on Sunday February 14, 2021 @01:41PM (#26134883)
You come a long way with avoiding direct calls in "if" clauses and similar, using descriptive variable names, and not trying to be clever for the sake of being clever.

For example, instead of

    if (order.version > 1) ...
assign it to a descriptive variable

    bool orderHasChanged = (order.version > 1);
    
    if (orderHasChanged) ...
IMO this makes it much faster to read and understand, because it says something about the intent. It can also be easier to spot bugs.

It's a bit more to write, but I find it makes a big difference when coming back to the code later on, and typing is usually not the limiting factor when writing code.

Re:On navigating a large codebase by sydd on Sunday February 14, 2021 @07:42AM (#26131921)
Also in lots of cases you are in a hurry to meet that deadline that compromises code quality. Better to leave a comment in this case than nothing
Re:On navigating a large codebase by disgruntledphd2 on Sunday February 14, 2021 @10:23AM (#26133102)
Yeah, especially if you do something weird. People have often done weird strange stuff that made sense when I finally figured out the reason.

Time pressure (and particularly with contractors) can lead to some horrific long-term burdens of maintenance.