pjmlp 3 hours ago

I still love C++ Builder, regardless of all Borland misteps that lead to where Embarcadero is today, it is the survivor of C++ RAD IDE tooling, Visual C++ never was as Visual as it name implies.

fsloth 3 hours ago

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 the need to modify them_ to latest standards.

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

I simply don't understand what type of industrial use this type of theoretical abstraction building serves.

Using the metaprogramming features makes code bases extremly hard to modify and they don't actually protect from a category of runtime errors. I'm speaking from experience.

I would much rather have a codebase with a bit more boilerplate, a bit more unit tests and strong integration testing suite.

The longer I use C++ the more I'm convinced something like Orthodox C++ is the best method to approach the language https://bkaradzic.github.io/posts/orthodoxc++/

This keeps the code maintainable, and performant (with less effor than metaprogramming directed C++).

Note: the above is just an opinion, with a very strong YMMV flavour, coming from two decades in CAD, real time graphics and embedded development.

  • gpderetta 2 hours ago

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

    • jstimpfle 24 minutes ago

      I'll bite. printf might be unsafe in terms of typing, in theory, but it's explicit and readable (with some caveats such as "PRIi32"). The actual chance of errors happening is very low in practice, because format strings are static in all practical (sane) uses so testing a single codepath will usually detect any programmer errors (which are already very rare with some practice). On top of that, most compilers validate format strings. printf compiles, links, and runs comparatively quickly and has small memory footprint. It is stateless so you're always getting the expected results.

      Compare to <iostream>, which is stateful and slow.

      There's also std::format which might be safe and flexible and have some of the advantages of printf. But I can't use it at any of the places I'm working since it's C++20. It probably also uses a lot of template and constexpr madness, so I assume it's going to be leading to longer compilation times and hard to debug problems.

    • unwind an hour ago

      The article argues that modern C++ has type-checked string formatting, so it does not argue for (unchecked) `printf()`, right?

      • vintagedave 27 minutes ago

        "The article" is ambiguous. The one this HN post is about does not argue for it, at all. But the one in the comment above directly says,

        > Don’t use stream (<iostream>, <stringstream>, etc.), use printf style functions instead.

        and has a code example of what they argue 'Orthodox C++' should be, which uses printf.

        I'm all for a more sensible or understandable C++, but not at the expense of losing safety. In fact I would prefer the other way: I still feel incredibly saddened that Sean Baxter's Circle proposal for Safe C++ is not where the language is heading. That, plus some deep rethinking and trimming of some of the worst edge behaviours, and a neater standard library, would be incredible.

yosefk 2 hours ago

"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."

  • rerdavies 43 minutes ago

    If only it would do something entirely different faster. :-(

    Somebody really needs to rethink the entire commitment to meta-programming. I had some hope that concepts would improve reporting, but they seem to actually make it worse, and -- if they improve compile times at all, I'm not seeing it.

    And it has nothing to do with historicity. Every time I visit another modern language (or use it seriously) I am constantly reminded that C++ compile times are simply horrible, and a huge impediment to productivity.

  • ozgrakkurt 20 minutes ago

    This is also because llvm and gcc are just slow right? Are there any alternative c++ compiler that is faster maybe?

  • gpderetta an hour ago

    As a long-time C++ user I definitely complain that C++ takes long to compile. Then again, I always have.