Live data from Hacker News

Rethinking C++: Architecture, Concepts, and Responsibility

blogs.embarcadero.com

21–30 of 80 posts

Re: Rethinking C++: Architecture, Concepts, and Responsibility

#21
post #5

"Many—especially historically minded—developers complain that modern C++ compilers take longer to compile. But this criticism is short‑sighted. You cannot compare C++ compile times with compilation in other languages, because the compiler is doing something entirely different."

A slow compiler impedes developers velocity, not only taking longer, but breaking their concentration.

The whole point of a programming language is to be an industrial productivity tool that is faster to use than hand writing assembly.

Performance is a core requirement industrial tools. It's totally fine to have slow compilers in R&R and academia.

In industry a slow compiler is an inexcusable pathology. Now, it can be that pathology can't be fixed, but not recognizing it as a pathology - and worse, inventing excuses for it - implies the writer is not really industrially minded. Which makes me very worried why they are commenting on an industrial language.

Re: Rethinking C++: Architecture, Concepts, and Responsibility

#22

Earlier quoted context omitted.

sorry, I can't take something that argues for "printf" in favour of anything else seriously.

> sorry, I can't take something that argues for "printf" in favour of anything else seriously. I think you're arguing from a position of willful ignorance. The article is clear on how it lauds C++'s std::printnl, not printf. http://en.cppreference.com/w/cpp/io/println.html Here's what the article argues: > With std::format, C++ has gained a modern, powerful, and safe formatting system that ends the classic, error‑pro…

I was referring to the Orthodox C++ article linked by parent. Of course format is an improvement on both printf and iostream.

Re: Rethinking C++: Architecture, Concepts, and Responsibility

#23
post #3

I get the feeling author would just like to use a better language, like F# or Ocaml, and completely misses the point what makes C++ valuable. C++ is valuable, because the existing tooling enables you to optimize the runtime peformance of a program (usually you end up with figuring out the best memory layout and utilization). C++ is valuable becaus it's industry support guarantees code bases live for decades _without…

> C++ is valuable, because the existing tooling enables you to optimize the runtime peformance of a program

This is true for MANY other languages too, I don't see how this makes c++ different. With gdb its quite the opposite, handlig c++ types with gdb can be a nightmare and you either develop your own gdb glue code or write c-like c++.

> C++ is valuable becaus it's industry support guarantees code bases live for decades _without the need to modify them_ to latest standards.

