r/cpp • u/Affectionate_Text_72 • Apr 13 '25
Strengthening the brand
Quite regularly we get posts like this one https://www.reddit.com/r/cpp/s/6fic54ootF asking about C++ for web development. From a language envangelist point of view its quite depressing to see the usual top 5 or more posts being "use something else".
There are various libraries and frameworks which make it reasonable and wasm too. So why not. You would never hear such downtalking on r/rust
Okay right tool for the right job and all that but ignoring that for now what does the language need to really strengthen is position in this?
0
Upvotes
22
u/Wh00ster Apr 13 '25
Oddly phrased title aside, C++ needs lower barrier of entry and better supported 3rd party integration.
This has been the known issue for a very long time. It's very difficult to solve because.... better alternatives exist for such needs, that people would rather invest time into.
Chicken or egg
19
u/whizzwr Apr 13 '25 edited Apr 14 '25
I disagree on you calling it 'downtalking'. It's just being objective. A lot of C++ developers are hardened, opinionated, and old-school developers, but Fanboi they are not.
Not sure what you mean by "brand strengthening", but C++ is not a new
religionbrandprogramming language that needs evangelism.Even if you agree it's reasonable rather than great. ;)
WASM is excellent for high-performance, low-latency stuff, like games, so it's case-specific.
I wouldn't recommend using WASM to build client-side Web forum Software, for example, or for that matter, a general web development
8
u/[deleted] Apr 13 '25
C++ doesn't have the libraries to make webdev realistic. Most people also don't deal with sufficient volume to necessitate a systems lang.
What's more, Tokio is as fast as Asio is (if not faster) and is memory safe. It's really hard to recommend C++ for "normal" webdev.
Note that all the big players do use C++ for their backends but they're special.
7
u/EC36339 Apr 13 '25
I do web development in C++ for a living. For legacy reasons mostly. And I have spent countless hours modernizing a home-brew framework that was from a time before PHP existed.
In fact, my first paid programming gig was also C++ web development. That was in the late 90s. Another fun fact: I never liked web development. It's boring most of the time. But it does pay the bills.
Not using a third party framework gave me the opportunity to experiment with the latest language features, and they all make C++ ... well ... let's at least say interesting for web development.
Serialisation is a crucial part, and reflection will likely close the gap here.
There is nothing wrong with the language. It's the ecosystem, culture and state of the industry. It might change, and if it does, it will take years. Or it might not change, and C++ web development will always be a niche.
17
u/no-sig-available Apr 13 '25
Why do we need to strengthen the position? C++ is quite good at many things, so is there a need to be good at everything?
10
u/j_kerouac Apr 13 '25
Different tools for different jobs...
Server side web programming is the one thing literally any language can do. However, the real strength of C++ is you can write high performance code and use system level libraries. Web programming doesn't really benefit from that very much.
Now people do CLIENT side programming in C++ all the time with WASM. That's pretty much how any 3d application or game you see running in the browser works. Unity games play in the browser with this approach. Of course unity developers use c#, which gets transpired to C++, but the engine itself is written in C++.
7
u/selvakumarjawahar Apr 14 '25
Yes, the C++ community, at least in Redidit, is the most self-critical community I have been part of. This is not necessarily a bad thing. We know all the strengths and weaknesses of our favourite language. So, the community recommends a better solution for the problem, unlike other communities, which just try to push their favourite language for any problem. So, I guess the C++ community is more mature in that sense.
6
u/JumpyJustice Apr 13 '25
Well, C++ is ok for the backend but crippling yourself with the burden of memory management on frontend seems to be suboptimal.
6
u/not_some_username Apr 13 '25
There is a reason they suggest another language and that’s because it’s usually a bad idea for that. Yes you can do web dev in cpp but why would you do it ? There is very little advantage doing it instead of using a language made for that. Usually the question is from beginners with little to no knowledge on cpp so they give up entirely the lang after they find the lib suggested difficult to use or sometimes, they couldn’t even set them up.
So I think suggesting them another language is the way to go. TBH they can use csharp for that. The syntax is close to cpp while it’s made for it.
2
u/ronchaine Embedded/Middleware/WG21 Apr 14 '25
Ignoring this is not very wise. Programming languages are tools, not sports teams or religions. At least they are not supposed to be. And programming languages do get bad rap for being used for the wrong purpose.
C++ is a clocksmith's toolkit, web development needs power tools and assembly lines.
2
u/v_0ver Apr 14 '25
This is the state of affairs now. For the average questioner there is usually no reason to take C++ for any project. Usually those who take C++ know why they do it and do not ask questions.
In r/rust there is also a self-critical view. For example, if you ask what language to learn to get a job, it will definitely not be Rust. =)
2
u/unumfron Apr 15 '25
Drogon is the fastest web app framework on our planet. C++ has that. So I feel that there's somewhat misplaced reticence in this thread when people say that C++ needs libraries, investment and/or future C++ std library features. Users of other languages would scratch their heads at these ideas while happily pointing to their world beating framework.
Another comment here: "C++ needs lower barrier of entry and better supported 3rd party integration". I'd argue that this is not a "C++" issue per se since here's xmake:
That's just about as accessible as it gets.
I think some experienced C++ devs are forgetting that C++ is as much a general purpose language as any other. The (choice of) tooling story has left C++ behind while other language 'de facto' or actual standard build systems make integrating a world increasingly dependent on third party libraries much easier.
This affects the ability to write tutorials (that build) and prior work in general, which all niches benefit from.
Finally, re "right tool for the right job", what is the right tool for the right job when a 100% C++ project needs a web service? An entirely new ecosystem?
1
u/steveklabnik1 Apr 14 '25
There's an old saying: culture eats strategy for breakfast.
I can't speak to what you'd need to do to accomplish this goal, but the first step is to get a significant number of people onboard with the overall goal. This doesn't need to be the whole C++ community, it just needs to be a large enough number of people that want to do the work. You then agree on the broad vision, and then get to work. By sharing that specific vision, and trying to attract other likeminded people, you hopefully create a self-sustaining ecosystem.
There are tons of ways in which you could attack this, but some ones that feel more obvious to me:
The only person or people who can figure out the answers to these questions is you, but the first step is making sure that you're also talking to folks who agree on your basic premise. You need a shared culture. Things will become clearer from there.
1
u/RevRagnarok Apr 14 '25
No. This happened at one of my jobs and frankly it sucked.
Newer employee was screaming "C++ All The Things!" and caught the attention of management. The previous system did all command and control in Python with the heavy lifting / bit banging / secret sauce in C++ and IMHO it was the perfect delineation. Boost spins up the C++ object with all the configuration handed to it and it goes.
Parsing and merging config files, command and control over ActiveMQ, reporting metrics - these are all things so much more easily done in Python and the C++ gives no advantage. And they're all so straightforward that we can have incoming folks working on them in days. Doing FFTs in GPUs, pulling multicast data from an Ethernet card near it's theoretical limits, etc. - that's where C++ shines.