Few more words.

About examples: if device_function() gives hd44780_clear(), then
function_device() should give clear_hd44780(), not clear_lcd_hd44780()

If you go with 2), how will you deal with common API ? Since you put the
device (hd44780), what will you do when you'll change the LCD type (st7036)
? Isn't this why we don't use "device", but what we call "function" (lcd)
and may call "device_family" or something else. I understand there's a
confusion about the meaning of "function", better reserved for proc/func
name, such as "read", "write", "print", "move_motor_forward", etc...


Seb

PS: I still vote for what is in the JSG :)



2008/10/14 Eur van Andel <[EMAIL PROTECTED]>

> 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
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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