Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Object-Oriented PHP Basics Understanding Classes Adding Properties

Bryn Humphreys
Bryn Humphreys
26,472 Points

PHP OOP naming conventions

I'm a little confused. The video, which by the way I think Alena's videos are excellent, states that the naming convention for properties are camelCase. However in the quiz the properties are underscored. Is camelCase the way to go?

Boon Kiat Seah
Boon Kiat Seah
66,664 Points

Hi Bryn,

It is usually the case that camelCase is where the community is heading. However, there are still many conventions available for a programmer to adopt. In general, conventions used should allow yourself to easily identify and relate the object properties while we are doing a quick scan of the long list of codes. The convention is there for readability and consistency.

As long as the code written are consistent with the adopted convention, it will be good.

Hope this makes sense.

Thanks