SlideShare a Scribd company logo
1 of 12
Naming
Conventions
http://www.oracle.com/technetwork/jav
a/codeconventions-135099.html
Why?
• Naming conventions make programs more
understandable by making them easier to read
Packages
• Is always written in all-lowercase ASCII letters and
should be one of the top-level domain
names, currently com, edu, gov, mil, net, org, or
one of the English two-letter codes identifying
countries as specified in ISO Standard 3166, 1981.
• Subsequent components, according to an
organization's own internal naming conventions.
Such conventions might specify that certain
directory name components be
division, department, project, machine, or login
names.
Example
• com.sun.eng
• com.apple.quicktime.v2
• edu.cmu.cs.bovik.cheese
Classes
• Should be nouns, in mixed case with the first letter of
each internal word capitalized.
• Try to keep your class names simple and descriptive.
• Use whole words-avoid acronyms and
abbreviations.
Example
• class Raster;
• class ImageSprite;
• class RequestQueue;
Interfaces
• Interface names should be capitalized like class
names.
• Example :
interface RasterDelegate;
interface Storing;
Methods
• should be verbs, in mixed case with the first letter
lowercase, with the first letter of each internal word
capitalized.
• Example :
run();
runFast();
getBackground();
Variables
Are in mixed case with a lowercase first letter.
Internal words start with capital letters.
• Should not start with underscore _ or dollar sign $
characters, even though both are allowed.
• Should be short yet meaningful. The choice of a
variable name should be mnemonic- that
is, designed to indicate to the casual observer the
intent of its use
•
Example
• int i, j;
• char c;
• float myWidth;
Constants
• The names of variables declared class constants
and of ANSI constants should be all uppercase with
words separated by underscores ("_"). (ANSI
constants should be avoided, for ease of
debugging.)
Example
• static final int MIN_WIDTH = 4;
• static final int MAX_WIDTH = 999;
• static final int GET_THE_CPU = 1;

More Related Content

Viewers also liked

I Ovo Ce Proci
I Ovo Ce ProciI Ovo Ce Proci
I Ovo Ce Proci
verka 123
 
Best photos cnn 2004
Best photos cnn 2004Best photos cnn 2004
Best photos cnn 2004
verka 123
 
Charles Gould at Learning Live 2014: Total learning: learn faster, work smart...
Charles Gould at Learning Live 2014: Total learning: learn faster, work smart...Charles Gould at Learning Live 2014: Total learning: learn faster, work smart...
Charles Gould at Learning Live 2014: Total learning: learn faster, work smart...
Brightwave Group
 
Home Grown Nov 09
Home Grown Nov 09Home Grown Nov 09
Home Grown Nov 09
cnunnally
 
Bios 275 Final Project
Bios 275 Final ProjectBios 275 Final Project
Bios 275 Final Project
guestd34413
 
Continuous design innovation - 10 ways to improve the learner experience
Continuous design innovation - 10 ways to improve the learner experience Continuous design innovation - 10 ways to improve the learner experience
Continuous design innovation - 10 ways to improve the learner experience
Brightwave Group
 
「ハイパーバイザの作り方」読書会#2
「ハイパーバイザの作り方」読書会#2「ハイパーバイザの作り方」読書会#2
「ハイパーバイザの作り方」読書会#2
Takuya ASADA
 

Viewers also liked (18)

I Ovo Ce Proci
I Ovo Ce ProciI Ovo Ce Proci
I Ovo Ce Proci
 
Antarctica Exploration ICEBLOCK Intro for Children
Antarctica Exploration ICEBLOCK Intro for ChildrenAntarctica Exploration ICEBLOCK Intro for Children
Antarctica Exploration ICEBLOCK Intro for Children
 
Leon Chartarifsky
Leon ChartarifskyLeon Chartarifsky
Leon Chartarifsky
 
slid
slidslid
slid
 
Best photos cnn 2004
Best photos cnn 2004Best photos cnn 2004
Best photos cnn 2004
 
