commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <dev.jerem...@greenmail.ch>
Subject [io][vote] FileUtils: decision on style
Date Mon, 28 Jul 2003 13:34:42 GMT
In FileUtils we currently have many duplicate method due to merging
classes from several sources. For example, there is a extension(String)
and getExtension(String) method.

(Ironically, both have the same bug: "/tmp/foo.bar/README" evaluates to
"bar/README".)



So, we have to decide how these methods should be named. extension(),
basename(), dirname() etc. are all named after their UNIX equivalents.
getExtension(), removeExtension(), getPath() etc. are more Java-like and
more descriptive (IMO).

I'm +1 for following the latter style.



Then, there are methods like fileCopy(String, String) and copyFile(File,
File).

I'm +1 for the "do-what"-style (in contrast to "what-do"), following
Steve McConnell's Code Complete (from 5.2, Good Routine Names: "For a
procedure name, use a strong verb followed by an object").



In the meantime I'm writing some badly needed testcases for FileUtils...
:-)

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message