0% found this document useful (0 votes)
16 views12 pages

Unit 4 Notes

Unit IV focuses on software implementation, emphasizing structured coding techniques, coding standards, and documentation guidelines. It outlines the advantages of structured programming, types of structured programming, and the importance of coding standards for maintainability and readability. Additionally, it discusses modern programming language features such as type checking and user-defined data types, highlighting their significance in enhancing software development efficiency.

Uploaded by

mallesrihari69
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views12 pages

Unit 4 Notes

Unit IV focuses on software implementation, emphasizing structured coding techniques, coding standards, and documentation guidelines. It outlines the advantages of structured programming, types of structured programming, and the importance of coding standards for maintainability and readability. Additionally, it discusses modern programming language features such as type checking and user-defined data types, highlighting their significance in enhancing software development efficiency.

Uploaded by

mallesrihari69
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

UNIT IV - SOFTWARE IMPLEMENTATION

Structured coding Techniques-Coding Styles-Standards and Guidelines- Documentation


Guidelines-Modern Programming Language Features: Type checking-User defined data
types-Data Abstraction-Exception Handling- Concurrency Mechanism.

Structured Coding Techniques

The use of structured coding techniques and styles supports the primary goal of implementation
to write quality source code and internal documentation that aid in easy verification with
specification, debugging testing and modification. The source code thus generated will be
simple, clear and elegant and less obscure, clever and complex.

The structured program consists of well structured and separated modules. But the entry and exit
in a Structured program is a single-time event. It means that the program uses single-entry and
single-exit elements. Therefore a structured program is well maintained, neat and clean program.
This is the reason why the Structured Programming Approach is well accepted in the
programming world.

Advantages of Structured Programming Approach:


1.​ Easier to read and understand
2.​ User Friendly
3.​ Easier to Maintain
4.​ Mainly problem based instead of being machine based
5.​ Development is easier as it requires less effort and time
6.​ Easier to Debug
7.​ Machine-Independent, mostly.
Types of structured programming
There are three categories of structured programming:

1.​ Procedural programming. Defines modules as procedures or functions that are called with
a set of parameters to perform a task. A procedural language begins a process, which is then
given data. It is also the most common category and is subdivided into the following:

a.​ Service-oriented programming simply defines reusable modules as services with


advertised interfaces.

b.​ Microservice programming focuses on creating modules that do not store data
internally and so are scalable and resilient in cloud deployment.

c.​ Functional programming, technically, means that modules are written from functions,
and that these functions' outputs are derived only from their inputs. Designed for
serverless computing, the definition of functional programming has since expanded to
be largely synonymous with microservices.

2.​ Object-oriented programming (OOP). Defines a program as a set of objects or


resources to which commands are sent. An object-oriented language defines a data
resource and sends it to process commands. For example, the procedural programmer might
say, "Print(object)," while the OOP programmer might say, "Tell Object to Print."
3.​ Model-based programming. The most common example of this is
database query languages. In database programming, units of code are associated with steps
in database access and update or run when those steps occur. The database and database
access structure determine the structure of the code. Another example of a model-based
structure is Reverse Polish notation, a math-problem structure that lends itself to efficient
solving of complex expressions. Quantum computing is another example of model-based
structured programming; the quantum computer demands a specific model to organize steps,
and the language simply provides it.

Coding Styles-Standards and Guidelines

What is Coding Standards and Guidelines?


Good software development organizations want their programmers to maintain to some
well-defined and standard style of coding called coding standards. They usually make their own
coding standards and guidelines depending on what suits their organization best and based on the
types of software they develop. It is very important for the programmers to maintain the coding
standards otherwise the code will be rejected during code review.

Purpose of Having Coding Standards


The following are the purpose of having Coding Standards:
●​ A coding standard gives a uniform appearance to the codes written by different engineers.
●​ It improves readability, and maintainability of the code and it reduces complexity also.
●​ It helps in code reuse and helps to detect errors easily.
●​ It promotes sound programming practices and increases the efficiency of the programmers.

Coding Standards in Software Engineering


Some of the coding standards are given below:
1.​ Limited use of globals: These rules tell about which types of data that can be declared
global and the data that can’t be.

2.​ Standard headers for different modules: For better understanding and maintenance of the
code, the header of different modules should follow some standard format and information.
The header format must contain below things that is being used in various companies:
●​ Name of the module
●​ Date of module creation
●​ Author of the module
●​ Modification history
●​ Synopsis of the module about what the module does
●​ Different functions supported in the module along with their input output parameters
●​ Global variables accessed or modified by the module

