SubMain - CodeIt.Right The First Time!

/Community

Support Community for SubMain Products
 Home Products Services Download Purchase Support
in Search
 
Home Forums Blogs Tutorials/CIR Tutorials/GD Downloads
Welcome to SubMain Community Sign in | Join | Help

Somewhat inconsistent guidelines regarding naming and semantics... and a suggestion :-)

Last post 10-18-2012, 4:18 AM by gpuchtel. 0 replies.
Sort Posts: Previous Next
  •  10-18-2012, 4:18 AM 2871

    Somewhat inconsistent guidelines regarding naming and semantics... and a suggestion :-)

    In section 3.15 Event Naming Guidelines, item #2 you state:

     

    Specify two parameters named sender and e. The sender parameter represents the object that raised the event. The sender parameter is always of type object, even if it is possible to use a more specific type. The state associated with the event is encapsulated in an instance of an event class named e. Use an appropriate and specific event class for the e parameter type.

                    *Note: you depict a similar convention for catching exceptions whereby the Exception parameter is given a name ‘e’.

     

    In section 4.5 Field Usage Guidelines, item # 4 you state:

     

    Spell out all words used in a field name. Use abbreviations only if developers generally understand them. Do not use uppercase letters for field names. The following is an example of correctly named fields.

                    In item #5 you state:

     

    Do not use Hungarian notation for field names. Good names describe semantics, not type.

     

    In summary, I feel this is inconsistent. It implies a type and it’s an abbreviation, albeit one that most developers generally understand. Still, in the case of item #2 in section 3.15 I believe semantically the term ‘subject’ is more appropriate rather than ‘e’, which is a type. Same for catching exceptions (Exception exception) it should read:

     Specify two parameters named sender and subject. The sender parameter represents the object that raised the event. The sender parameter is always of type object, even if it is possible to use a more specific type. The state associated with the event is encapsulated in an instance of an event class named subject. Use an appropriate and specific event class for the subject parameter type.

View as RSS news feed in XML
 
     
 
Home |  Products |  Services |  Download |  Purchase |  Support |  Community |  About Us |