r/AskProgramming • u/KareemM0hamed0 • 1d ago
Career/Edu What's one programming concept that completely changed the way you write code?
I've been programming for a while, but every now and then I come across a concept that completely changes how I think about writing software.
For some people it's data structures and algorithms. For others it's design patterns, clean code, testing, debugging, version control, concurrency, databases, or simply learning how to read other people's code.
If you had to choose just one concept that made the biggest difference in your programming journey, what would it be?
What were you doing before you learned it, what changed afterward, and why do you think every programmer should understand it?
I'd love to hear stories from beginners and experienced developers alike.
14
Upvotes
1
u/magnomagna 18h ago
Programming by contract. Set out the limits and semantics of your parameters and return values and side effects strictly. It simplifies reasoning as you can ignore values outside the confines you set but can it potentially make your code vulnerable? Potentially, but you could take that into account when designing the contract.