Industrial Perspective in Java Programming CSV0652T - Unit - 1 - Part - I - Raw
Industrial Perspective in Java Programming CSV0652T - Unit - 1 - Part - I - Raw
Programming
COURSE CODE : CSV0652T
UNIT I
PART-I
INSTRUCTOR:
DR. NIRANJAN LAL @ SRM IST, DELHI NCR CAMPUS
[email protected] (personal)
[email protected] (professional)
http://cooltechie.in/
Java Best Practices
• In computer programming, best practices are a
set of informal rules that many developers follow
to improve software quality, readability, and
maintainability.
• Best practices are especially beneficial where an
application remains in use for long periods of
time, so that it was initially developed by one
team and then subsequently maintained by a
different group of people.
Java Programming Best
Practices at a Glance
Use Proper Naming Conventions
Class Members Should be Private
Use Underscores in lengthy Numeric Literals
Avoid empty catch Blocks
Use StringBuilder or StringBuffer for String Concatenation
Avoid Redundant Initializations
Using enhanced for loops instead of for loops with a counter
Proper handling of Null Pointer Exceptions
Java Programming Best
Practices at a Glance
Use Proper Naming Conventions
Class Members Should be Private
Use Underscores in lengthy Numeric
Literals
Avoid empty catch Blocks
Use StringBuilder or StringBuffer
for String Concatenation Snake Case: Python, Ruby, JavaScript
(variable and function names)
Avoid Redundant Initializations
Camel Case: Go, JavaScript, Java, C#
Using enhanced for loops instead (variable and function names)
of for loops with a counter Pascal Case: Go, C#, Java, TypeScript (class
Proper handling of Null Pointer and type names)
Exceptions Kebab Case: HTML, CSS (class names, file
names, and URLs)
Java Programming Best
Practices at a Glance
Access Modifiers in Java-The access modifiers
Use Proper Naming Conventions in Java specify the accessibility or scope of a
Class Members Should be Private field, method, constructor, or class.
Use Underscores in lengthy Numeric
Literals
Avoid empty catch Blocks
Use StringBuilder or StringBuffer
for String Concatenation
Avoid Redundant Initializations
Using enhanced for loops instead
of for loops with a counter
Proper handling of Null Pointer
Exceptions
int minUploadSize = 05_437_326; long debitBalance = 5_000_000_000_000_000L; float pi = 3.141_592_653_589F;
https://stratoflow.com/java-best-practices/
https://www.developer.com/languages/javascript/java-best-
practices/