Being a self taught programmer, I base most of what I do on KISS and DRY.
For me they encapsulate complex ideas well and DO help me to write better code.
What else should I know?
Being a self taught programmer, I base most of what I do on KISS and DRY.
For me they encapsulate complex ideas well and DO help me to write better code.
What else should I know?
These two UI gems are from Bumper-Sticker Computer Science; I try to adhere to them wherever possible:
YAGNI is a good one to help developer instituted scope creep.
Loose coupling is also a fave of mine, check out the IOC pattern, and watch this for a really nice and basic (C#) example
tight cohesion and loose coupling
I think this concept encapsulates the core of software engineering.
Perhaps it isn't a maxim, and you already know it: first think, then code. Don't write any code without thinking before what you want to do -using pen and paper.
Write tests.
Tests that reassure you that your code is doing what it should do.
Pretty much whatever your language, there's a testing framework available. Probably more than one.
Once you have tests, run them often. Every time something changes, so that you know immediately when you've encountered an unexpected side-effect.
Care for your tests. As your code evolves, the tests may need to evolve with it - don't discard them when they're no longer testing what your code now does.
If you get that far, try going for the Big One: write a test before you write the code that passes it. Let your tests define your code. At that point you will have added a new acronym: TDD to your arsenal.
Warning: Tongue firmly in cheek!
Buy Bentley's More Programming Pearls for his Bumper-Sticker Computer Science.
"Do the simplest thing that can possibly work."
It gives you a good place to start, and has the side effect of encouraging an end product that is both effective and simple to explain, which can be a big benefit when the client doesn't have a technical background.
Principle of Least Knowledge: Use only one dot in OOP languages.
I.e., try to avoid a.b.Method()
a.k.a. Law of Demeter