Live data from Hacker News

21st Century C++

cacm.acm.org

71–80 of 281 posts

Re: 21st Century C++

#71
post #41

[flagged]

Even Cobol code hasn't been ported in it's entirety, and the whole codebase at the peak was probably orders of magnitude smaller than C++. It's also far easier to port Cobol - with it being used mostly for data processing and business logic - than C++ that was used for all manners of strange, esoteric and complicated pieces of software requiring thousand to millions of man-hours to port (for example most of Gecko and…

We can all at least appreciate that COBOL is something you try to get rid of where possible. If we took the same attitude to C++ as we do COBOL, then I think the issue would be much less severe.

Re: 21st Century C++

#72
post #8

Earlier quoted context omitted.

It's typical Stroustrup style to write code in a variable width font. I'd wager they didn't have an option to use a variable-width font in their code blocks in their CMS and normal paragraphs are trimmed automatically. I didn't see the author at first. However, immediately after seeing the code I checked for the author, because I was sure it was Stroustrup.

While you are right about the books of Stroustrup, here your inference is wrong, because Stroustrup cannot have anything to do with the CSS style sheets of the ACM Web site, which, in conjunction with the browser settings, determine the font used for rendering the text. On my browser, all the code is properly indented, most likely because my browsers are configured correctly, i.e. with a monospace font set as the def…

They just fixed it by now. It was different when the story was new.

Re: 21st Century C++

#73
post #41

[flagged]

Honestly, I am a happier and more productive developer since left C++ behind for other languages. And it's not just the language, but the lack of ecosystem too. Things like the build system, managing dependencies, etc, all such a pain compared to modern languages with good ecosystem (Rust, Flutter, Kotlin, etc)

Re: 21st Century C++

#74
post #19
post #15

Earlier quoted context omitted.

This doesn't seem to be a code blog, but a general science communication blog. The editors may not be familiar with code syntax, and may simply be using a content management system and copy-pasting from source material.

> ACM, the Association for Computing Machinery, is the world's largest educational and scientific society, uniting computing educators, researchers and professionals to inspire dialogue, share resources and address the field's challenges. Most of programming language conferences are organized by ACM.

I know, but the blog itself doesn't seem oriented to post code snippets. I clicked a few articles which were much more general.

Re: 21st Century C++

#75
post #68

Earlier quoted context omitted.

> It is so objectively horrible in every capacity, Total hyperbole and simply not true. > but it still somehow managed to limp on for all these years Before Rust became somewhat popular, there was simply no serious alternative to C++ in many domains.

That in and of itself is a failure. The decision to continually bolt more stuff onto this mess instead of developing a viable alternative is honestly painful. When you look at something like Zig, it gets you much of what C++ offers and in a way that doesn't cause you pain. Is the argument that Zig simply wasn't possible 30 years ago? I doubt it. As best I can tell, Zig comes as the result of a relatively experienced…

I guess someone had to make all these mistakes so that others can now learn from them :)

Re: 21st Century C++

#76
post #44
post #37

Earlier quoted context omitted.

I have seen 3 different safe c++ proposals (most are not papers yet, but they are serious efforts to show what safe c++ could look like). However there is a tradeoff here. the full bower checker in C++ approach is incompatible with all current C+++ and so adopting it is about as difficult is rewriting all your code in some other language. The other proposals are not as safe, but have different levels of you can use t…

>the full bower checker in C++ approach is incompatible with all current C++ Circle is an implementation of C++ that includes a borrow checker and is 100% backwards compatible with C++: https://www.circle-lang.org/site/index.html

That is one of of the three. It isn't really backward compatible because to take adventage of it you need to write\change a lot of code.

a nice attempt but I have millions of lines of c++ that isn't going away-

Re: 21st Century C++

#77

I haven't read much from Bjarne but this is refreshingly self-aware and paints a hopeful path to standardize around "the good parts" of C++. As a C++ newbie I just don't understand the recommended path I'm supposed to follow, though. It seems to be a mix of "a book of guidelines" and "a package that shows you how you should be using those guidelines via implementation of their principles". After some digging it looks…

> As a C++ newbie I just don't understand the recommended path I'm supposed to follow, though

Did you even read the article ? He has given the recommended path in the article itself.

Two books describe C++ following these guidelines except when illustrating errors: “A tour of C++” for experienced programmers and “Programming: Principles and Practice using C++” for novices. Two more books explore aspects of the C++ Core Guidelines

J. Davidson and K. Gregory Beautiful C++: 30 Core Guidelines for Writing Clean, Safe, and Fast Code. 2021. ISBN 978-0137647842

R. Grimm: C++ Core Guidelines Explained. Addison-Wesley. 2022. ISBN 978-0136875673.

Re: 21st Century C++

#78
post #22

I haven't read much from Bjarne but this is refreshingly self-aware and paints a hopeful path to standardize around "the good parts" of C++. As a C++ newbie I just don't understand the recommended path I'm supposed to follow, though. It seems to be a mix of "a book of guidelines" and "a package that shows you how you should be using those guidelines via implementation of their principles". After some digging it looks…

The problem with 45 years of C++ is that different eras used different features. If you have 3 million lines of C++ code written in the 1990's that still compiles and works today, should you use new 202x C++ features? I still feel the sting of being bit by C++ features from the 1990s that turned out to be footguns. Honestly, I kinda like the idea of "wrapper" languages. Typescript/Kotlin/Carbon.

>footguns

I was expecting that someone would have posted this by now:

How to Shoot Yourself In the Foot:

https://www-users.york.ac.uk/~ss44/joke/foot.htm

Re: 21st Century C++

#79
Bjarne Stroustrup (the creator of C++) is the best language designer. Many language designers will create a language, work on it for a couple years, and then go and make another language. Stroustrup on the other hand has been methodically working on C++ and each year the language becomes better.

Re: 21st Century C++

#80

The C++ Core Guidelines have existed for nearly 10 years now. Despite this, not a single implementation in any of the three major compilers exists that can enforce them. Profiles, which Bjarne et al have had years to work on, will not provide memory safety[0]. The C++ committee, including Bjarne Stroustrup, needs to accept that the language cannot be improved without breaking changes. However, it's already too late.…

What are you talking about, the language gets better with each release. Using C++ today is a hell of a lot better than even 10 years ago. It seems like people hold "memory safety" as the most important thing a language can have. I completely disagree. It turns out you can build awesome and useful software without memory safety. And it's not clear if memory safety is the largest source of problems building software today.

In my opinion, having good design and architecture are much higher on my list than memory safety. Being able to express my mental model as directly as possible is more important to me.

Post reply on HN