I don't know about R (and I will read the article you linked to) but
what you said made me think of the mess in PHP function names. For
instance:

* Half the functions are verb_noun() an half are noun_verb()
* Half the functions use underscores, half do not.

This means that it is very hard to remember whether the function name
is str_replace() or strreplace() or replace_str() or replacestr().

So you end up having to look up the function, and then you realize
that str_replace() doesn't actually do what you need and you need to
use substr_replace() because PHP functions have no generality in them.

http://toykeeper.net/soapbox/php_problems/

Cheers,
Daniel.



On 1 January 2014 08:57, Stephen Eglen <[email protected]> wrote:
>> I’d be really interested to know what others think of these rules and
>> what they think is missing. Right now, my guidelines leave a lot of
>> wiggle room.
>
> Thanks very much for taking this on.  I think it is important to get
> something sensible adopted early on so that Julia doesn't get into the
> same problem that R has now with e.g. so many different naming
> conventions for function within base R.
>
> Not only does it add to readability, it reduces cognitive load if you
> don't have to remember which of several different styles the function
> should be written in.
>
> For those who don't know the "mess" R is in, check out this short
> article:
>
>  http://journal.r-project.org/archive/2012-2/RJournal_2012-2_Baaaath.pdf
>
> Some minor points:
>
> re: 13 "If a variable or function name is too long to be read in all
> lowercase, insert underscores at word boundaries".  What do you define
> as "too long"?
>
> How about being a bit more prescriptive for naming certain objects,
> e.g. using "isX" for testing whether an argument is an object of X?  (A
> bit like the lisp convention of a trailing -p for predicate).
>
> Also, mention the convention of a trailing ! for a function that
> modifies its args?
>
>
> happy new year to you all.
>
> Stephen
>



-- 
When an engineer says that something can't be done, it's a code phrase
that means it's not fun to do.

Reply via email to