3.​ Naming conventions for local variables, global variables, constants and functions: Some
of the naming conventions are given below:
●​ Meaningful and understandable variables name helps anyone to understand the reason of
using it.
●​ Local variables should be named using camel case lettering starting with small letter
(e.g. localData) whereas Global variables names should start with a capital letter
(e.g. GlobalData). Constant names should be formed using capital letters only
(e.g. CONSDATA).
●​ It is better to avoid the use of digits in variable names.
●​ The names of the function should be written in camel case starting with small letters.
●​ The name of the function must describe the reason of using the function clearly and
briefly.

4.​ Indentation: Proper indentation is very important to increase the readability of the code.
For making the code readable, programmers should use White spaces properly. Some of the
spacing conventions are given below:
●​ There must be a space after giving a comma between two function arguments.
●​ Each nested block should be properly indented and spaced.
●​ Proper Indentation should be there at the beginning and at the end of each block in the
program.
●​ All braces should start from a new line and the code following the end of braces also
start from a new line.
5.​ Error return values and exception handling conventions: All functions that encountering
an error condition should either return a 0 or 1 for simplifying the debugging.

Coding Guidelines in Software Engineering

Coding guidelines give some general suggestions regarding the coding style that to be followed
for the betterment of understandability and readability of the code.
Some of the coding guidelines are given below :
1.​ Avoid using a coding style that is too difficult to understand: Code should be easily
understandable. The complex code makes maintenance and debugging difficult and
expensive.
2.​ Avoid using an identifier for multiple purposes: Each variable should be given a
descriptive and meaningful name indicating the reason behind using it. This is not possible if
an identifier is used for multiple purposes and thus it can lead to confusion to the reader.
Moreover, it leads to more difficulty during future enhancements.

3.​ Code should be well documented: The code should be properly commented for
understanding easily. Comments regarding the statements increase the understandability of
the code.

4.​ Length of functions should not be very large: Lengthy functions are very difficult to
understand. That’s why functions should be small enough to carry out small work and
lengthy functions should be broken into small ones for completing small tasks

5.​ Try not to use GOTO statement: GOTO statement makes the program unstructured, thus it
reduces the understandability of the program and also debugging becomes difficult.

Advantages of Coding Guidelines


1.​ Coding guidelines increase the efficiency of the software and reduces the development time.
2.​ Coding guidelines help in detecting errors in the early phases, so it helps to reduce the extra
cost incurred by the software project.
3.​ If coding guidelines are maintained properly, then the software code increases readability
and understandability thus it reduces the complexity of the code.
4.​ It reduces the hidden cost for developing the software.

Documentation Guidelines
Software documentation is a written piece of text that is often accompanied by a software
program. This makes the life of all the members associated with the project easier. It may
contain anything from API documentation, build notes or just help content. It is a very critical
process in software development. It’s primarily an integral part of any computer code
development method. Moreover, computer code practitioners are a unit typically concerned with
the worth, degree of usage, and quality of the actual documentation throughout the development
and its maintenance throughout the total method. Motivated by the requirements of Novatel
opposition, a world-leading company developing package in support of worldwide navigation
satellite system, and based mostly on the results of a former systematic mapping studies area
unit aimed at a higher understanding of the usage and therefore the quality of varied technical
documents throughout computer code development and their maintenance.

Types Of Software Documentation:


1.​ Requirement Documentation: It is the description of how the software shall perform and
which environment setup would be appropriate to have the best out of it. These are generated
while the software is under development and is supplied to the tester groups too.
2.​ Architectural Documentation: Architecture documentation is a special type of
documentation that concerns the design. It contains very little code and is more focused on
the components of the system, their roles, and working. It also shows the data flow
throughout the system.
3.​ Technical Documentation: These contain the technical aspects of the software like API,
algorithms, etc. It is prepared mostly for software devs.
4.​ End-user Documentation: As the name suggests these are made for the end user. It contains
support resources for the end user.

Purpose of Documentation:
Due to the growing importance of computer code necessities, the method of crucial them needs
to be effective to notice desired results. As to such determination of necessities is often beneath
sure regulation and pointers that area unit core in getting a given goal.
These all imply that computer code necessities area unit expected to alter thanks to the ever
ever-changing technology within the world. However, the very fact that computer code
information I’d obtained through development has to be modified within the wants of users and
the transformation of the atmosphere area unit is inevitable.

Principles of Software Documentation:

While writing or contributing into any software documentation, one must keep in mind the
following set of 7-principles :

1. Write from reader’s point of view:


It’s important to keep in mind the targeted audience that will be learning, and working through
the software’s documentation to understand and implement the fully functional robust software
application and even the ones who will be learning for the purpose of using the software. So,
while writing a documentation it becomes very crucial to use the simplest language & domain
related specific languages and terminologies. The structure of the documentation should be
organized in a clearly viewable, navigable and understandable format.