Zakład ZTPOK w nowoczesnym systemie gospodarki odpadami
Zakład ZTPOK w nowoczesnym systemie gospodarki odpadamiZakład ZTPOK w nowoczesnym systemie gospodarki odpadami
Zakład ZTPOK w nowoczesnym systemie gospodarki odpadami
 
A binary graphics recognition algorithm based on fitting function
A binary graphics recognition algorithm based on fitting functionA binary graphics recognition algorithm based on fitting function
A binary graphics recognition algorithm based on fitting function
 
Fatal Accident Nprotected Rebar External
Fatal Accident Nprotected Rebar ExternalFatal Accident Nprotected Rebar External
Fatal Accident Nprotected Rebar External
 
Charles Gould at Learning Live 2014: Total learning: learn faster, work smart...
Charles Gould at Learning Live 2014: Total learning: learn faster, work smart...Charles Gould at Learning Live 2014: Total learning: learn faster, work smart...
Charles Gould at Learning Live 2014: Total learning: learn faster, work smart...
 
Home Grown Nov 09
Home Grown Nov 09Home Grown Nov 09
Home Grown Nov 09
 
Bios 275 Final Project
Bios 275 Final ProjectBios 275 Final Project
Bios 275 Final Project
 
Expo Booking Form Wynyard
Expo Booking Form WynyardExpo Booking Form Wynyard
Expo Booking Form Wynyard
 
Continuous design innovation - 10 ways to improve the learner experience
Continuous design innovation - 10 ways to improve the learner experience Continuous design innovation - 10 ways to improve the learner experience
Continuous design innovation - 10 ways to improve the learner experience
 
