A Bunch of Programming Advice Iโ€™d Give To Myself 15 Years Ago by mbuffett

If you continuously make the same mistake, make it harder to make that exact mistake.

These things stick around a weird amount, because thereโ€™s never a natural time to address them.

I can relate to this so much.

In the comments of the YouTube video as to why these small items arenโ€™t always addressed:

They donโ€™t feel they own the problem which is essentially a culture issue. Small issues need to matter to bosses and all devs need to be full citizens of the team.

If you canโ€™t easily explain why something is difficult, then itโ€™s incidental complexity, which is probably worth addressing

Inherent complexity to the problem and resulting code complexity should be in line. If something is technically very complex but conceptually isnโ€™t (and itโ€™s not easy to explain), you are probably doing something severely wrong.

Try to solve bugs one layer deeper

I have seen way to engineers in my life that seemingly refuse to do this. Donโ€™t just solve a bug, think about why a bug occurred in the first place. Is it supposed to happen? If not, fix the underlying issue.

Bad code gives you feedback, perfect code doesnโ€™t. Err on the side of writing bad code

Itโ€™s indeed a tradeoff and itโ€™s not worth writing the perfect code if it doesnโ€™t solve any meaningful problem or if the startup runs out of money. The problem in more established companies is that you have to fight to fix tech debt. If people know they will jump through hoops to fix things afterwards, they will err on the side of writing perfect code instead (or get very frustrated).

Interestingly enough, the examples provided donโ€™t even apply to my day to day job in my opinion. โ€œadding a couple of asserts over our invariantsโ€ was considered something wild when I introduced it. The fact that it is considered the โ€˜bad codeโ€™ in this case, makes me somewhat worried about my current job.

YouTube video by Theo on the same article

6:10 Pay more attention to what unfamiliar devs point out then what familiar devs point out. A fresh pair of eyes is worth a lot.