T
Tom Cole
I'm starting to do more quantity of javascript coding and thought this
might be a good time to investigate code styling. I primarily develop
in Java and currently use the code styling techniques spelled out for
Java.
For example, in my code blocks ( {} ) I always place the starting brace
on the same line as the first line of code. For example:
function myFunction {
But I've also noticed a lot of developers move it to the next line:
function myFunction
{
I also place a semicolon at the end of each line, although I see it's
also not mandatory.
Third (and lastly) I also declare all Objects in first letter uppercase
and all member variables/functions in lowercase. For example:
function MyObject() {
var myFirstMemberVar;
function doSomething() {
....
}
}
Is there a coding standard for Javascript? Do my current practices seem
feasible?
Thanks in advance.
might be a good time to investigate code styling. I primarily develop
in Java and currently use the code styling techniques spelled out for
Java.
For example, in my code blocks ( {} ) I always place the starting brace
on the same line as the first line of code. For example:
function myFunction {
But I've also noticed a lot of developers move it to the next line:
function myFunction
{
I also place a semicolon at the end of each line, although I see it's
also not mandatory.
Third (and lastly) I also declare all Objects in first letter uppercase
and all member variables/functions in lowercase. For example:
function MyObject() {
var myFirstMemberVar;
function doSomething() {
....
}
}
Is there a coding standard for Javascript? Do my current practices seem
feasible?
Thanks in advance.