You are on page 1of 21

Smart Programming Techniques

www.emiprotechnologies.com
What is programming language?

● A language is used to create programs for management


and communications of machines or computers.

● A programming language is a formal computer


language designed to communicate instructions to a
machine or particularly a computer.
What is the use of it?

● Programs are created through programming languages


to manage and control the behavior and output of a
machine or computer through accurate commands and
algorithms, similar to the human communication
process.

● Programming languages can be used to create


programs to control the behavior of a machine.
Similar like Human Languages

What are the similarities?

Have you any Ideas?


Similar like Human Languages

● Keywords

● Keywords in programming Language


○ class, return, default, switch, struct, continue, etc...

● Keywords in English Language


○ I, am, is, are, this, that, etc...
Similar like Human Languages

● Constants or Literals

● Constants in programming Language


○ “XYZ”, 10.25, 56, ‘A’, False, etc...

● Constants in English Language


○ XYZ, 54.56, 28, A, Yes, etc...
Similar like Human Languages

● Operators

● Operators in programming Language


○ +, -, &&, %, ++, <, >=, =, +=, etc...

● Operators in English Language


○ +, *, OR, <, >, etc...
Similar like Human Languages

● Data Types

● Data Types in programming Language


○ int, float, string, char, class, etc...

● Data Types in English Language


○ number, date, decimal, string, etc...
Similar like Human Languages

● Syntax
● Syntax in programming Language
○ If (condition){
statements
}
● Grammar in English Language
○ subject verb direct object indirect object
Programming as a career option

● Programming is one of the most fundamental skill any


IT student must learn.
● Based on that one can apply for the job of programmer.
● In current IT environment, Programming as a career
option has tremendous opportunities.
● For that you have to be prepare yourself.
● A lot of graduates aim to become a programmer but not
everyone succeeds to make a good career in
programming.
Why Smart Programming Techniques?

● While the demand for programmers still remain very


high and lot of graduates apply for programming jobs,
only a few are actually appropriately skilled to become
programmers.
● There are lot of programmers in IT industry, but only a
few GOOD programmers.
● To fill the gap for such good programmers we have to
learn smart programming techniques. It will make you
an exceptional programmer and not just some ordinary
average coder.
Smart Programming Techniques

What makes you an exceptional programmer?

Any guesses ?
Smart Programming Techniques

● Consistent Formatting or Style


● “Programs are meant to be read by humans and only
incidentally for computers to execute.”
● The quality of your code is not just in its execution but
also in its appearance.
● Coding style is made up of numerous small decisions
based on the language.
● Consistent formatting is how your code looks, plain and
simple to understand.
Smart Programming Techniques

● Conventions and Comment/Document


● Coding conventions are a set of guidelines for a
programming language that recommend programming
style, practices, and methods for each aspect of a
program written in that language.
● These conventions usually cover file organization,
indentation, comments, declarations, statements,
whitespace, naming conventions, programming
practices, programming principles, programming rules
of thumb, architectural best practices, etc.
Smart Programming Techniques

● Conventions and Comment/Document


● There will always be a time in which you have to return
to your code. Regardless, looking at your own code
after six months is almost as bad as looking at someone
else's code. To avoid such things you have to leave
comments inside your code.
● Comments are little snippets of text embedded inside
your code for leaving information about your code that
are ignored by the compiler or interpreter.
Smart Programming Techniques

● Efficient and Error Prone


● Efficient programming is programming in a manner
that, when the program is executed, uses a low amount
of overall resources pertaining to computer hardware.
● A program is designed by a human being, and different
human beings may use different sequences of codes to
perform particular tasks.
● If an exception is raised, which has not been handled by
programmer then program execution can get
terminated and system prints a non user friendly error
message.
Smart Programming Techniques

● Efficient and Error Prone


● if ( "red".equals(color) || "green".equals(color) ||
"blue".equals(color) ) {
System.out.println("This is a primary color");
}
● if ( "red|green|blue".indexOf(color)>=0 ) {
System.out.println("This is a primary color");
}
● Always use exception handling technique to manage
all possible errors and exceptions.
○ try-catch, try-except etc.
Smart Programming Techniques

● Reusable and Extensible


● Try to think more abstractly and use Interfaces and
Abstract classes.
● Try to reduce coupling.
● Make a method that do just one thing. Be more
modular.
● Write code like your code is an External API.
● Always return something from your method. It helps to
make it extensible.
● Always use default arguments inside your method
when data of those arguments are not fixed.
Smart Programming Techniques

● Maintainable
● Maintainability involves a system of continuous
improvement - learning from the past in order to
improve the ability to maintain systems, or improve
reliability of systems based on maintenance experience.
● Maintainability index is calculated with the certain
formula from line of codes.
Thank You
www.emiprotechnologies.com

You might also like