Program Logic

Unit 2 Index

Standards, Rules, and Keywords

Naming Standards, Rules, and Keywords

Programming languages contain rules for naming classes, variables, and methods. The names you use are called identifiers. Rules are built into the programming language and differ from standards. If you violate a naming rule, your application may not run. If you violate our naming standards, your application still runs, but you are not following the Northwood Tech established naming standards, which tend to follow industry standards. Keywords are reserved words that are used by the programming language itself. You should NEVER use keywords when choosing names for your identifiers.

Naming Standards

Identifiers are a more human friendly way we keep track of data, classes, methods, and other things within our programs. For ease of maintenance and design, it is important to choose identifier names that reflect their intended purpose. This section mainly covers naming variables and named constants. We use variables to hold values that can change. We use named constants to hold values that we do not want to change. Please remember that although we have a naming standard for named constants, that standard does NOT make it unchangeable. There are language specific rules to follow in order to make the named constant unchangeable.

Please become familiar with the PL Development Standards web page. You are excepted to follow these standards when writing programs. You can always access this page from the “Handy Pages” menu item that is on all pages of this website.

Below is an overview of some concepts.

Remember, the Program Logic Development Standards, which is a subset of the Northwood Tech Development Standards, mimic industry standards. Getting to know our standards will help you identify entities within a specific programming language. You can read more about Java Naming Conventions (aka standards) on the Geeks for Geeks website.

Naming Rules

Remember, naming rules are built into the programming language. If you violate a naming rule, your application may not run. So in addition to our development standards, you must also keep language specific naming rules in mind.

Keywords

Another name for keywords is reserved words. Keywords are reserved words that are used by the programming language itself. You should NEVER use keywords when choosing names for your identifiers.

Below are some of the Java keywords that must be avoided as identifier names. Please note, this is not an exhaustive list and they are not in any particular order. You are likely to encounter some or all of these keywords within the first year of programming at Northwood Technical College. Technically true, false, and null are literals, however you still cannot use them as identifiers in your programs. Many of these keywords are not Java exclusive. Please take time to review the list of keywords below.


What You Learned

There were many terms used in this chapter that were not fully explained. I recommend you re-visit this chapter after reading the chapter about variables, data types, and named constants.

Test Your Knowledge - Interactive Activity

Test how well you retained what you learned by using this interactive activity. If you did not get 100% the first time, review the chapter and take it again.

Standards and Keywords
The PL standards are a subset of the Northwood Tech Development Standards:
True False
When you camel case a variable, you put an underscore between the words:
True False
Identifier names and keywords are case sensitive:
True False
The name you give your variable does not matter as long as it is not a keyword:
True False
Rene is here to help, I just need to ask:
True False

 

What's next?

The next chapter in this unit is: Variables and Data Types.