Nothing Special   »   [go: up one dir, main page]

Week4

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 25

Key Construction

Decisions
Contents
• Introduction
• Choice of Programming Language
• Programming Conventions
• Selection of Major Construction Practices
• Key Points
Introduction
• After ensuring that an appropriate groundwork
has been laid for construction, preparation
turns toward more construction-specific
decisions.
• This lecture focuses on preparations that
individual programmers and technical leads are
responsible for, directly or indirectly.
• It discusses the software equivalent of how to
select specific tools from your tool belt.
Choice of Programming Language
• The programming language in which the system will be
implemented should be of great interest to the programmers since
they will be immersed in it from the beginning of construction to
the end.
• Studies have shown that the programming-language choice affects
productivity and code quality in several ways.
• Programmers are more productive using a familiar language than
an unfamiliar one.
• Data from the Cocomo II estimation model shows that
programmers working in a language they’ve used for three years
or more are about 30 percent more productive than programmers
with equivalent experience who are new to a language.
Choice of Programming Language
• Programmers working with high-level
languages achieve better productivity and
quality than those working with lower-level
languages.
• Languages such as C++, Java, Smalltalk, and
Python have been credited with improving
productivity, reliability, simplicity, and clarity
by factors of 5 to 15 over low-level languages
such as assembly and C.
Choice of Programming Language
• Some languages are better at expressing programming
concepts than others.
• An analogy can be created between natural languages such as
English and programming languages such as Java and C++.
• In the case of natural languages, the linguists Sapir and Whorf
hypothesize a relationship between the expressive power of a
language and the ability to think certain thoughts.
• The Sapir-Whorf hypothesis says that your ability to think a
thought depends on knowing words capable of expressing the
thought.
Choice of Programming Language
• If you don’t know the words, you can’t express the
thought and you might not even be able to formulate it.
• Programmers may be similarly influenced by their
languages.
• The words available in a programming language for
expressing your programming thoughts certainly
determine how you express your thoughts and might
even determine what thoughts you can express.
• Following slides provide the descriptions of the some
common languages.
Choice of Programming Language
Assembly Language:
– Assembly language is a kind of low-level language
in which each statement corresponds to a single
machine instruction.
– Because the statements use specific machine
instructions, an assembly language is specific to a
particular processor for example, specific Intel or
Motorola CPUs.
Choice of Programming Language
C:
– C is a general-purpose, mid-level language that was
originally associated with the UNIX operating system.
– C has some high-level language features, such as
structured data, structured control flow, machine
independence, and a rich set of operators.
– It has also been called a “portable assembly
language” because it makes extensive use of pointers
and addresses, has some low-level constructs such as
bit manipulation, and is weakly typed.
Choice of Programming Language
C++:
– C++, an object-oriented language founded on C,
was developed at Bell Laboratories in the 1980s.
– In addition to being compatible with C, C++
provides classes, polymorphism, exception
handling, templates, and it provides more robust
type checking than C does.
– It also provides an extensive and powerful
standard library.
Choice of Programming Language
C#:
– C# is a general-purpose, object-oriented language
and programming environment developed by
Microsoft with syntax similar to C, C++, and Java.
– It provides extensive tools that aid development
on Microsoft platforms.
Choice of Programming Language
Cobol:
– Cobol is an English-like programming language that
was originally developed in 1959–1961 for use by the
Department of Defense.
– The acronym “Cobol” stands for COmmon Business-
Oriented Language.
– Cobol is used primarily for business applications.
– Cobol has been updated over the years to include
mathematical functions and object-oriented
capabilities.
Choice of Programming Language
Fortran:
– Fortran was the first high-level computer language,
introducing the ideas of variables and high-level loops.
– “Fortran” stands for FORmula TRANslation.
– Fortran was originally developed in the 1950s and has seen
several significant revisions, including Fortran 77 in 1977,
which added block-structured if-then-else statements and
character string manipulations.
– Fortran 90 added user-defined data types, pointers,
classes, and a rich set of operations on arrays. Fortran is
used mainly in scientific and engineering applications.
Choice of Programming Language
Java:
– Java is an object-oriented language with syntax
similar to C and C++ that was developed by Sun
Microsystems, Inc.
– Java was designed to run on any platform by
converting Java source code to byte code, which is
then run in each platform within an environment
known as a virtual machine.
– Java is in widespread use for programming Web
applications.
Choice of Programming Language
JavaScript:
– JavaScript is a scripting language that was
originally loosely related to Java.
– It is used primarily for client-side programming
such as adding simple functions and online
applications to Web pages.
Choice of Programming Language
PHP:
– PHP is an open-source scripting language with a
simple syntax similar to Perl, JavaScript, and C.
– PHP runs on all major operating systems to
execute server side interactive functions.
– It can be embedded in Web pages to access and
present database information. The acronym “PHP”
originally stood for Personal Home Page but now
stands for PHP: Hypertext Processor.
Choice of Programming Language
Python:
– Python is an interpreted, interactive, object-
oriented language that runs in numerous
environments.
– It is used most commonly for writing scripts and
small Web applications and also contains some
support for creating larger programs.
Choice of Programming Language
SQL:
– SQL is the standard language for querying,
updating, and managing relational databases.
– “SQL” stands for Structured Query Language.
– Unlike other languages listed in this section, SQL is
a “declarative language,” meaning that it does not
define a sequence of operations, but rather the
result of some operations.
Programming Conventions
• In high-quality software, you can see a relationship
between the conceptual integrity of the
architecture and its low-level implementation.
• The implementation must be consistent with the
architecture that guides it and consistent internally.
• That’s the point of construction guidelines for
variable names, class names, routine names,
formatting conventions, and commenting
conventions.
Programming Conventions
• In a complex program, architectural guidelines give
the program structural balance and construction
guidelines provide low-level harmony.
• Any large program requires a controlling structure
that unifies its programming-language details.
• Without a unifying discipline, your creation will be a
jumble of sloppy variations in style and your brain
will have to put a lot of effort only for the sake of
understanding coding style differences.
Programming Conventions
• Before construction begins, spell out the
programming conventions you’ll use.
• Coding convention details are at such a level
of precision that they’re nearly impossible to
back fit into software after it’s written.
Selection of Major construction practices

• Part of preparing for construction is deciding which of


the many available good practices you’ll emphasize.
• Some projects use pair programming and test-first
development, while others use solo development and
formal inspections.
• Either combination of techniques can work well,
depending on specific circumstances of the project.
• The checklist (Pg. # 69, 70) summarizes the specific
practices you should consciously decide to include or
exclude during construction.
Key Points
• Every programming language has strengths and
weaknesses. Be aware of the specific strengths
and weaknesses of the language you’re using.
• Establish programming conventions before you
begin programming. It’s nearly impossible to
change code to match them later.
• More construction practices exist than you can
use on any single project. Consciously choose the
practices that are best suited to your project.
Key Points
• Ask yourself whether the programming practices
you’re using are a response to the programming
language you’re using or controlled by it.
Remember to program into the language, rather
than programming in it.
• Your position on the technology wave determines
what approaches will be effective or even possible.
Identify where you are on the technology wave,
and adjust your plans and expectations accordingly.
Readings
• [Chapter 4] Code Complete: A Practical
Handbook of Software Construction by Steve
McConnell, Microsoft Press; 2nd Edition (July
7, 2004). ISBN-10: 0735619670

You might also like