●​ If there’s a lot of content, you can organize it in the glossary part at the end of the document.
●​ List down synonyms, antonyms and difficult terminologies used.

2. Avoid unnecessary repetition:


While the idea of hyperlinking and backlinking may seem redundant at the moment, but
it aids in avoiding the need of redundancy. The back-end database stores every piece of
information as an individual unit and displays it in various different variety of context so
redundancy at any point will not be maintainable and is considered a bad practice.

3. Avoid ambiguity:
Documentation contains a lot of information regarding the versatile functionalities of the
software system, every part of it must be written with clear and precise knowledge while
avoiding any conflicting information that might cause confusion to the reader. For example, if
one terminology is used in different set of context than it must be explicitly defined what it
means so to avoid any miscommunication. This aspect of the software documentation is very
important to avoid any kind of conflicting knowledge between the stakeholders, developers and
the maintainers.

4. Follow a certain standard organization:


In order to maintain the professionalism, accuracy, and precision of the document a
certain set of principles must be followed taking reference from other software documentations
that would aid in organizing and structuring the content of the documentation in a much
productive and organized way.

5. Record a Rationale
Rationale contains a comprehensive understanding of why a certain design or
development decision was made. This part of our documentation is written & maintained by the
developer or the designer itself for justification and verification for later needs. Rationale can be
mentioned in the start or the end of the document although typically, it’s in the start of the
document.

6. Keep the documentation updated but to an extent


This principle applies to the maintainers of the documentation of the software, because
updates are made to the software on frequent intervals. The updates may contain some bug fixes,
new feature addition or previous functionality maintenance. The maintainer of the documentation
must only add the valuable content and avoid anything that doesn’t fit and irrelevant for that
particular time.

7. Review documentation
The documentation consists of too many web-pages collectively holding a large chunk of
information that’s serving a sole purpose – educate and spread knowledge to anyone who is
trying to understand or implement the software. While working with a lot of information it is
important ta take feedback from senior architects and make any necessary changes aligning the
documentation with its sole purpose depending on the type of documentation.

Advantages of software documentation

●​ The presence of documentation helps in keeping the track of all aspects of an application and
also improves the quality of the software product.
●​ The main focus is based on the development, maintenance, and knowledge transfer to other
developers.
●​ Helps development teams during development.
●​ Helps end-users in using the product.
●​ Improves overall quality of software product
●​ It cuts down duplicative work.
●​ Makes easier to understand code.
●​ Helps in establishing internal coordination in work.

MODERN PROGRAMMING
LANGUAGE FEATURES

TYPE CHECKING
Dynamic Typing:
In Dynamic Typing, type checking is performed at runtime. For example, Python is a
dynamically typed language. It means that the type of a variable is allowed to change over
its lifetime. Other dynamically typed languages are -Perl, Ruby, PHP, Javascript etc.
Static Typing:
Static Typing is opposite to Dynamic Typing. In Static Typing, type checking is performed
during compile time. It means that the type of a variable is known at compile time. For some
languages, the programmer must specify what type each variable is (e.g C, C++, Java), other
languages offer some form of type inference(e.g. Scala, Haskell).
With Static Typing, variables generally are not allowed to change types.
USER DEFINED DATA TYPE
A user-defined data type (UDT) is a data type that derived from an existing data
type. You can use UDTs to extend the built-in types already available and create
your own customized data types.
There are six user-defined types:
• Distinct type
• Structured type
• Reference type
• Array type
• Row type
• Cursor type

Modern Programming Language

Modern programming languages have evolved significantly over the last few decades, driven by
advancements in computing, the rise of complex software systems, and the need for more
efficient and maintainable code. These languages are designed to improve productivity, enhance
performance, ensure security, and provide greater flexibility in solving contemporary software
development challenges.

Characteristics of Modern Programming Languages


●​ Multifaceted Paradigms
●​ Emphasis on Safety and Efficiency
●​ Developer Productivity
●​ Concurrency and Performance
●​ Interoperability
●​ Tooling and Ecosystem

Modern Programming Language Features


MODERN PROGRAMMING
LANGUAGE FEATURES

TYPE CHECKING
Dynamic Typing:
In Dynamic Typing, type checking is performed at runtime. For example, Python is a
dynamically typed language. It means that the type of a variable is allowed to change over
its lifetime. Other dynamically typed languages are -Perl, Ruby, PHP, Javascript etc.
Static Typing:
Static Typing is opposite to Dynamic Typing. In Static Typing, type checking is performed
during compile time. It means that the type of a variable is known at compile time. For some
languages, the programmer must specify what type each variable is (e.g C, C++, Java), other
languages offer some form of type inference(e.g. Scala, Haskell).
With Static Typing, variables generally are not allowed to change types.
USER DEFINED DATA TYPE
A user-defined data type (UDT) is a data type that derived from an existing data
type. You can use UDTs to extend the built-in types already available and create
your own customized data types.
There are six user-defined types:
• Distinct type
• Structured type
• Reference type
• Array type
• Row type
• Cursor type

