naming conventions
as mentioned before, php itself does not have a policy for naming its functions- one might be "htmlspecialchars" and another "html_entity_decode". halfway through a fairly large web-db project i realized that i should determine a naming convention to avoid such confusion in my own code. of course, this is a classic programming mistake: create your variables and functions and call them in your program and then later on decide to change their names. the program breaks and sometimes it takes a while to realize that you are calling a function or variables which is no longer named that.
so what do i need to decide on conventions for?
1. javascript function names
2. html form names
3. html form variable names
4. php variable names
5. php function names
6. database table names
7. database table field names
for javascript, i decided to use "functionName(...)" as i would with java.
for php, i will use "function_name(...)" and "variable_name".
for html forms and variables, the same.
for database names, the same. i can use UPPER_CASE in my code if i want to.
from here on out, if i stick with these naming conventions, i save time.
so what do i need to decide on conventions for?
1. javascript function names
2. html form names
3. html form variable names
4. php variable names
5. php function names
6. database table names
7. database table field names
for javascript, i decided to use "functionName(...)" as i would with java.
for php, i will use "function_name(...)" and "variable_name".
for html forms and variables, the same.
for database names, the same. i can use UPPER_CASE in my code if i want to.
from here on out, if i stick with these naming conventions, i save time.
1 Comments:
At 12:05 PM ,
The Dreamer in... said...
Naming conventions are important in 3ds Max as well. Some scenes will have hundreds of objects in them, and to keep them all straight, a well-thought out naming convention decided upon before the project really starts up can come in handy.
Post a Comment
Subscribe to Post Comments [Atom]
<< Home