Difference between revisions of "Nomenclature"

From Lazarus wiki
Jump to navigationJump to search
(tcontrol notifications)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Nomenclature}}
 +
 
* properties should not start with a verb, but with a noun
 
* properties should not start with a verb, but with a noun
 
* methods should start with a verb
 
* methods should start with a verb
Line 5: Line 7:
 
* method names "DoFoo" are reserved for calling event "OnFoo"
 
* method names "DoFoo" are reserved for calling event "OnFoo"
 
* suggestion: use "UpdateFoo" instead of "DoSetFoo" to update certain characteristics or to make some assertion valid
 
* suggestion: use "UpdateFoo" instead of "DoSetFoo" to update certain characteristics or to make some assertion valid
 +
* event properties should be named On.... starting with an adjective, then verb, then a noun (some are optional): like OnFilterRecord, OnPostError, OnDblClick (adjective to verb first)
 
* notifications for TControl decendants should be named CNxxx
 
* notifications for TControl decendants should be named CNxxx
 +
 +
[[Category:FPC]]
 +
[[Category:Lazarus]]
 +
[[Category:Coding style]]

Latest revision as of 20:38, 23 July 2013

Deutsch (de) English (en) español (es) français (fr) 日本語 (ja) 한국어 (ko) português (pt) русский (ru)

  • properties should not start with a verb, but with a noun
  • methods should start with a verb
  • method names "GetFoo" are reserved for property "Foo" getters
  • method names "SetFoo" are reserved for property "Foo" setters
  • method names "DoFoo" are reserved for calling event "OnFoo"
  • suggestion: use "UpdateFoo" instead of "DoSetFoo" to update certain characteristics or to make some assertion valid
  • event properties should be named On.... starting with an adjective, then verb, then a noun (some are optional): like OnFilterRecord, OnPostError, OnDblClick (adjective to verb first)
  • notifications for TControl decendants should be named CNxxx