Distinct type
• Structured type
• Reference type
• Array type
• Row type
• Cursor ty

1. Type Checking

Type checking refers to verifying that the data types of variables and expressions are used
consistently and correctly in a program.

●​ Static Type Checking:


o​ Types are checked at compile time.
o​ Prevents type-related errors before the program runs (e.g., C++, Java, Rust).
o​ Enhances performance since the type is known beforehand, reducing runtime
overhead.
●​ Dynamic Type Checking:
o​ Types are checked at runtime (e.g., Python, JavaScript).
o​ Offers flexibility by allowing types to change at runtime, but can lead to runtime
errors if types are misused.
●​ Type Inference:
o​ The compiler deduces the type automatically, making the code less verbose (e.g.,
Swift, Kotlin, TypeScript).
●​ Strong vs Weak Typing:
o​ Strong Typing: Enforces strict rules about type conversion (e.g., Python, Java).
o​ Weak Typing: Allows implicit type conversions (e.g., JavaScript, PHP).

2. User-Defined Data Types

User-defined data types allow programmers to create custom data types tailored to the needs of
the program, enhancing clarity and maintainability.

●​ Structs (Records):
o​ Composite data types that group different types together (e.g., C's struct, Rust's
struct).
●​ Classes (Objects):
o​ Defines data along with functions (methods) for manipulating that data (e.g., Java,
Python).
o​ Supports object-oriented programming with concepts like inheritance,
encapsulation, and polymorphism.
●​ Enumerations (Enums):
o​ A type that defines a set of named values, often used to represent distinct states or
categories (e.g., Swift, Rust, C++ enum).
●​ Unions and Variants:
o​ A data type that can store different types at different times (e.g., Rust's enum
allows sum types).

3. Data Abstraction

Data abstraction hides the implementation details of data, exposing only the necessary interfaces,
making the system easier to understand and use.

●​ Abstract Data Types (ADTs):


o​ Types that define operations without specifying internal implementation (e.g.,
stack, queue).
o​ Can be implemented in any way as long as they provide the required operations.
●​ Encapsulation:
o​ Bundles data (fields) and the operations (methods) that modify them into a single
unit (class).
o​ Access control (public, private, protected) is often used to enforce abstraction
(e.g., Java, C++, Python).
●​ Interfaces and Protocols:
o​ Define abstract methods that must be implemented by classes or structures (e.g.,
Java interfaces, Swift protocols).
o​ Promotes loose coupling and flexible system design.
4. Exception Handling

Exception handling provides a way to manage and respond to runtime errors gracefully without
crashing the program.

●​ Try-Catch Blocks:
o​ A common mechanism where code that might throw an error is wrapped in a try
block, and errors are caught and handled in the catch (or except) block (e.g., Java,
Python, C++).
●​ Throwing Exceptions:
o​ If a function cannot complete its task, it can "throw" an exception to signal the
error (e.g., throw keyword in C++, Java, Swift).
●​ Checked and Unchecked Exceptions:
o​ Checked Exceptions: Must be explicitly handled or declared (e.g., Java’s I/O
operations).
o​ Unchecked Exceptions: Do not require explicit handling, often indicating
programming errors (e.g., NullPointerException in Java).
●​ Finally Block:
o​ Executes code after try-catch regardless of whether an exception occurred, often
used for resource cleanup (e.g., file closing, memory release).

5. Concurrency Mechanism

Concurrency allows multiple computations to occur simultaneously, enhancing the performance


of a program, especially on multicore systems.

●​ Threads:
o​ Lightweight units of execution that run concurrently within a process (e.g., Java
Thread, Python threading).
o​ Multithreading: Running multiple threads concurrently for parallelism.
●​ Coroutines:
o​ A more efficient form of concurrency, allowing cooperative multitasking.
Coroutines can pause and resume execution, used in languages like Python,
Kotlin, and JavaScript (async/await).
●​ Asynchronous Programming:
o​ Uses async and await to write non-blocking code. Tasks can run in the
background without interrupting the main thread (e.g., JavaScript, Python, C#).
●​ Locks and Semaphores:
o​ Synchronization tools used to prevent race conditions and ensure thread safety
when accessing shared resources.
●​ Message Passing:
o​ Avoids direct shared memory access by using messages to communicate between
concurrent units (e.g., Go’s Goroutines and channels).
●​ Actors Model:
o​ Treats "actors" as fundamental units of concurrency. Each actor can send and
receive messages without sharing state (e.g., Akka in Scala).

You might also like