Monday, July 19, 2010

stroustrup's c++ Ch2 A tour of c++

2 A Tour of C++
2.1 What is C++? [tour.intro]
2.2 Programming Paradigms [tour.paradigm]
2.3 Procedural Programming [tour.proc]
Curly braces, { }, express grouping in C++.
2.3.1 Variables and Arithmetic [tour.var]
A declaration is a statement that introduces a name into the program.
2.3.2 Tests and Loops [tour.loop]
2.3.3 Pointers and Arrays [tour.ptr]
In declarations, [] means ‘‘array of’’ and * means ‘‘pointer to.’’
Unary & is the address-of operator.
2.4 Modular Programming [tour.module]
A set of related procedures with the data they manipulate is often called a module.

C++ provides a mechanism for grouping related data, functions, etc., into separate namespaces

2.4.1 Separate Compilation [tour.comp].

2.4.2 Exception Handling [tour.except]
(page 39)
(page 40)

2.5 Data Abstraction [tour.da]
Modularity is a fundamental aspect of all successful large programs.

2.5.1 Modules Defining Types [tour.types]
Programming with modules leads to the centralization of all data of a type under the control of a
type manager module.

(p 41)

This is often less than ideal.

(p42)
2.5.2 User-Defined Types [tour.udt]
C++ attacks this problem by allowing a user to directly define types that behave in (nearly) the same way as built-in types.

Arithmetic types such as rational and complex numbers are common examples of user-defined types.

2.5.3 Concrete Types [tour.concrete]
(p43)
User-defined types can be designed to meet a wide variety of needs.
(p44)

Friday, July 16, 2010

stroustrup c++ preface and ch1

You can treat everything
(1) a product
(2) a friend

ch1-10 tutorial
ch11-13

Preface to the first edition
C++ is a general purpose programming language designed to make programming more enjoyable
for the serious programmer.

A programmer can partition an application into manageable pieces by defining new types that closely match the concepts of the application.

When used well, these techniques result in shorter, easier to understand, and easier to maintain programs.

Introduction
This introduction gives an overview of the major concepts and features of the C++ programming
language and its standard library.

Chapter 13 presents templates, that is, C++’s facilities for defining families of types and functions.

1.1.1 Examples and References [notes.examples]
1.1.2 Exercises [notes.exercises]
1.1.3 Implementation Note [notes.implementation]
1.2 Learning C++ [notes.learn]
1.3 The Design of C++ [notes.design]
1.3.1 Efficiency and Structure [notes.efficiency]
1.3.2 Philosophical Note [notes.philosophy]
1.4 Historical Note [notes.historical]
1.5 Use of C++ [notes.use]
1.6 C and C++ [notes.c]
1.6.1 Suggestions for C Programmers [notes.suggest]
1.6.2 Suggestions for C++ Programmers [notes.suggestions]
1.7 Thinking about Programming in C++
1.8 Advice [notes.advice]
To write a good program takes intelligence, taste, and patience.

If you can think of ‘‘it’’ as a separate idea, make it a class.

1.8.1 References [notes.ref]