Live data from Hacker News

Should we stop writing functions? (C++)

foonathan.net

31–40 of 44 posts

Re: Should we stop writing functions? (C++)

#31
post #3

This kind of post is why I do not understand C++ programmers whatsoever. It's basically a demonstration of the absurd amount of time C++ takes away from you by being the moldy pile of shit that it is. You want better compiler checks and less freedom? Great, me too. Can we please shut the fuck up and use a language that actually supports that?

It simply has too many upsides and is way too popular to be replaced with either - a simpler language that does less - a less popular language - a more verbose / restrictive language If you want people to switch to something better, make something better . Its not enough to simply call out the issues (which is valid, but not useful anymore), and it entirely dismisses that replacement languages like D (small, less act…

C++ is terrible language.

Re: Should we stop writing functions? (C++)

#32
post #29

Earlier quoted context omitted.

Why aren't we writing everything in assembler? It's so much faster! There's a huge number of business process where execution time is almost a non-issue. As long as the thing runs every day/week/month/quarter no one will give a crap. Development time, supportabilty, and onboarding time for new developers tend to matter way more for those sorts of processes. For things your shipping out to end users? Optimization and…

Context is important. C++ is generally used by millions of people to whom execution time matters quite a bit. The language is literally designed to force the programmer to decide how to balance CPU cycles with language abstractions and features. It's already hard to debug compared with a lot of other languages (which are generally slower). The fact that you (and GGP) rarely encounter situations where run time is crit…

>The language is literally designed

I think that is a matter of some debate.

Re: Should we stop writing functions? (C++)

#33
post #3

Earlier quoted context omitted.

It simply has too many upsides and is way too popular to be replaced with either - a simpler language that does less - a less popular language - a more verbose / restrictive language If you want people to switch to something better, make something better . Its not enough to simply call out the issues (which is valid, but not useful anymore), and it entirely dismisses that replacement languages like D (small, less act…

C++ is terrible language.

Care to elaborate?

Re: Should we stop writing functions? (C++)

#34

Earlier quoted context omitted.

> If C++ is so good why does it need to be constantly updated and extended? You could make that argument about almost any technology (certainly in the IT world). C23 is out this year which will make it the 6th "official" version - obviously a much more slowly evolving language than most, but nonetheless still being fairly regularly "updated and extended". There's plenty of things I don't care for in C++, but I can (a…

C23 is a bad standard with a massive pile of misfeatures. The only reason there even is a C23 is that a bunch of C++ people have infiltrated the committee in an attempt to force changes into C23. For example, the guy whose website is 'thephd.dev' is a self-proclaimed Rust fanatic who wants to see the death of C. He is also on the committee in a leadership position. The C committee. The problem is that it's a language…

[flagged]

Re: Should we stop writing functions? (C++)

#35

This kind of post is why I do not understand C++ programmers whatsoever. It's basically a demonstration of the absurd amount of time C++ takes away from you by being the moldy pile of shit that it is. You want better compiler checks and less freedom? Great, me too. Can we please shut the fuck up and use a language that actually supports that?

C++ is one of the most successful programming languages in history. It makes all new languages look like a drop in the ocean comparatively. Millions of professional C++ developers work on large scale mission critical C++ code that control everything from airlines to Fortune 500 companies to cars to nuclear reactors to military hardware. And new C++ projects are started every single day. Most developers have zero clue…

Imo, rewriting the code isn't the only prohibitively difficult problem. Replacing the very advanced development tools C++ has seems almost impossible, and so far no competitor to C++ has come very close, and it's a moving target. You can debug template instantiations over the GDB remote protocol, you can print out an AST and make queries on it (much richer than Tree Sitter), you can generate a perfect callgraph (understands templates, overloads, and macros) with no effort, you can get suggestions for source code optimizations at the IR bytecode level, every hex editor or whatever can demangle C++ symbols, you can print out the ABI of any polymorphic class or use a bin introspection tool to do the same in reverse, you can organize template compilation errors into one of several easily navigable GUIs, you can JIT C++ code in a REPL or a debugger and place breakpoints on templates or overload sets or exceptions, you can extend linters and compilers with plugins, and C++ has some of the most advanced static analyzers of any language (not just systems level ones).

The closest overall in tooling IMO is Rust, but it's currently missing a lot of the above, and very many C++ abstractions cannot be elegantly expressed in Rust due to limitations in generics, const functions, the orphan rule, and a lack of C++-like functor structs.

Re: Should we stop writing functions? (C++)

#36
post #34

Earlier quoted context omitted.

C23 is a bad standard with a massive pile of misfeatures. The only reason there even is a C23 is that a bunch of C++ people have infiltrated the committee in an attempt to force changes into C23. For example, the guy whose website is 'thephd.dev' is a self-proclaimed Rust fanatic who wants to see the death of C. He is also on the committee in a leadership position. The C committee. The problem is that it's a language…

[flagged]

[flagged]

Re: Should we stop writing functions? (C++)

#39
post #35

Earlier quoted context omitted.

C++ is one of the most successful programming languages in history. It makes all new languages look like a drop in the ocean comparatively. Millions of professional C++ developers work on large scale mission critical C++ code that control everything from airlines to Fortune 500 companies to cars to nuclear reactors to military hardware. And new C++ projects are started every single day. Most developers have zero clue…

Imo, rewriting the code isn't the only prohibitively difficult problem. Replacing the very advanced development tools C++ has seems almost impossible, and so far no competitor to C++ has come very close, and it's a moving target. You can debug template instantiations over the GDB remote protocol, you can print out an AST and make queries on it (much richer than Tree Sitter), you can generate a perfect callgraph (unde…

Yep agree. Most HN developers work on comparatively simple JavaScript CRUD business applications and have zero clue on what it takes to write the large scale high-performance software the world relies on to function.

Re: Should we stop writing functions? (C++)

#40
post #29

Earlier quoted context omitted.

Context is important. C++ is generally used by millions of people to whom execution time matters quite a bit. The language is literally designed to force the programmer to decide how to balance CPU cycles with language abstractions and features. It's already hard to debug compared with a lot of other languages (which are generally slower). The fact that you (and GGP) rarely encounter situations where run time is crit…

>The language is literally designed I think that is a matter of some debate.

This isn't even debatable.

>> Efficiency has been a major design goal for C++ from the beginning, also the principle of “zero overhead” for any feature that is not used in a program. It has been a guiding principle from the earliest days of C++ that “you don’t pay for what you don’t use”.

https://www.stroustrup.com/Performance-TR.pdf

Post reply on HN