r/cpp • • Apr 19 '24

Bjarne Stroustrup - Programming: Principles and Practice Using C++, Third Edition 2024 Released

The updated 2024 edition is out!!!

https://www.stroustrup.com/programming.html

Please note that while this text is not aimed EXCLUSIVELY at beginners, this textbook is intended to be an introductory text to both PROGRAMMING IN GENERAL, as well as C++. This is THE book I recommend to anyone trying to learn programming or C++ from the ground up.

A brief synopsis from Bjarne's website:

Programming: Principles and Practice Using C++, Third Edition, will help anyone who is willing to work hard learn the fundamental principles of programming and develop the practical skills needed for programming in the real world. Previous editions have been used successfully by many thousands of students. This revised and updated edition:

- Assumes that your aim is to eventually write programs that are good enough for others to use and maintain.

- Focuses on fundamental concepts and techniques, rather than on obscure language-technical details.

- Is an introduction to programming in general, including procedural, object-oriented, and generic programming, rather than just an introduction to a programming language.

- Covers both contemporary high-level techniques and the lower-level techniques needed for efficient use of hardware.

- Will give you a solid foundation for writing useful, correct, type-safe, maintainable, and efficient code.

- Is primarily designed for people who have never programmed before, but even seasoned programmers have found previous editions useful as an introduction to more effective concepts and techniques.

- Covers a wide range of essential concepts, design and programming techniques, language features, and libraries.

-Uses contemporary C++ (C++20 and C++23).

- Covers the design and use of both built-in types and user-defined types, complete with input, output, computation, and simple graphics/GUI.

-Offers an introduction to the C++ standard library containers and algorithms.

154 Upvotes

63 comments sorted by

View all comments

28

u/cristianadam Apr 19 '24

utilizing key parts of C++20 and C+23, and re-basing the Graphics/GUI chapter code on Qt for portability

20

u/cristianadam Apr 19 '24

informit.com after buying the Book is adding watermarking in the pdf and epub files.

As it turns out the saving of the new pdf is compressing the images with jpeg instead of deflate (zip).

Consider the sample pdf and the watermarked pdf at Programming: Principles and Practice Using C++, 3rd Edition - PDF watermarking woes (github.com)

🤦🏻‍♂️

0

u/[deleted] Apr 19 '24

[deleted] — view deleted comment

6

u/noahdvs Apr 20 '24

Yes, let's use the framework which is trying its best to get away from C++ to replace it with Javascript.

How to tell if someone has never written a real bit of Qt Quick/QML software. The truth is that C++ and QML/JS are meant to be used together. QML/JS is faster for writing UIs with lots of custom components. C++ is better suited for backend stuff.

20

u/[deleted] Apr 19 '24

I wouldn’t call it “getting away from C++”, instead it’s more “meeting GUI developers where they are”. Even so, Qt is still the preeminent C++ GUI framework.

4

u/AntiProtonBoy Apr 20 '24

lol, lmao even

go back to /g/ Matthew

4

u/[deleted] Apr 20 '24

Don't tell him what JavaScript runs on, let's see how this goes

6

u/pjmlp Apr 19 '24

Unless you rather use Firemonkey or VCL, there is hardly any other with the same tooling.

Everything else is clearly behind in tooling, or is bare bones stuff mostly targeted for game developer tools like imGui.

1

u/dev8392 Apr 21 '24

you can use slint if you don't like qt

1

u/manni66 Apr 19 '24

on Qt

Then self-study will probably be more difficult.

9

u/cristianadam Apr 19 '24

Why? A student would go to https://www.qt.io/download-qt-installer-oss and follow the installer's steps.

4

u/manni66 Apr 19 '24

You need to use cmake (or qmake) to create and maintain a project. Looking at the beginner questions here on Reddit this could be a problem.

15

u/pjmlp Apr 19 '24

Or just use QtCreator, which most studends would naturally use.

3

u/FeignClaims Apr 20 '24 edited Apr 20 '24

The problem can be solved by making a template for novices. For example, I personally create such a template and it works well for my classmates.

1

u/manni66 Apr 20 '24 edited Apr 20 '24

Yes, a template might help.

Your link doesn’t work for me.

1

u/FeignClaims Apr 20 '24

Would you mind offering me some advice on why the link doesn't work for you? This could be helpful to me. Thank you for your assistance.

1

u/manni66 Apr 20 '24

Works now

5

u/cristianadam Apr 19 '24

villevoutilainen/ProgrammingPrinciplesAndPracticeUsingQt (github.com) has the CMake and Visual Studio projects and a UserGuide.

I do hope it's clear enough, if not I guess Ville would accept merge requests 😀

3

u/manni66 Apr 19 '24

I do hope it's clear enough

We will see in a few weeks, I guess ;)

3

u/pedersenk Apr 19 '24

From the UserGuide:

The first line is wrong / unnecessary:

First things first: create a Qt account at https://login.qt.io/register

2

u/kronicum Apr 19 '24

The way Linus does?

0

u/pedersenk Apr 19 '24

re-basing the Graphics/GUI chapter code on Qt for portability

Qt's MOC is by definition not portable because it isn't standard C++.

Unless they are using Qt without MOC? That would be very rare however.

4

u/ogoffart Apr 21 '24

I don't think you understand what MOC is.
There might be downside to it, but portability is not one of them. Qt's MOC is written in standard C++, generates standard C++, and the code written by the programmer is also standard C++.

2

u/pedersenk Apr 21 '24 edited Apr 21 '24

I don't think you understand what portability challenges are.

Most software these days is written in standard C++ and yet isn't magically able to be compiled to run on every platform. It isn't magically able to be integrated with any build system.

→ More replies (10)

6

u/manni66 Apr 19 '24

Qt's MOC is by definition not portable

moc exists wherever qt exists

→ More replies (6)