It is an excellent language for situations that requires low latency or raw throughput on a single processor, or systems and embedded programming. These situations are less common in be development because it is often cheaper to use more productive languages and more and more powerful computers to solve a given problem.
It is the third gen UI in the making ( Apparently for a few years already ).
The first one is old Reddit, the 2nd is React? / JS FrontEnd based rendering. The 3rd ( "sh" ) if I remember correctly is based on something similar to Livewire / HTMX concept.
On mobile, I'm logged in, and any time I click on reply or add a comment, a pop up tells me to log in before commenting (or open the crappy Android app). I even clicked the "log in" button on the pop up, and afterwards it still won't work. That's a pretty pathetic bug to have after years of work imo. Not one of them thought to try it on mobile...
sh.reddit seems to be build ful on web components with lit, different than HTMX. Looking into the web inspector is certainly depressing if your tastes come from the era of “semantic” HTML and progressive enhancement.
But well. The real sin of new.reddit wasn’t really the technical underpinnings, but the UI design. Here it seems even worse in parts: permanently clicking just to read the comments.
And some of the clicks (at least on mobile), for reasons I can't discern, take you to a new page for the root comment that you clicked more replies to. It makes it so that when you press back to read the rest of the comments, you either need to click load more comments again on everything, or your page has scrolled past the natural cutoff for the default show comment count so now you're looking at new threads.
I don't know who designed this, but it is truly awful.
Yeah, that is never happening. About two months ago they were doing AB tests where they've disabled web browsing for some mobile users, telling them that they need to use the app. If they ever pull the trigger with that, I'm simply not going to use the site. This is coming from someone who has been using Reddit since 2006.
To confirm a theory that I had [0], I once tried to track what languages the software I actually use is written in. I basically arrived at the same conclusion as OP - almost everything I use is written in C++. From the browser, to my favourite games, to even the backends of a lot of websites I use frequently, it's pretty much all C++ with other languages sprinkled in. This, mind you, is not even counting the fact that most JVM implementations and Node interpreters are also written in C++.
If I ever wanted to learn a new language, C++ would be it.
[0] The theory I had was that almost none of the software I use is written in Haskell. Which was true by a long shot.
This, mind you, is not even counting the fact that most JVM implementations and Node interpreters are also written in C++.
Moreover every major C compiler (GCC/Clang/MSVC/etc) is written in C++. So any C projects depending on those compilers is indirectly depending on C++, e.g. Linux. Not to mention the success of LLVM among other languages.
The only distinctively Haskell software I use is shellcheck. koalaman did say in an interview that he had slight regrets it was in Haskell since it made it difficult to collaborate / receive contributions.
I think this ultimately just reflects on a certain generation of software that we're still using - a 1990's, Unix-ish, graphics-oriented, Internet-capable stack.
I don't think we're staying there, either. C++ is very long in the tooth. Most people looking for a C++-like thing now gravitate towards Rust(with a little bit of deviation for stuff in roughly the same ballpark like Nim, D, and sometimes Zig). And many of the old projects are looking towards migrating to new languages as well. It's just a matter of the critical masses shifting.
Nothing is forever but this totally discounts the primacy of C++ across tech stacks. Rust and any other language leveraging LLVM is depending on a healthy C++ ecosystem. Anything to do with GPGPU is aggressively C++ based, the entire HPC segment is pivoting hard towards C++ (Kokkos, SYCL), and it’s likely orders of magnitude easier to rewrite the entire Linux kernel in Rust than it would be to rewrite chromium in Rust.
There arent really a lot of jobs in c++. It might be pretty foundational but all the other languages are much more prevalent. like game engines are c++ but there are so many game engine writing jobs, much more game engine user jobs.
The job pool is smaller, I believe, but with high earnings potential (luck™), mostly in fields where performance is not a plus, is a must: games dev, robotics, HFT, system engineering, etc.
C++ is the default for natively running software. There have been competitors, but many of them have failed for a variety of reasons.
Even if you are writing in a completely different language, at some point native software will have to run, maybe you need a compiler or an interpreter, but chances are C++ will be involved with that.
Embedded is nowadays a wild world, where you can run stuff like python. But the fact that the ancestor to C++ is still so popular there shows how difficult it is for other languages.
Not true, sure there is "embedded" growing computationally more and more (but since 20 years already at least, what is nowadays??), but there will also always be the embedded size of few kb flash and ram that won't allow you any OS like on the system but require you at most running one of those tiny schedulers without memory protection, because key optimization factors there will always be cost, size and power
consumption.
Running Python and such is still, largely, done by hobbyists while the majority of software used in commercial embedded projects is still primarily C or C++. Maybe it’s been slowly changing but, slowly.
Yeah, it might have inherited C's flaws, introduced some of its own, currently have some existial crysis how to evolve the language under ISO processes, lost some of domains it owned during the 1990's, yet isn't going anywhere for the foresable future.
Even if its role would be restricted to language runtimes,
drivers, GCC, LLVM, game console SDKs, and GPGPU programming, that is enough to keep the language around for a couple of decades more.
We don't need to use the same language for everything.
> We don't need to use the same language for everything.
True; but it is very convenient and productive to use one single language for everything, particularly when it has "multi-paradigm" support. I find there is less cognitive load which allows one to better focus on the domain problem-solving.
"Jack of all trades, master of none", also applies here.
Hence why there are a couple of domains where C++ used to dominate 20 years ago, and eventually were taken over by other languages, most notorious one, GUI frameworks.
It turns out lack of reflection and automated memory management doesn't lead to productive workflows, and tooling.
People love to complain about this regarding C++, and is true.
Yet they keep forgetting it equally relates to all mainstream languages older than 20 years in production.
I bet no one would manage a pub quiz regarding any of them, if the questions were honestly based on the language complete history, thus not fully understanding them either.
No one completely understands Linux. No one completely understands a software package like Siemens NX or CATIA. No one completely understands LLVM. Etc, etc, etc, and the world still goes around.
Having a “small language like C” doesn’t do anything besides move the complexity to application code and hide those details from the compiler. In fact, with sophisticated optimizing compilers and linkers, it’s impossible to predict what any random snippet of code in a large project is transformed into, assuming it exists at all in the final binary.
> "Jack of all trades, master of none", also applies here.
Not quite; if you subscribe to the "other form" of the quote viz. “A Jack of all trades is a master of none, but oftentimes better than a master of one” ;-)
In the case of C++, the language is large and open-ended enough that you can truly express a lot more different models of computation, at different levels of abstraction thus giving you a larger design and implementation space. I think this is the main reason for the success of the language.
My day to day over the past 15 years has been similar to you: Python, javascript, Clojure and clojurescript and some Java. In my free time, for a few years now, I’ve been writing C++ (17) and I love it.
I tell everybody who cares to listen to learn C & C++. They are the common "glue languages" which underpin everything with a huge established ecosystem and gives you the ability to program anything and everything.
Contrary to what HN threads might lead you to believe, they are not that hard to learn and do not need you to become an "expert" in all aspects (i.e. dark corners) of the language. You will pick up the tricks/expertise when you need them.
You'll never see the myriad of hidden Java services or tools that are internal to 'BigNameCorp Inc.'
You won't hear of the tiny bespoke C# apps that some little dotcom uses to manage some of its processes.
You'll never touch the layers of Python glue holding that Fintech startup together.
Software you see, you know, is either native apps for consumers or Web frontends. Of course C++ and JS dominate.
But there's so much more hidden away, a whole world just tucked under a job interview so most don't see it. In this place, Java may very well be King, but Python, C# Go, and yes, C++ all have their parts to play.
42 comments
[ 3.3 ms ] story [ 105 ms ] threadThe first one is old Reddit, the 2nd is React? / JS FrontEnd based rendering. The 3rd ( "sh" ) if I remember correctly is based on something similar to Livewire / HTMX concept.
But well. The real sin of new.reddit wasn’t really the technical underpinnings, but the UI design. Here it seems even worse in parts: permanently clicking just to read the comments.
I don't know who designed this, but it is truly awful.
If I ever wanted to learn a new language, C++ would be it.
[0] The theory I had was that almost none of the software I use is written in Haskell. Which was true by a long shot.
Moreover every major C compiler (GCC/Clang/MSVC/etc) is written in C++. So any C projects depending on those compilers is indirectly depending on C++, e.g. Linux. Not to mention the success of LLVM among other languages.
I don't think we're staying there, either. C++ is very long in the tooth. Most people looking for a C++-like thing now gravitate towards Rust(with a little bit of deviation for stuff in roughly the same ballpark like Nim, D, and sometimes Zig). And many of the old projects are looking towards migrating to new languages as well. It's just a matter of the critical masses shifting.
Even if you are writing in a completely different language, at some point native software will have to run, maybe you need a compiler or an interpreter, but chances are C++ will be involved with that.
So lots of power to run most programming languages.
The biggest problem is cultural.
Secondly,
"CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”
https://www.youtube.com/watch?v=zBkNBP00wJE
"C++20 For The Commodore 64"
https://www.youtube.com/watch?v=EIKAqcLxtT0
Even if its role would be restricted to language runtimes, drivers, GCC, LLVM, game console SDKs, and GPGPU programming, that is enough to keep the language around for a couple of decades more.
We don't need to use the same language for everything.
True; but it is very convenient and productive to use one single language for everything, particularly when it has "multi-paradigm" support. I find there is less cognitive load which allows one to better focus on the domain problem-solving.
Hence why there are a couple of domains where C++ used to dominate 20 years ago, and eventually were taken over by other languages, most notorious one, GUI frameworks.
It turns out lack of reflection and automated memory management doesn't lead to productive workflows, and tooling.
Yet they keep forgetting it equally relates to all mainstream languages older than 20 years in production.
I bet no one would manage a pub quiz regarding any of them, if the questions were honestly based on the language complete history, thus not fully understanding them either.
Having a “small language like C” doesn’t do anything besides move the complexity to application code and hide those details from the compiler. In fact, with sophisticated optimizing compilers and linkers, it’s impossible to predict what any random snippet of code in a large project is transformed into, assuming it exists at all in the final binary.
Not quite; if you subscribe to the "other form" of the quote viz. “A Jack of all trades is a master of none, but oftentimes better than a master of one” ;-)
In the case of C++, the language is large and open-ended enough that you can truly express a lot more different models of computation, at different levels of abstraction thus giving you a larger design and implementation space. I think this is the main reason for the success of the language.
Fixed that for you.
I tell everybody who cares to listen to learn C & C++. They are the common "glue languages" which underpin everything with a huge established ecosystem and gives you the ability to program anything and everything.
Contrary to what HN threads might lead you to believe, they are not that hard to learn and do not need you to become an "expert" in all aspects (i.e. dark corners) of the language. You will pick up the tricks/expertise when you need them.
These languages will outlive the HN audience, regardless how we view them.
You'll never see the myriad of hidden Java services or tools that are internal to 'BigNameCorp Inc.'
You won't hear of the tiny bespoke C# apps that some little dotcom uses to manage some of its processes.
You'll never touch the layers of Python glue holding that Fintech startup together.
Software you see, you know, is either native apps for consumers or Web frontends. Of course C++ and JS dominate.
But there's so much more hidden away, a whole world just tucked under a job interview so most don't see it. In this place, Java may very well be King, but Python, C# Go, and yes, C++ all have their parts to play.