User Tools

Site Tools


en:devmon:guidelines

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:devmon:guidelines [2021/08/12 08:56] – [Use modern default:] Bruno Manzonien:devmon:guidelines [2021/08/19 17:53] (current) – [20 Best Practices] adminw1k1
Line 9: Line 9:
 ==== Formatting and Code review ==== ==== Formatting and Code review ====
  
-  * [[en:devmon:guidelines:tidy|Tidy code]]+  * [[en:devmon:guidelines:tidy|Tidy (document & code)]]
  
 +
 +==== 20 Best Practices ====
 +From Perlmonks, but apply to coding in general, and simplify or make it clearer(WIP)
 +  * [[en:devmon:guidelines:20bestpractices|20 Best Practices]]
 +     
 ==== Use Perl ==== ==== Use Perl ====
   *[[en:perl|Perl tutorial and ressources]]   *[[en:perl|Perl tutorial and ressources]]
Line 17: Line 22:
     * Arrow     : use rule#3 ([[en:perl:perlarrow]])     * Arrow     : use rule#3 ([[en:perl:perlarrow]])
  
 +  * [[en:devmon:guidelines:variables|Variables Best Practice]]
  
  
- 
-==== Variable name ==== 
-  * Avoid CamelCase and variation: use **underscore** 
-  * As short as possible to describe the "function" of the var: sample my $desc = "devmon is cool" 
- 
-=== With or without "s" at the end === 
-  * scalar($) and hash(%) without "s" 
-  * array(@) with an "s" 
- 
-=== Avoid ambiguous names === 
-  * last (final or previous) 
-  * set (adjust or collection) 
-  * left (direction or what remains) 
-  * right (direction, correct or entitlement) 
-  * no (negative:non or number) 
-  * record (verb or noun) 
-  * second (time or position) 
-  * close (nearby or shut) 
-  * use (active_usage or category of function) 
-  * term (terminal or termination) 
-  * temp (temperature or temporary) 
-  * val (value or valid) 
-  * **Avoid too short names** that dont give a real benefit: **prefer good readability** 
-  * prop(erty), val(ue), str(ing), num(ber), idx(index), but use it as postfix {variable}_XXX 
-  * i, j, k, x, y, z 
- 
-=== Do not use === 
-  * list, set, value, equals, data, var, 
- 
-=== Quantity === 
-  * {variable}_count 
-    * : {variable}s_count 
-    * Hash: {variable}_count 
-  * Linear Structure: , hash, list ->{variable}_count 
-  * Non-Linear Structure: Tree set: -> {variable}_count, ? 
- 
-=== Prefix === 
-  * format: as_number, as_string, 
-  * boolean: is_number 
- 
-=== Reference === 
-  * {variable}_ref 
  
en/devmon/guidelines.1628751367.txt.gz · Last modified: 2021/08/12 08:56 by Bruno Manzoni