|
|
||
|
|
JavaScript Coding StandardsScopeThis documents the coding standards for JavaScript. Java Script is used in Web pages to add interactivity and conditional logic. This document is intended to be a living document. It serves as the vehicle for deriving and documenting agreed to practices by all involved personnel writing JavaScript for the Brevard County Board of County Commissoiners websites. Intended AudienceThis document is intended for website developers in the Brevard County Information Systems Department and interfacing agencies. It is intended for all personnel who wish to develop industry best practices in the development of content for the Brevard County Internet and Intranet Web Sites. JavaScript Coding StandardsThis section outlines the standard guidelines to be followed when using JavaScript. The standards are divided up into separate tables according to functional category. Naming ConventionsUnlike XHTML, which is not case sensitive, JavaScript is a case sensitive language. In order to decrease the potential for bugs and to increase readability of the code, it is important to maintain consistency in capitalization. Capitalization guidelines need to apply to JavaScript keywords, classes, functions, variables and any other identifiers. Unlike the Windows operating system, which is not case sensitive, the UNIX operation system is case sensitive. This means that directory and filenames are case sensitive in UNIX. To reduce the chance of error when transferring files between the PC and UNIX platforms, there needs to be a consistency in directory and file naming. Also, avoid spaces in filenames. Spaces cause problems in some backup software. The names for files, classes, instances and variables and any other identifiers shall all adhere to the following general industry best practice guidelines:
Guidelines unique to a file, directory, class or identifier are outlined in the following table.
Syntax ConventionsThe syntax of a program is the set of rules that must be adhered to in writing the code so that it can be interpreted or compiled properly. The following table depicts guidelines where the syntax may be written in more than one way.
Change Record
|