Hi Philippe,

The CamelCase-convention dates back to just before I joined the project, so I can't help you as to the why of it. (so I doubt anyone can tell you now) I've never had a problem with it and saw no reason to change it back then. Most of the other libraries weren't as big or well-known back then as they are now. If I had to start over I'd probably mimic the Java way of doing things more, but since I'm not starting over ... It's not perfect but it's what we have and what we have to work with now :-)

The very thought of actually reworking all 6000+ files to another standard ... let's just say I might be "tougher than the toughies", but I'm not *that* though either.

Feel free to ask about anything you have questions about ... can't promise I have an answer though. (contrary to popular belief I am *not* the mobile edition of the Encyclopedia Britannica :-P )

Hans

On 05/05/2011 15:56, Philippe Van Eerdenbrugghe wrote:
I was just asking , we are starting from scratch so we are evaluating lots of decisions which have been made previously and we do not understand withtout hints. It's not that difficult to go for underscore notation but if it's not completely forced we would have chose to keep the same notation for file names and class names.

To answer your question, the camelcase to underscore mechanism is a mechanism of the autoloader which is responsible for finding the right file based on the class name. Since we plan to mirror the namespace segment with folders in our apps, it would have been natural to use CamelCase for ou class files.

The CamelCase to underscore function which we can find in Utilities has some drawbacks (like handling numbers, or transforming "XMLReader" to "x_m_l_reader" ) and it has been chosen in almost all php libraries to name the class files in CamelCase so I was asking why Chamilo chose another path.

I also agree that underscore notation is more readable but my question arose from the fact that we change the convention between class name and file name


Systho
Le 5/05/2011 15:36, Yannick Warnier a écrit :
Does someone sees a problem if an optional app (not the core) uses its
own coding convention ?

We (the claroline team) are thinking to follow this convention for
naming the classes :
http://groups.google.com/group/php-standards/web/psr-0-final-proposal
except for the ones loaded by the framework (Notably the data manager,
the manager and the components)


Actually I do not understand the reason for all the
CamelCase-to-underdscore mechanism so if someone can enlight me on this
subject it would be greatly appreciated.
Could you detail "all the CamelCase-to-underdscore mechanism" so that I
understand it better?

In general terms, in the 1.8 branch, we decided to use underscore (also
called minor camelcase) because a study (I don't have the reference but
I know it was around 2004) demonstrated that, for non
English-natural-speakers, it was far easier
to_read_text_separated_by_underscores than
ToReadTextUsingMajorCamelCase.

The example above kind of proves the point without the need for the
study (I don't think any of us is a natural English speaker).

Wanting to have the major possible easiness at entry point for
developers, we decided (I'm not talking about the current team) to go
for "lower" camel_case and we've stuck to this since then.

I'm not sure these are still the conventions in 2.0, but I'd follow
whatever is set as a convention right now and I agree with Hans that it
would be a really bad idea, although technically I wouldn't put it as an
exclusion condition to your participation in Chamilo 2.

Yannick


_______________________________________________
Dev mailing list
Dev@lists.chamilo.org
http://lists.chamilo.org/listinfo/dev

_______________________________________________
Dev mailing list
Dev@lists.chamilo.org
http://lists.chamilo.org/listinfo/dev

--

*Hans De Bisschop*
Hoofddeskundige ICTO | Lead Developer Chamilo 2.0
Software Coordinator Chamilo Association
Erasmushogeschool Brussel
Nijverheidskaai 170 | B-1070 Brussel
T 02 559 02 54 | i 254
hans.de.bissc...@ehb.be <mailto:hans.de.bissc...@ehb.be> | www.erasmushogeschool.be <http://www.erasmushogeschool.be/>

Kom eens langs: www.erasmushogeschool.be/infodagen <http://www.erasmushogeschool.be/infodagen> of lees onze elektronische nieuwsbrief: ehbrief.ehb.be <http://ehbrief.ehb.be/>
P Before printing, think about the environment

_______________________________________________
Dev mailing list
Dev@lists.chamilo.org
http://lists.chamilo.org/listinfo/dev

Reply via email to