Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
1 + 5 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
   

Re: Coding Standards
by zyspec on 2009/3/21 23:32:01

what about things like MymoduleMyClassAllTopics

This is a legitimate CamelCaps class name according to the documentation but wouldn't work. More practically "real life" examples would include virtually any 'handler' class and a class like
MymoduleMediaUploader.

It looks like most module developers have not used CamelCaps except as you indicate ucfirst...

Just trying to understand if we should use MymoduleMyClassName or MymoduleMyclassname as the 'preferred' class naming nomenclature.
Re: Coding Standards
by trabis on 2009/3/21 22:02:52

ucfirst($dirname) . ucfirst($name)

Like MymoduleMyclass.
Looks fine to me.
Re: Coding Standards
by zyspec on 2009/3/21 21:56:38

Not sure I should post this here, but it is related - please feel free to move it if it should be somewhere else.

Looks to me like there's a bug in the XoopsLoad class if CamelCaps is the recommended naming nomenclature (Xoops 2.3.2 and beyond, as of 3062 revision).

XoopsLoad->load($name,$type) converts $name to lowercase and then re-capitalizes the first name of the class so it would incorrectly change a CamelCaps class name to just a ucfirst classname. For example it would change 'MymoduleMyClass' to 'Mymodulemyclass'. It should find the ./class/myclass.php file correctly but it won't find the actual class.

Unless I'm missing something - which IS likely
Re: Coding Standards
by Mamba on 2009/3/9 20:47:48

Trabis, good catch.

I simply printed it from the Web to PDF, but obviously the alignment didn't work. I corrected it manually in this attached document.
Re: Coding Standards
by trabis on 2009/3/9 18:48:35

Pdf has some alignment bugs, you should check the correct way of align arrays there.

I do think that coding standards are very important, and must be respected by those who are committing to core. There are some old areas that are not clean yet, but the recent core changes are as good to read as poetry. Got to love XOOPS (and phppp)!

Who's Online

239 user(s) are online (179 user(s) are browsing Support Forums)


Members: 0


Guests: 239


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits