David from Kodaps
1y ago
A neuro-spicy Parisian Brit who writes about software engineering, tech communication, entrepreneurial journeys & data. I help understand code, why it is fun, & how devs think.
Here are 4 principles of good code to help your code shine.
KISS - Keep it simple : You will not recognise your own code six months from now. Keep it simple, keep it readable. Keep it clear. Don't be clever. Your future self will thank you.
DRY - Don't repeat yourself Copy-pasting is a sure sign that things have gone wrong somewhere.
YAGNI - You ain't gonna need it. User needs and software specifications are fluid. Don't optimise too early. Don't away abstract concepts on the off chance another similar use case might arise one day.
TDA - Tell don't Ask (a.k.a Separation of Concerns) Business logic should be in one place. "Bits" of code should do one thing only. Keep things separate.
What do you think, are there any more that are worth mentioning and focusing on?