Software Coding
Chapter 5
Shristi Awale 1
Topic to be covered
► Programming Language
► Development Tools
► Selecting language and tool
► Good Programming practice
Shristi Awale 2
Programming Language
► As we know, to communicate with a person, we need a specific
language, similarly to communicate with computers, programmers also
need a language is called Programming language.
► A programming language is a computer language that is used
by programmers (developers) to communicate with computers. It
is a set of instructions written in any specific language ( C, C++, Java,
Python) to perform a specific task.
► Types:
► Low Level Programming language
► High Level Programming Language
Shristi Awale 3
Types of
Programming
Language
Low Level Middle Level High Level
Procedural
Machine Level Oriented
programming
language
Assembly Level
Object-Oriented
Programming
language
Natural language
4
Low-level programming language
► is machine-dependent (0s and 1s) programming language. The processor runs low- level programs
directly without the need of a compiler or interpreter, so the programs written in low-level language
can be run very fast.
► Low-level language is further divided into two parts -
i. Machine Language
► Machine language is a type of low-level programming language. It is also called as machine code or
object code. Machine language is easier to read because it is normally displayed in binary or
hexadecimal form (base 16) form. It does not require a translator to convert the programs because
computers directly understand the machine language programs.
► The advantage of machine language is that it helps the programmer to execute the programs faster
than the high-level programming language.
ii. Assembly Language
► Assembly language (ASM) is also a type of low-level programming language that is designed for
specific processors. It represents the set of instructions in a symbolic and human-understandable
form. It uses an assembler to convert the assembly language to machine language.
5
High-level programming language
► is designed for developing user-friendly software programs and websites. This programming
language requires a compiler or interpreter to translate the program into machine language
(execute the program).
► The main advantage of a high-level language is that it is easy to read, write, and maintain.
► High-level programming language includes Python, Java, JavaScript, PHP, C#, C++, Objective C,
Cobol, Perl, Pascal, LISP, FORTRAN, and Swift programming language.
► A high-level language is further divided into three parts –
i. Procedural Oriented programming language
ii. Object-Oriented Programming language
iii. Natural language
6
Middle-level programming language
► lies between the low-level programming language and high-level
programming language. It is also known as the intermediate
programming language and pseudo-language.
► A middle-level programming language's advantages are that it supports
the features of high-level programming, it is a user-friendly language,
and closely related to machine language and human language.
► Example: C, C++, language
7
Development tools
► Development tools can be of many forms like linkers, compilers, code editors,
GUI designer, assemblers, debugger, performance analysis tools etc. There are
certain factors to be considered while selecting the corresponding development
tool, based on the type of the project.
► Few of such factors include:
► Company standards
► Tool usefulness
► Tool integration with another tool
► Selecting an appropriate environment
► Learning curve
8
Selecting Programming language
► Front End Development: JavaScript, HTML, and CSS
► Backend Development: Python, C# or JavaScript
► 2D Game development: JavaScript or C#
► 3D Game Development: C# or C++
► Data Science/Machine Learning/Analytics: Python, R, Clojure, Julia
► Math & Scientific Computing: Matlab, FORTRAN, ALGOL, APL, Julia, R, C++
► Big Data: Java, Python, R, Scala, Clojure
► Operating Systems: C, C++
► Distributed System: C, Go, Rust
9
Code Standards
► coding standards as a set of rules, techniques, and best practices to
create cleaner, more readable, more efficient code with minimal errors.
► offer a uniform format by which software engineers can use to build
sophisticated and highly functional code.
► Enables the creation of reusable code.
► Makes it easier to detect errors.
► Make code simpler, more readable, and easier to maintain.
► Boost programmer efficiency and generates faster results.
10
Focus on code readability
► Write as few lines as possible.
► Use appropriate naming conventions.
► Segment blocks of code in the same section into paragraphs.
► Use indentation to marks the beginning and end of control structures. Clearly specify
the code between them.
► Don’t use lengthy functions. Ideally, a single function should carry out a single task.
► Use the DRY (Don’t Repeat Yourself) principle. Automate repetitive tasks whenever
necessary. The same piece of code should not be repeated in the script.
► Avoid Deep Nesting. Too many nesting levels make code harder to read and follow.
► Capitalize SQL special words and function names to distinguish them from table and
column names.
► Avoid long lines. It is easier for humans to read blocks of lines that are horizontally short
and vertically long.
11
Choose industry-specific coding
standards
► Coding best practices and standards vary depending on the industry a
specific product is being built for.
► For example, C and C++ were written for the automotive industry and
are considered the de-facto standards for building applications that
emphasize safety. Currently, they are regarded as the absolute best
practices for writing code in the industry.
► Adhering to industry-specific standards makes it easier to write
accurate code that matches product expectations. It becomes easier to
write code that will satisfy the end-users and meet business
requirements.
12
Standardize headers for different
modules
► It is easier to understand and maintain code when the headers of
different modules align with a singular format. For example, each
header should contain:
► Module Name
► Date of creation
► Name of creator of module
► History of modification
► Summary of what the module does
► Functions in that module
► Variables accessed by the module 13
Consistent Naming Scheme
► the names should have word boundaries. There are two popular
options:
► camelCase: The first letter of each word is capitalized, except the
first word, like parseRawImageData().
► underscores: Underscores between words, like
mysql_real_escape_string().
14
DRY Principle
► DRY stands for Don't Repeat Yourself. Also known as DIE: Duplication is
Evil.
► For example, most web applications consist of many pages. It's highly likely
that these pages will contain common elements. Headers and footers are
usually the best candidates for this. It's not a good idea to keep copying and
pasting these headers and footers into every page. Instead, put that header and
footer code in separate source files to be included wherever they are needed.
15
Some other good practices for coding
► Read Open-Source Code
► Turn daily backups into an instinct
► Leave comments and prioritize documentation
► Use Meaningful Names for Variables and Functions
► Consistent Indentation
► Avoid Deep Nesting
► Avoid writing horizontally long lines of code
► File and Folder Organization
► Capitalize SQL Special Words
16