From: Blair Z. <bl...@or...> - 2003-03-04 08:35:06
|
Nicolas Cannasse wrote: > > Okay, I give up, MList was a bad name since the beginning :) > But I don't think that Mutable_List is good either. > > Perhaps "MutList" ( without underscore ) match both needs : > 1) descriptive enough > 2) short enough Given William's point of code reviews and more people reading a piece of code than writing it, I would prefer to use the entire word unless a commonly held shortcut is known to most people, such as Chars for Characters. Just so you know, my real preference would be for something like ListMutable, reversing the order of words. For example, CPAN has the following List modules up on CPAN: Module Lisp::List (G/GA/GAAS/perl-lisp-0.05.tar.gz) Module List::Compare (J/JK/JKEENAN/List-Compare-0.15.tar.gz) Module List::Intersperse (T/TA/TAYERS/List-Intersperse-1.00.tar.gz) Module List::Member (L/LG/LGODDARD/List-Member-0.02.tar.gz) Module List::Permutor (P/PH/PHOENIX/List-Permutor-0.022.tar.gz) Module List::Priority (U/UD/UDASSIN/List-Priority-0.02.tar.gz) Module List::Sliding::Changes (C/CO/CORION/List-Sliding-Changes-0.02.tar.gz) Module List::Util (G/GB/GBARR/Scalar-List-Utils-1.11.tar.gz) Module List::Utils (T/TB/TBONE/List-Utils-0.01.tar.gz) Here it's pretty easy to see the available list modules that people could use. This naming scheme allows easy classification of modules by there name. Using the proposed name order would not have as much order. So I propose this naming scheme. 1) A module name may consists of one or more words. The first letter of each word is capitalized. Words are concatenated together with no additional characters, such as _. 2) For module names consisting of two or more words, the more general word is listed first, followed by words that qualify the first word. So ListMutable instead of MutableList. 3) Words making up a name may be shortened if the short version is a commonly known shortcut. Make the name as short as possible but no shorter than needed to be easily readable for a code review. Determining a shortcut would be up to a vote to see how many people could use the shortcut without looking it up. Example shortcut: Character -> Char. So my preferred order of names is (because I don't know how many people would use Mut for Mutable): +1.0 ListMutable +0.8 List_Mutable +0.6 MutableList +0.4 Mutable_List +0.3 ListMut +0.2 MutList > I'm happy that we add theses talks, that will help a lot in future problems > containing modules/functions naming. Definitely good to get this flat now. Best, Blair -- Blair Zajac <bl...@or...> Plots of your system's performance - http://www.orcaware.com/orca/ |