JavaScript and PHP filename coding conventions

Posted by Tower on Stack Overflow See other posts from Stack Overflow or by Tower
Published on 2010-06-06T09:54:14Z Indexed on 2010/06/06 10:02 UTC
Read the original article Hit count: 423

Hi,

I would like to know the popular ways of naming files in JavaScript and PHP development. I am working on a JS+PHP system, and I do not know how to name my files.

Currently I do for JS:

framework/
framework/widget/
framework/widget/TextField.js (Framework.widget.TextField())
Framework.js (Framework())

So, my folders are lowercase and objects CamelCase, but what should I do when the folder/namespace requires more than one word? And what about PHP?

jQuery seems to follow:

jquery.js
jquery.ui.js
jquery.plugin-name.js

so that it is

jquery(\.[a-z0-9-])*\.js

but ExtJS follows completely different approach. Douglas Crockford only gives us details about his preference for syntax conventions.

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript