As a company specialized in selling engineering solutions, DMC spends a great deal of time developing software. We believe that there are great benefits to establishing programming standards, which, if used properly, improves the quality of code and decreases the time that it takes to bring new engineers onto a project. Benefits of standardization include making code:
- Modular & reusable
- Readable & understandable
- Easier to debug
All of these features decrease our customer's costs while improving the quality of the services we provide.
Over the last couple of months, employees at DMC collaborated with each other and agreed upon a list of best practices and paradigms that we will now follow. Here are the highlights of our agreed-upon standards for text-based programming (C# .NET, C++ and similar programming languages)
- Use Hungarian Notation, but use it wisely (Read Joel Spolsky's Making Wrong Code Look Wrong for a great summary as to what this means!)
- Document your code by writing your algorithms in pseudocode comments before creating the actual code
- Choose meaningful variable, function, class and file names
- White space is cheap - use it to improve the readability of your code
- Follow Defensive Programming practices
- Use comments to document why you are performing certain functions. Coding Horror has a great article on how to comment code.
- Manage Variable scope - keep variables alive for as short a time as possible, and minimize the distance in between variable creation and variable use.
- Modularize code by making short methods. Some rules of thumb include: 1000 line limit per file, 100 line limit per function
Stay tuned to the DMC blog for further code improvement techniques, and please post any questions in the comments!
There are currently no comments, be the first to post one.