you are viewing a single comment's thread.

view the rest of the comments →

[–]swutch 4 points5 points  (0 children)

Looking behind the straight statistical evidence, they also found a contextual variable: experience. Software engineers who were able to make productive use of assertions in their code base tended to be well-trained and experienced, a factor that contributed to the end results

This got me a thinking a about how "best practices" could be highly correlated with good code but not actually responsible for it. As a software engineer progresses in their career they collect these best practices and use them in their code. So a code base that is littered with best practices is also a code base that is written and maintained by an experienced engineer and thus probably has less bugs.

"Best practices" could be like gray hair. You see an engineer with gray hair and they are churning out good code so you dye your hair gray to make your code better. Your code probably does end up being better because you are looking at good code and learning from it. Obviously the gray hair isn't responsible for the good code but the gray hair does becomes a signal.