Over the 19 years I’ve been a developer I can say I have seen some good, some bad and some ugly practices, but lets remain positive and here is my list of best practices/thoughts to which I hope have adopted to over the years:-
- Make sure you have the latest version of the code before you check in (if you’re using SVN).
- Small commits and commit often, after you’ve run your tests locally that is.
- Don’t be the developer who is always breaking the build, check that your code builds on the build server.
- Check your builds daily, make sure builds aren’t left broken for days.
- Automate builds/deployments where practical, manual deployments are a no-no.
- Measure code coverage as it can point to bad smells in your code base.
- Write Integration tests and Unit Tests which add value, not just to get code coverage up.
- Clean up after you, don’t leave stuff lying around.
- Make sure your log files are actually helpful, don’t fill them with useless info and make the log level easily configurable.
- If you create Helpdesk tickets then give some meaning to the piece of work, don’t be lazy.
- Don’t check in Third Party Nuget packages to source control – keep your repositories lean as possible.
- Begin Transaction *put your update statement here* Rollback Transaction, trust me this can save your ass.
- Leave the code in a better place than it was before you touched it, remove unused code, unused using statements, refactor duplicated code etc.
- Get the database Id in SQL using ‘select db_id()’ and trace it so you know exactly what your stored procedure is doing
- At the daily stand up, have a note of what you were working on, “I don’t know what I did yesterday helps no one”.
- Try and figure out why its broken, don’t leave it for others to fix, you wont learn much doing that.
- Take an interest from development right through to deployment, the more you know the more you’ll understand and can perhaps help out.
- We are professionals, act like one and take pride in your work.
I will add to this list over time, feel free to comment on any of this and tell me your thoughts.
Catch me on twitter @gsuttie