|
Welcome to www.naturalprogramming.com! This site provides more than 850 examples of computer programs and gives information about Kari Laitinen's programming books. Please, click the following names of programming languages to enter the homepages of individual books |
|
|
|
|
|
|
|
|
This page is the Internet home of Kari Laitinen's textbooks
about computer programming. The page also supports his other activities
related to computer programming and software development.
If you would like to invite Mr. Laitinen to speak at your special event,
here are some interesting subjects.
Please, click the links at the beginning of the page.
The rest of this page may not be very well written since the
following words exist merely to remind me about how to
develop this Internet site in the future.
My textbooks of computer programming intend to present the best practices
in computer programming.
The books are suitable for self study. You can study at home with them,
and
teach yourself computer programming. The books can also be used
in all such educational institutions where an introductory course in
computer
programming is given. The books thus work in high school level, university
level,
college level, etc..
The books are written for people
who are beginners in the field of computer programming.
They might, though, give new ideas
for more experienced people as well.
The books are new kind of
programming books in which many obstacles for learning
have been eliminated through creative and non-traditional writing and
book design.
The textbooks are based on an excellent programming style and
a
very careful naming style which is referred to with the term
natural naming. This means in practice that the names used in the
example programs are long names made of the words of a natural language.
I use the term "name" in the books. In other books, the terms "symbol"
and
"identifier" are used to refer to names, and terms "identifier naming"
and
"symbol naming" can mean "naming". Names can also be called
"symbolic names", and long names can be called "long identifiers" or
"long symbols".
Natural naming means that abbreviations are considered harmful in
computer programs. An acronym is a special case of an abbreviation.
Therefore, also acronyms are considered harmful. Abbreviating
names in computer programs is thus discouraged in the book.
I have been writing my programs with natural names for more than
15 years. I think that naming is an important issue in computer programming,
but not all programmers share this opinion, and, therefore, I have
been a quite lonesome fellow with my ideas. The names in computer
programs have, however, been growing longer during the past
15 years, and that means that people have started to "implicitly"
realize the importance of naming. Still, my C++ book is the first programming
book
in which all programs are written with natural names and abbreviations
are explicitly banned. After these experiences it was quite nice
to read the document "C# Language Specification", a freely available
ECMA Standard number 334. That standard presents naming rules and
it explicitly says that "do not use abbreviations in names". So it
seems
that also the Microsoft guys are now realizing something that I have
been
saying for 15 years.
The terms "disabbreviation" and "disabbreviate" are related to
replacing abbreviated names with natural names in computer programs.
My books should be interesting for researchers who work in the fields
of psychology of computer programming and human factors
in software development.
These are subfields of software engineering research.
Even the researchers of natural languages and linguistics might be
interested.
Software documentation involves using a natural language. In my book
natural language is used so that confusing abbreviations are left out
from
the language. My opinion is that software project (programming project)
is
a kind of linguistic process during which software developers initiate
language development.
My books are also books about object oriented programming although
conventional programming is presented first. UML class diagrams are
explained to some extent and some basics about object oriented design
are discussed at the end of the books.
Extreme programming is a popular term these days. My books present
programs with extremely informative symbol names or
extremely understandable names. I have always been a supporter of
extremely careful program design and extreme software design.
My approach to programming is related to literate programming. That
is
discussed more thoroughly in my doctoral thesis. My programming approach
involves using meaningful variable names and naming rules, and
no
special tools are needed in this approach. Literate programming involves
using special tools. My approach could be called "Literate programming
without
the literate programming tools.
My books respects the rules of structured programming. goto statements
are considered harmful and not used in the book. I even consider
continue statement harmful, and break and return statements are used
sparingly.
I consider my programming books, at least to some extent, pieces
of art. They are more like pieces of art than other programming books
because
I have designed all the pages and drawn all the program descriptions.
The term "artistic programming" might, however, be too much ...
The books contain some programming style guidelines ...
The natural approach used in the books tries to make programming
easy although the slogan "programming made easy" might be a too
agressive term to describe the book. Programming is always a difficult
task,
but with the natural approach it can be made a less complex task.
My books are against complexity, and for simplicity. I hope that a
student
can learn quikly with my book, and a teacher, lecturer, or a professor
can find it pedagogically efficient.
The following table compares the three books.
The comments in the table cells explain how the three books and the
used programming languges
differ from each other. If a table cell does not contain any text,
it means that the chapter in question
like a corresponding chapter in the other books.
| Java | C# | C++ | |
| Chapter 1
COMPUTING: SOME CONCEPTS AND TERMINOLOGY hardware software operating system, main memory, mass memory, auxiliary memory devices source program, object program, and executable program application system program development |
|||
| Chapter 2
FIRST LOOK AT Java/C#/C++ SOURCE PROGRAMS This chapter introduces a couple of computer programs, and explains how programs are compiled and executed. Some free editor programs (e.g. Notepad2, EditPad Lite, and JFE Jens' File Editor) are discussed in the books or on the internet site. |
Instructions for downloading the Java 1.5 Software Development Kit which includes a free Java compiler. | Instructions for downloading the .NET Framework which includes a free C# compiler. | Instructions for downloading the free Borland C++ compiler |
| Chapter 3
HOW INFORMATION IS STORED IN THE MEMORY OF COMPUTERS? numerical information, numbering systems, the binary world of computer, textual information, the ASCII coding system, Unicode, encoding of pictures, sound, and moving pictures |
|||
| Chapter 4
LOGICAL OPERATING PRINCIPLES OF COMPUTERS How does the main memory operate? computer memory, main memory, components of an imaginary computer, inside the imaginary processor, machine instructions step and state of program execution ICOM simulated imaginary computer, program that contains a loop, subroutine call and stack operation, program that use keyboard, memory area, and stack towards high-level programming |
|||
| Chapter 5
VARIABLES AND OTHER BASIC ELEMENTS IN PROGRAMS integral variables (int, short, long, char), keyword, name, space, and newline, floating-point variable, operator, assignments, numerical constant, literal constant, operand, formatting the output on the screen |
The format specifiers used by the printf() and String.format() methods are explained. | The format specifiers of C# are explained. | The input/output manipulators of C++ are explained. |
| Chapter 6
DECISIONS AND REPETITIONS: BASIC ACTIVITIES IN PROGRAMS making decision with keywords if and else, decisions with switch-case construct, while loop enable repetition, for loop repeat known number of times, do-while loop execute at least once, block structure of programs, truth values |
The new "foreach" loop of Java is explained at the end of the chapter. | The foreach loop is explained at the end of the chapter. | |
| Chapter 7
ARRAYS : SETS OF SIMILAR DATA ITEMS declaring and creating arrays, referring to array elements, array positions, initialized multidimensional arrays |
In the C++ book, Chapter 7 introduces also C-style strings which are arrays of type char. The string functions strcmp, strcat, strcpy, etc., are also discussed. The string class of C++ is introduced in Chapter 15. | ||
| Chapter 8
STRINGS STORE SEQUENCES OF CHARACTER CODES In the Java and C# books, this chapter introduces the standard String and StringBuilder classes and string methods. |
In the C++ book, Chapter 8 introduces pointers. Because pointers are not used in the other languages, Chapter 8 is different in the other books. | ||
| Chapter 9
METHODS: LOGICAL PERFORMING UNITS IN PROGRAMS static methods, concept of calling, caller, callee, method parameters (arguments), return statement, role of stack in method calls, scope of variables, local variables, global variables, parameters for the main() / Main() method, overloading method names |
Java does not have output paramters. This chapter is thus simpler in the Java book. | The parameter modifiers out and ref are explained in this chapter. | In the C++ book, the term "function" is used in place of the term "method". C++ function prototypes are explained in this chapter. |
| Chapter 10
CLASSES AND OBJECTS class members, fields, instance methods, constructor (and destructor), creation of objects, several constructors in a class, array of objects, stack that grows dynamically. |
In the C++ book, Chapter 10 is entitled STRUCTURES AND FILES: LARGER PIECES OF DATA, and it does not correspond to any chapter in the other books. In the other books, file accessing is discussed in Chapter 14. | ||
| Chapter 11
MORE ADVANCED CLASSES This chapter introduces some large classes and applications. |
In the C# book, this chapter introduces also properties and indexers. | In the C++ book, Chapter 11 is entitled GOING CLOSER TO THE MACHINE and it thus corresponds to Chapter 16 in the other books. However, threads are not discussed in the C++ book. | |
| Chapter 12
INHERITANCE AND CLASS HIERARCHIES base class, derived class, superclass, subclass, parent class, child class, polymorphism, polymorphic method, public, private, protected, abstract class, early binding, late binding |
In the C# book, structs are introduced at the end of Chapter 12. | Chapter 12 in the C++ book corresponds to Chapter 10 in the other books. | |
| Chapter 13
This chapter introduces the Object class, exception classes, and some other important classes. Boxing and unboxing are discussed as well. |
Wrapper classes Integer, Short, Byte, Double, etc. | Standard structs Int32, Int16, Byte, Double, etc. | Chapter 13 in the C++ book corresponds to Chapter 11 in the other books. |
| Chapter 14
STORING INFORMATION IN FILES text files vs. binary files, reading files, writing files, appending data to a file, standard classes available to access files |
Chapter 14 in the C++ book corresponds to Chapter 12 in the other books. | ||
| Chapter 15
This chapter introduces more standard classes (e.g. ArrayList class) |
Classes Calendar and GregorianCalendar. Generics are discussed shortly. | C# DateTime struct | Chapter 15 (STANDARD C++ CLASSES) in the C++ book corresponds "loosely" to chapters 14 and 15 in the other books. |
| Chapter 16
GOING CLOSER TO THE MACHINE Bit operators &, |, ^, ~. >>, and <<; getting current time and date into a program; threads |
Java has the extra bit operator >>>. | In the C# book, delegates are discussed shortly as they are needed when threads are used. | Chapter 16 of the C++ book is entitled LARGE OBJECT-ORIENTED APPLICATIONS and the other books do not have a chapter that would correspond to to it. |
| Appendices
The appendices are logically "equivalent" in all books. |
SITE MAINTENANCE NOTES:
Where shall the latest version of index_for_ic8.html kept? At home!!!
A story with the title "Why we always want to write programs so quickly"
SITE HISTORY:
Page created: June 13, 2002
might be interesting.
Homepage for the C# book added: February 8, 2004
Link to the IC8 simulator was added August 25, 2004
Sample pages from the C# book were added December 11, 2004
Full chapters 3 and 4 from the C# book were added February 21, 2005
The source programs of the books were made freely available on March
19, 2005
Pages for the Java book added: March 2, 2006.
Python programs added: May 11, 2006.
Links to all example programs added: June 11, 2006. Those make roughly
750 programs.
On November 12, 2006, this site contains 100 new programs in directories
javagui, pythongtk, pythonmaemo, and javagui_in_finnish
March 10, 2007 : THIS PAGE MUST BE UPDATED WITH NOTEPAD2!!!!
2008-05-02 IC8 v1.1 is now available
Last modification: 2008-05-02 with NOTEPAD2
tontit.html