How I may help
LinkedIn Profile Email me!
Call me using Skype client on your machine

Reload this page Programming Standards

Here are the programming standards that I and my team follow when programming in Canother page on this site or Javaanother page on this site

 

Topics this page:

  • Existing Code
  • Indenting
  • Module Sequencing
  • Your comments???
  •  

    RSS XML feed for load testers RSS preview for load testers Site Map List all pages on this site 
    About this site About this site 
    Go to first topic Go to Bottom of this page

    Search

    Set screen Existing Code - Principles

      1. We adhere to the style of the original.

      When modifying existing software, our changes follow the style of the original code unless changes to rewrite a new coding style is explicitly requested within the scope of the project.

      There are several reasons why we feel that it is usually not economically beneficial to rewrite old software just to make it match the new style:

      • The choice of any particular style can be rather subjective, costing more in time for discussions than just the programming and debugging effort.

      • Use of different styles within a single source file produces code that is more difficult to read and comprehend.

      • Changes for any reason carry a risk of introducing defects.

      2. We adhere to the Principle of Least Astonishment.

      We avoid doing things that may surprise people (other programmers and users of our software). We aim to make the interaction and behaviors exhibited by our software predictable and consistent.

      3. We aim to do it right the first time, right from the start.

      By experience, we know that, more often than not, supposedly prototype or experimental code make their way into a system people depend on. It's difficult and time consuming to decipher code, We never know whether we will have an opportunity to "finish up" a piece of code. So, we consistently:

      • create a new programming file by completing the programming identifying comments before editing code.

      • make an entry in the change log to describe and justfiy the changes we intend to make before we make those changes.

      4. We justify deviations to Standards

      If we do not feel that a particular standard (whether defined in a document or implicit in existing code), we explain why in the coding and clearly identify where deviations are necessary. This is especially important when implementing any unusual patterns of use or behavior.

     

    The programming standards we follow are based on these books and websites:

    The Elements of Java Style (Cambridge University Press, 2000) by Al Vermeulen

     
    Go to Top of this page.
    Previous topic this page
    Next topic this page

    Set screen Indentation of code blocks

      Consistency in indentation style helps programmers to quickly locate a desired block of code.

      However, the approach to text indentation is perhaps the most contentious of standards.

      In a complex program, this can be annoying, since it takes time to navigate to lines.

      We prefer to use tabs

      Tabs are easy to use, since one can easily reach a key with the left pinky on most keyboards.

      Those who craft interperted code, such as HTML, feel they can reduce program transmission time when they use tabs rather than several space characters. A tab is usually 8 spaces. However, white space compression tools can be employed to strip out space characters and other "white space" and place the resulting code files in customer-facing folders.

      We indent longer comments under lines they comment about


    Go to Top of this page.
    Previous topic this page
    Next topic this page

    Set screen Individual Module Sequencing

      Use a package.

      Within a module file (which gets compiled into a Java class), we structure

      1. Import statements

        After public class XXX(

      2. Constant declarations
      3. "Global" variable declarations
      4. Generic Utility functions useable by an program, such as:
        • startPrinting()
        • stopPrinting()
        • printError()
        • printInfo()
        • printTrace()
        • printDebug()
        • getMinute()
      5. Application Utility methods useful by several programs belonging to a particular application, such as:
        • getServer()
        • login()
      6. Application Business-specific methods useful only to a particular application, such as:
        • addPayment()
        • refresh()
        • populatePayment()
        • approve()
        • getPayment()
        • release()
        • createContracts()
        • importTX()
        • exportTX()
      7. Main methods for the program:
        • Entry method such as init()
        • action()
        • end()


    Go to Top of this page.
    Previous topic this page
    Next topic this page

    Set screen Libraries

      International Components for Unicode (ICU) is a set of IBM open-sourced code libraries providing Unicode and Globalization support for software applications. It is mature and widely-used. ICU is portable and gives applications the same results on all platforms and between C/C++ and Java software.


    Go to Top of this page.
    Previous topic this page
    Next topic this page
    Set screen

    Related Topics:
    another page on this site LoadRunner 
    another page on this site SNMP 
    another page on this site Rational Robot 
    another page on this site Free Training! 
    another page on this site Tech Support 


    Go to Top of this page.
    Previous topic this page
    Next topic this page

    How I may help

    Send a message with your email client program


    Your rating of this page:
    Low High




    Your first name:

    Your family name:

    Your location (city, country):

    Your Email address: 



      Top of Page Go to top of page

    Thank you!