In times of constant security updates (see the EU's CRA or equivalent standards in the US) you always gotta update your environment which often also means updating tooling etc. if you don't wanna start maintaining a super custom ecosystem.

I don't see this as a positive in general, there is bit rot and a software that is stuck in the past is generally not a good sign imo.

> C++ is valuable because the industry tooling allows you to verify large areas of the program behaviour at runtime (ASAN etc).

Sanitizers are not C++ exclusive too and with rust or C# you almost never need them for example. Yes C++ has extensive debugging tools but a big part of that is because the language has very few safeguards which naturally leads to a lot of crashes etc..

I think the idea of using only a small subset of C++ is interesting but it ignores the problem that many people have, you don't have the time to implement your own STL so you just use the STL. Ofc it gives me more control etc. but I'd argue most of the time writing orthodox c++ won't save time even in the long run, it will save you headaches and cursing about c++ being super complicated but in the end in modern environments you will just reinvent the wheel a lot and run into problems already solved by the STL.

Re: Rethinking C++: Architecture, Concepts, and Responsibility

#24
post #3

I get the feeling author would just like to use a better language, like F# or Ocaml, and completely misses the point what makes C++ valuable. C++ is valuable, because the existing tooling enables you to optimize the runtime peformance of a program (usually you end up with figuring out the best memory layout and utilization). C++ is valuable becaus it's industry support guarantees code bases live for decades _without…

C++20 inverts the traditional relationship between the core language and metaprogramming, which arguably makes it new language in some ways. Instead of being a quirky afterthought, it has become the preferred way to interact with code. There is a point of friction in that the standard library doesn’t (and can’t) fully reflect this change. Metaprogramming style in C++20 only has a loose relationship to previous versio…

As someone that has only dabbled in C++ over the past 10 years or so, it feels like each new release has this messaging of “you have to think of it as a totally new language”. It makes C++ very unapproachable.

Re: Rethinking C++: Architecture, Concepts, and Responsibility

#25
post #3

I get the feeling author would just like to use a better language, like F# or Ocaml, and completely misses the point what makes C++ valuable. C++ is valuable, because the existing tooling enables you to optimize the runtime peformance of a program (usually you end up with figuring out the best memory layout and utilization). C++ is valuable becaus it's industry support guarantees code bases live for decades _without…

> C++ is valuable, because the existing tooling enables you to optimize the runtime peformance of a program This is true for MANY other languages too, I don't see how this makes c++ different. With gdb its quite the opposite, handlig c++ types with gdb can be a nightmare and you either develop your own gdb glue code or write c-like c++. > C++ is valuable becaus it's industry support guarantees code bases live for dec…

> handlig c++ types with gdb can be a nightmare and you either develop your own gdb glue code or write c-like c++.

That's why better to use lldb and it's scripts.

> I think the idea of using only a small subset of C++ is interesting but it ignores the problem that many people have, you don't have the time to implement your own STL so you just use the STL.

Yeah, agree. It's just much easier to take a "framework" (or frameworks) where all the main problems solved: convenient parallelism mechanisms, scheduler, reactor, memory handling, etc. So it's turning out you kinda writing in your own ecosystem that's not really different from another language, just in C++ syntax.

Re: Rethinking C++: Architecture, Concepts, and Responsibility

#26
post #3

I get the feeling author would just like to use a better language, like F# or Ocaml, and completely misses the point what makes C++ valuable. C++ is valuable, because the existing tooling enables you to optimize the runtime peformance of a program (usually you end up with figuring out the best memory layout and utilization). C++ is valuable becaus it's industry support guarantees code bases live for decades _without…

orthodox C++ should be a subset of C++, I would really use it, like if there was a compiler flag

I can imagine it might be insanely faster to compile

Re: Rethinking C++: Architecture, Concepts, and Responsibility

#27

Earlier quoted context omitted.

C++20 inverts the traditional relationship between the core language and metaprogramming, which arguably makes it new language in some ways. Instead of being a quirky afterthought, it has become the preferred way to interact with code. There is a point of friction in that the standard library doesn’t (and can’t) fully reflect this change. Metaprogramming style in C++20 only has a loose relationship to previous versio…

As someone that has only dabbled in C++ over the past 10 years or so, it feels like each new release has this messaging of “you have to think of it as a totally new language”. It makes C++ very unapproachable.

As someone that has been using C++ extensively for the last 25 years, each release has felt as an incremental improvement. Yes, there are big chunks in each release that are harder to learn, but usually a team can introduce them at their own pace.

The fact that C++ is a very large and complex language and that makes it unapproachable is undeniable though, but I don't think the new releases make it significantly worse. If anything, I think that a some of the new stuff does ease the on-ramp a bit.

Re: Rethinking C++: Architecture, Concepts, and Responsibility

#28
post #15
post #3

I get the feeling author would just like to use a better language, like F# or Ocaml, and completely misses the point what makes C++ valuable. C++ is valuable, because the existing tooling enables you to optimize the runtime peformance of a program (usually you end up with figuring out the best memory layout and utilization). C++ is valuable becaus it's industry support guarantees code bases live for decades _without…

As someone that had the option to choose between C and C++, coming from compiled BASIC and Object Pascal backgrounds, back in the early 1990's. What makes C++ valueable is being a TypeScript for C, born in the same UNIX and Bell Labs farm (so to speak), allowing me to tap into the same ecosystem, while allowing me to enjoy the high level abstractions of programming languages like Smalltalk, Lisp, or even Haskell. Thu…

Does go count as managed, in your view? (Honest question - I don't know go well enough to have much of an opinion.)

Re: Rethinking C++: Architecture, Concepts, and Responsibility

#29
From TFA:

> C++ is often described as complex, hard to learn, and unsafe. That reputation is undeserved. The language itself is not unsafe. On the contrary: it is precise, honest, and consistent. What is unsafe is how it is used if it is misunderstood or if one remains in old patterns.

I think this take needs to stop. It’s a longer way to say “skill issue”. Meanwhile, decades of industry experience have shown that the governing principles of even modern C++ make it incredibly hard (expensive) to deliver high quality software. Not impossible - there’s lots of examples - but unreasonably hard.

C++ is fundamentally unsafe, because that’s how the language works, and if you think otherwise, you don’t know C++. There are patterns and paradigms that people use to limit the risk (and the size of the impact crater), and that’s helpful, but usually very difficult to get right if you also want any of the benefits of using C++ in the first place.

Certain people will disagree, but I surmise that they haven’t actually tried any alternative. Instead they are high on the feeling of having finally grokked C++, which is no small feat, and I know because I’ve been there. But we have to stop making excuses. The range of problems where C++ is unequivocally the superior solution is getting smaller.

Re: Rethinking C++: Architecture, Concepts, and Responsibility

#30
post #15

Earlier quoted context omitted.

As someone that had the option to choose between C and C++, coming from compiled BASIC and Object Pascal backgrounds, back in the early 1990's. What makes C++ valueable is being a TypeScript for C, born in the same UNIX and Bell Labs farm (so to speak), allowing me to tap into the same ecosystem, while allowing me to enjoy the high level abstractions of programming languages like Smalltalk, Lisp, or even Haskell. Thu…

Does go count as managed, in your view? (Honest question - I don't know go well enough to have much of an opinion.)

I'd call managed C#, Java, Go, Pythhon, JS, etc. Something with GC e.g., managed memory
Post reply on HN