More slot confusion (same functionality, different names)

Jeremy @ Cowgar jeremy at cowgar.com
Fri Jul 31 13:13:04 UTC 2009


Hello Lisaac,

  There  are  more  areas  of  slot  confusion in the area of defining
  the  same functionality under different names. For instance, to pick
  on ABSTRACT_STRING again:

  - index_of ch:CHARACTER :INTEGER <-
  // Gives the index of the first occurrence of 'ch' or
  // 0 if none.
  (
    fast_index_of ch
  );

  - first_index_of c:CHARACTER :INTEGER <-  
  // Index of first occurrence of `c' at index 1 or after index 1.
  (
    fast_index_of c
  );

  These  functions  are  exactly  the  same (except they use different
  parameter  names,  which is not really good style). Another place in
  code  there  is  index_of  ch:CHARACTER since start_index:INTEGER...
  Thus, it's easy to see that index_of is is first_index_of.

  All  these  choices makes it harder for a new person to learn Lisaac
  and  also  makes code inconsistent. In an application, one developer
  uses  index_of  and  another  uses  first_index_of  just  because of
  stylist reasons.

-- 
Best regards,
 Jeremy                          mailto:jeremy at cowgar.com




More information about the Lisaac-devel mailing list