Changes between Version 25 and Version 26 of MapGuideCodingStandards


Ignore:
Timestamp:
Apr 4, 2009, 5:22:02 PM (15 years ago)
Author:
uvlite
Comment:

added some motivation for documentation and code style

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideCodingStandards

    v25 v26  
    8484private float shoeSize
    8585}}}
     86
     87=== adding documentation to existing code ===
     88
     89Another useful habit to get into is to add documentation to existing code on the go where its missing to clarify whats happening. The MapGuide code base has been a commercial product before for many years, so its not a surprise that the new documentation standards have not been always followed.
     90If you spend half an hour figuring out what happened in a code section you are calling or which has called your code, add some helpful comments there too as it will help you and others next time trying to understand it.
     91 
     92Its a good idea to submit patches for files you where only adding inline documentation as its not so likely that the original developer will need comments to understand it and do this for you.
     93
     94=== Copy and Paste vs. method extraction ===
     95
     96Many times copy and paste seems a quick way to make code work. But it also inflates the code and there is a risk of obfuscating essential details. If some code is doing the same thing try to extract a helper method and reuse this method. This makes code much easier to read and understand. In the extreme case copy 'n paste leads us to hundreds of lines of identical code with just a few lines of changes inside. This is doomed to cause defects when anything changes later in time as the code has to be changed in many places instead of one.
    8697
    8798== Object Creation and Runtime Speed ==
     
    219230== IDE Settings ==
    220231
    221 It is recommended that you use Visual Studio .NET for software development on Windows and it helps if some settings are the same for all users.  Here are the ones you should make sure are set.
     232It is recommended that you use Visual Studio 2008 for software development on Windows and it helps if some settings are the same for all users.  Here are the ones you should make sure are set.
    222233
    223234Under Tools/Options/Text Editor/All Languages/Tabs, make sure the tab size is set to 4 and that the ‘Insert spaces’ option is turned on.  The use of spaces everywhere rather than a mix of tabs and spaces has the following advantages: