User Tools

Site Tools


en:devmon:guidelines

This is an old revision of the document!


Developper Guide Lines

  • Openmind: This page is only a guide, but you do not have to follow it, just do your best ! And you can also suggest other ways of doing things (TIMTOWTDI: There's more than one way to do it)
  • Openness: Developpements should try to enlarge possibilities and not reduce features…(easier to say that to do!)

Formatting and Code review

Use Perl

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