On 15 Oct 2008, at 01:54 , Sebastien Lelong wrote:

> You do not specify all what is said in JSG (avoid namespace  
> collision vs. Common API, for instance). Names for libraries and  
> pins are already settled, as procedures, function, etc..
>
> I vote for what is in JSG...

The JSG is not consistent:

> procedures and functions must be named as:
>
>     * <function>_<whatever> if you want to have a common API

is not the same as:

> All external names (of global variables, constants, procedures and  
> functions available to application programs) must start with a  
> prefix unique to the library.


because "function" can't be (and shouldn't be) specific to a library.  
Enforcing both these rules (function_whatever + specific start) would  
mean:

get_temp_celsius()              -- tc77 temp
read_temp_celsius()             -- tc74 temp
haul_temp_celsius()             -- ds1820 temp

where get, read and haul woudl be specific to their respecitve  
libraries. This is bad.





>
>
> Seb
>
> De: Eur van Andel <[EMAIL PROTECTED]>
> Env: mardi 14 octobre 2008 23:34
> À: jallib <[email protected]>
> Objet: [jallib] vote on namespace for procedures and functions
>
> Hi
>
> We need a vote about procedure names.
>
> NB: names for libraries and pins are already settled, see:
>
>> Rules of thumb
>> Filenames, variables, procedures naming convention
>> Filenames
>
> in:
>
> http://code.google.com/p/jallib/wiki/JallibStyleGuide
>
>
> I see several possibilities:
>
> ---------------------------------------------------------------------- 
> ----------------
> 1) device_function()
>
> examples:
>
> hd44780_clear(), hd44780_line1, hd44780'put()
> t6603_read_co2(), t6603_read_height()
> tc77_read_celsius(), tc77_read_fahrenheit
> ---------------------------------------------------------------------- 
> ----------------
> 2) function_device()
>
> examples:
>
> clear_lcd_hd44780(), lcd_set_cursor_hd44780(), lcd_hd44780'put()
> read_co2_t6603(), read_height_t6603()
> read_celsius_tc77(), read_fahrenheit_tc77()
> ---------------------------------------------------------------------- 
> ----------------
> 3) function()
>
> examples:
>
> clear_lcd(), lcd_set_cursor(), lcd'put()
> read_co2(), read_height()
> read_celsius(), read_fahrenheit()
> ---------------------------------------------------------------------- 
> ----------------
>
>
> 1) pro: no namespace collision
> 1) con: not too clear if you don't know the IC numbers, long, oldskool
>
>
> 2) pro: no namespace collision, can be changed to another device by  
> replacing chip number
> 2) con: long
>
> 3) pro: short, simple
> 3) con: namespace collision, unclear which external device is used
>
>
> We could cheat and use both 2 and 3: I like put/get functions for  
> lcd and serial. And yes, you will need to hack the library if you  
> want to use two lcds and rename one putfunction "lcd2" for instance.Â
>
> My vote: 2) with putfunctions (and only put/get functions) like 3).Â
>
> Your votes please.Â
>
> ---
> ir EE van Andel [EMAIL PROTECTED]  http://www.fiwihex.nl
> Fiwihex B.V. Wierdensestraat 74, NL7604BK Almelo, Netherlands
> tel+31-546-491106 fax+31-546-491107
>
>
>
>
>
>
> >

---
ir EE van Andel [EMAIL PROTECTED]  http://www.fiwihex.nl
Fiwihex B.V. Wierdensestraat 74, NL7604BK Almelo, Netherlands
tel+31-546-491106 fax+31-546-491107



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to