Diary of a next generation learner [Learning Technologies Summer Forum 2013 s...
Diary of a next generation learner [Learning Technologies Summer Forum 2013 s...Diary of a next generation learner [Learning Technologies Summer Forum 2013 s...
Diary of a next generation learner [Learning Technologies Summer Forum 2013 s...
 
Networked Citizens a Cagliari: presentazione libro e open lesson
Networked Citizens a Cagliari: presentazione libro e open lesson Networked Citizens a Cagliari: presentazione libro e open lesson
Networked Citizens a Cagliari: presentazione libro e open lesson
 
Branding Yourself For Success
Branding Yourself For SuccessBranding Yourself For Success
Branding Yourself For Success
 
「ハイパーバイザの作り方」読書会#2
「ハイパーバイザの作り方」読書会#2「ハイパーバイザの作り方」読書会#2
「ハイパーバイザの作り方」読書会#2
 
Behavioral addictions
Behavioral addictionsBehavioral addictions
Behavioral addictions
 

Similar to Naming conventions

1. Coding Conventions [Part 1]
1. Coding Conventions [Part 1]1. Coding Conventions [Part 1]
1. Coding Conventions [Part 1]
Hardik Patel
 
Java Coding Conventions
Java Coding ConventionsJava Coding Conventions
Java Coding Conventions
Rodel Barcenas
 
Ppt programming by alyssa marie paral
Ppt programming by alyssa marie paralPpt programming by alyssa marie paral
Ppt programming by alyssa marie paral
alyssamarieparal
 
Best practices in enterprise applications
Best practices in enterprise applicationsBest practices in enterprise applications
Best practices in enterprise applications
Chandra Sekhar Saripaka
 
CLEAN CODING AND DEVOPS Final.pptx
CLEAN CODING AND DEVOPS Final.pptxCLEAN CODING AND DEVOPS Final.pptx
CLEAN CODING AND DEVOPS Final.pptx
JEEVANANTHAMG6
 

Similar to Naming conventions (20)

Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
GTU Guidelines for Project on JAVA
GTU Guidelines for Project on JAVAGTU Guidelines for Project on JAVA
GTU Guidelines for Project on JAVA
 
Coding conventions
Coding conventionsCoding conventions
Coding conventions
 
Building iOS App Project & Architecture
Building iOS App Project & ArchitectureBuilding iOS App Project & Architecture
Building iOS App Project & Architecture
 
The right way coding for ios app development
The right way coding for ios app developmentThe right way coding for ios app development
The right way coding for ios app development
 
1. Coding Conventions [Part 1]
1. Coding Conventions [Part 1]1. Coding Conventions [Part 1]
1. Coding Conventions [Part 1]
 
Naming standards and basic rules in .net coding
Naming standards and basic rules in .net codingNaming standards and basic rules in .net coding
Naming standards and basic rules in .net coding
 
Java Coding Conventions
Java Coding ConventionsJava Coding Conventions
Java Coding Conventions
 
Coding standards php
Coding standards phpCoding standards php
Coding standards php
 
What's in a Name?
What's in a Name?What's in a Name?
What's in a Name?
 
Ppt programming by alyssa marie paral
Ppt programming by alyssa marie paralPpt programming by alyssa marie paral
Ppt programming by alyssa marie paral
 
Bb Tequila Coding Style (Draft)
Bb Tequila Coding Style (Draft)Bb Tequila Coding Style (Draft)
Bb Tequila Coding Style (Draft)
 
Learn C# programming - Interfaces & Namespaces
Learn C# programming - Interfaces & NamespacesLearn C# programming - Interfaces & Namespaces
Learn C# programming - Interfaces & Namespaces
 
Writing High Quality Code in C#
Writing High Quality Code in C#Writing High Quality Code in C#
Writing High Quality Code in C#
 
Coding standards
Coding standardsCoding standards
Coding standards
 
Codings Standards
Codings StandardsCodings Standards
Codings Standards
 
Best Practices of Software Development
Best Practices of Software DevelopmentBest Practices of Software Development
Best Practices of Software Development
 
Best practices in enterprise applications
Best practices in enterprise applicationsBest practices in enterprise applications
Best practices in enterprise applications
 
CLEAN CODING AND DEVOPS Final.pptx
CLEAN CODING AND DEVOPS Final.pptxCLEAN CODING AND DEVOPS Final.pptx
CLEAN CODING AND DEVOPS Final.pptx
 
Keep Calm and Specialize your Content Model
Keep Calm and Specialize your Content ModelKeep Calm and Specialize your Content Model
Keep Calm and Specialize your Content Model
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Naming conventions

  • 2. Why? • Naming conventions make programs more understandable by making them easier to read
  • 3. Packages • Is always written in all-lowercase ASCII letters and should be one of the top-level domain names, currently com, edu, gov, mil, net, org, or one of the English two-letter codes identifying countries as specified in ISO Standard 3166, 1981. • Subsequent components, according to an organization's own internal naming conventions. Such conventions might specify that certain directory name components be division, department, project, machine, or login names.
  • 5. Classes • Should be nouns, in mixed case with the first letter of each internal word capitalized. • Try to keep your class names simple and descriptive. • Use whole words-avoid acronyms and abbreviations.
  • 6. Example • class Raster; • class ImageSprite; • class RequestQueue;
  • 7. Interfaces • Interface names should be capitalized like class names. • Example : interface RasterDelegate; interface Storing;
  • 8. Methods • should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized. • Example : run(); runFast(); getBackground();
  • 9. Variables Are in mixed case with a lowercase first letter. Internal words start with capital letters. • Should not start with underscore _ or dollar sign $ characters, even though both are allowed. • Should be short yet meaningful. The choice of a variable name should be mnemonic- that is, designed to indicate to the casual observer the intent of its use •
  • 10. Example • int i, j; • char c; • float myWidth;
  • 11. Constants • The names of variables declared class constants and of ANSI constants should be all uppercase with words separated by underscores ("_"). (ANSI constants should be avoided, for ease of debugging.)
  • 12. Example • static final int MIN_WIDTH = 4; • static final int MAX_WIDTH = 999; • static final int GET_THE_CPU = 1;

Editor's Notes

  1. unless the abbreviation is much more widely used than the long form, such as URL or HTML.
  2. ការ​ជ្រើសរើស​ឈ្មោះ​អថេរ គួរ​តែ​ត្រូវ​បាន​ជំនួយ​ជា​ការ​រំលឹក​ដឹង, ត្រូវ​បាន​បង្កើត​ឡើង​ដើម្បី​ចង្អុល​បង្ហាញគោល​បំណង​នៃ​ការ​ប្រើប្រាស់​របស់​វា