Python and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Lua, etc
Moving from C to C++ - Structured to Object Oriented - a lesson for engineers
The C language formed a a logical base from which C++ - an object oriented language developed. One of the major reasons that it is indeed a logical
base is that C and its libraries include a number of elements though which you can write code which is essentially object oriented if you write with the correct design patterns - and adding C++ simply provides tools to make the patterns easier, to provide an environment which supports inheritance and polymorphism, and to enforce additional checks to limit you do running only sensible (correctly chosen) functions.
From last week's C and C++ course, [here]
is a C program written using the OO Paradigm.
Switching across to C++ ...
become object references
become object [members]
function calls with a pointer as first parameter
become method calls
and those are pretty direct conversions. I have also replaced printf
The comparative code in C++ is then [this]
Many people who have been 'brought up' on engineeing or structured languages find the whole OO thing a bit of a difficult concept at first, and by writing what's actually a rather good and well structured program in C, and then making changes like the ones above, is a neat way to show them how OO goes together, and the first very clear examples of how it really works. Neat - and very rewarding to teach; it's not an approach that's always needed on our C and C++ courses
since delegates backgrounds differ, but it's an approach I'll use if it's going to be the best way for the group I students I have.
(written 2015-03-28, updated 2015-03-29)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articlesC230 - C and C based languages - Revision of C 
C - why is slow to write and debug) but fast to run? - (2015-11-01) 
Preprocessor directives in C and C++ - what they mean - (2015-10-27)C231 - C and C based languages - Introduction to C++ 
Left shift operator on an output stream object - C++ - (2015-10-30) 
Hello World in C++ - a first program, with the process explained - (2015-10-30) 
C++ - how we teach the language and the concepts behind the language - (2011-04-17) 
Strings, Garbage Collection and Variable Scope in C++ - (2010-11-25) 
Make - automating the commands for building and installing - (2010-11-16) 
Getting your C++ program to run - (2010-11-15) 
Objects and Inheritance in C++ - an easy start - (2010-07-01) 
When should I use OO techniques? - (2009-05-11) 
Variable Scope in C++ - (2009-01-22) 
C++ and Perl - why did they do it THAT way? - (2006-11-16) 
Targetted Advertising - (2005-06-05) 
Choosing a theme - (2005-05-20) 
Programming languages - a comparison - (2005-05-20)
Some other Articles
Testing in Python 3 - unittest, doctest and __name__ == __main__ too.Sorting in Python 3 - and how it differs from Python 2 sortingFour in a Bed - most popular answersNeighbourhood Plan - travel and transport thoughtsMoving from C to C++ - Structured to Object Oriented - a lesson for engineersSockets, time handling and keyboard interrupt handling in CCatching up on a week all in a single post (?)Rail Conference, NottinghamServer program written in Tcl using socketsReading from a URL, and reading Json, from your Tcl script
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page
This is a page archived from The Horse's Mouth at
the diary and writings of Graham Ellis.
Every attempt was made to provide current information at the time the
page was written, but things do move forward in our business - new software
releases, price changes, new techniques. Please check back via
our main site for current courses,
prices, versions, etc - any mention of a price in "The Horse's Mouth"
cannot be taken as an offer to supply at that price.
Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).