Professional Documents
Culture Documents
FOREWORD
C & C++ Re-lit.
C is important because it deliberately adopted a less is more approach believing
that the intellect of the programmer was the final authority on program design.
This is not to say people are incapable of making mistakes (they will do that in
any Computer language anyway). In many ways at this simple level the
program becomes its own *Contract* with the system in that taking a simple
approach it becomes *self documenting* this entire idea was encapsulated in 'C'
programming circles with the "Trust the Code" philosophy (and not the
comments). Furthermore it was a language that was designed with a particular
job in mind, much like Fortran for the Physicists or Algol/K for the Symbolists,
then C was designed to facilitate ease of programming a system close to the
actual hardware (a reality of making any computing machinery work) and has
features that make that easy in the same way that Fortran allows some
Mathematical Physics easier to do. Some people might refer to C as a system
assembler on steroids and it certainly has something of that about it, that is,
having very little proscription on how to interact with machine hardware.
In modern times it has gained more traction with NVIDIA's adoption of C and
indeed C++ as their main development language for their CUDA HPC paradigm
and the many variants that have followed on such as OpenCL.
C++
Now with the recent post CUDA/GPU interest C++ has gained a resurgence. A
lot of new work has ironed out the problems of old and made C++ in modern
times (2015-2020) a serious proposition as an extremely powerful and
competent language. It has stayed true to its compile to true machine code
approach which in the times of C#, Java and PHP the traditional de-facto 'brand-
new for the internet' languages make C/C++ as the language with an
unwavering record of true scalability. From very small microcontroller projects
to the enterprise cloud and I draw attention to facebook having to back out from
their reliance on native PHP as proof.
Unfortunately a lot of C++ reading material can be both Prosaic (too much
verbage taking an age to make a point) and Mosaic (one fractured piece that's
lost in translation among a giant jigsaw of a language). These styles are
unfortunately probably a requirement of modern book publishers. My book, as
you will see, is written for professional developers and not professional book
readers.
This book is deliberately kept short at under 200 pages. As long established in
software development I have seen programming language books go from 250
pages to 1200 pages long. If you already know how to write what is considered
good code because you've been doing that in industry for a few years then you
just need to know the ins and outs of how to do the same using modern C++.
Uniquely (at 200 pages) this book attempts to take you quickly and purposely
through C and C++17 avoiding so much of the drek you are forced to wade
through in other books. This approach also makes the book ideal for anyone
setting out to learn the language.
Once you have gone through this book you should feel very confident and
quickly get to doing any C++ task. At this stage I would quickly move to doing
some C++ developments. If you are a student then set yourself a few serious
model developments. If for example you are learning to speak a foreign
language write a project you think will help you with that, and avoid a
composite solution ex. storing a library of words and translations in sql. That
may be a better way to do it for real but you will learn more about C++ if you
simply keep to a 100% C++ solution.
Other advice I would give is to avoid C++ stackexchange and encourage you
instead to break down the problem you are having into small steps to help you
think through the situation. I would also try and avoid books that are list based.
A list is easy to write and as you know at least very difficult to remember
notwithstanding the fact that a 400 page book of so called exemplar lists whose
real purpose may be not much more than to make a few people look smarter
than the rest of us on a subject that really is as trivial as C++.
Finally, I really would recommend the books written by the language's creator,
Bjarne Stroustrup. His experience of decades of language design for C++ is a
treasure of insight on all matters pertaining to C++. In particular "The Design of
the C++ programming language" and before you read that, as an excellent
introduction a short paper on the History of C++, both by Bjarne Stroustrup. A
man that has stayed with C++ and worked through its problematic development
as opposed to certain others who create one disaster of a language and are
rewarded by being allowed to create more.
About Me
Continually Involved in C since 1987 and C++ since 1995 largely for doing OS
design, Compiler design, extending microprocessor functionality in toolchains,
drivers for high end ($3000+) complex equipment and CUDA for some signal
processing tasks.
I am available for the more signficant roles in any of industrial research, design
or development. My website is www.aexa.uk my email is marcel@aexa.uk or
mldbmail@gmail.com
BOOK EXCERPT 1
C to C++17 Curriculum
A 5 day course (now available as a downloadable book) on C++ given by the
author and your instructor,
• Introduction
▪ New functionality,
• Concurrency in C++17
o How to overlay a threading model in an OO
language.
• Parallel C++17
o Scaling STL for multicore.
• OO Design Patterns relevant to C++
o An overview of some popular C++ OO Design
Patterns
• C Pointers part II
BOOK EXCERPT 3
• Conclusion C++
Implements OO using a Class/Object
model where the actions are defined in a
Declarative style.
BOOK EXCERPT 4
• Perfect forwarding
BOOK EXCERPT 5
delete []p;
delete []intp;
▪ Thread safety.
▪ Third-party libraries.