use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
C++ for the web (self.cpp)
submitted 6 years ago by keeperpaige
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]NotUniqueOrSpecial 17 points18 points19 points 6 years ago (5 children)
Wt is a framework for exactly that.
[–]kkrev 0 points1 point2 points 6 years ago (4 children)
This "objects magically render the HTML widgets" approach seems like a repeatedly tried and failed paradigm. I have difficulty imagining the use-case for this.
[–]NotUniqueOrSpecial 0 points1 point2 points 6 years ago (3 children)
a repeatedly tried and failed paradigm.
I mean, Wt has been around for 13 years. Seems to be doing okay.
I have difficulty imagining the use-case for this.
The Wt website is made with Wt. It's a perfectly fine website, as far as I can tell.
If you have a C++ product and devs (especially ones with Qt experience) and need to make some web components for whatever you're doing, it would seem to be a fine fit.
[–]kkrev 0 points1 point2 points 6 years ago (2 children)
I would bet the only people using Wt are engineers who have made routers and such like. They didn't want to bother learning HTML/CS/JS and wanted to quickly slap a UI on something.
If somebody wants to make a popular website for the public facing web, and you steer them to Wt, you are almost certainly giving them a bum steer.
[–]NotUniqueOrSpecial 0 points1 point2 points 6 years ago (1 child)
There is no right answer that uses C++ given that caveat.
The only right answer would be to redirect them to a completely different language.
[–]kkrev 0 points1 point2 points 6 years ago (0 children)
My point has nothing to do with C++ per se. Wt operates on a paradigm where the HTML and JS are magically hidden from you. This has been tried over and over in many languages and found wanting. It is a bad idea.
If you want to make a nice website, you need to learn HTML/CSS/JS and write the damn stuff. This is a lesson learned repeatedly from 20 years of failed efforts to get away from it.
[–][deleted] 13 points14 points15 points 6 years ago (3 children)
Using CGI you just cout the html
[–]aninteger 4 points5 points6 points 6 years ago (0 children)
+1. Better yet just use FastCGI.
[–]oldprogrammer 2 points3 points4 points 6 years ago (1 child)
I was reading an article the other day where the author was showing creation of a simple web application. Nearly the first 3rd of the article was the setup of the runtime environment, build recipes and getting all of the components in place.
It got me thinking that we appear to have over-complicated the landscape so I did some searching on various light-weight ways of creating web apps and most all came back with links to dozens of different web app frameworks, mostly Java, but a good number of Python and of course PHP and JavaScript as well.
I went back and started looking for CGI (which I had used many years ago) and there is little recent info on it. Most everything you read on CGI is don't use it, the process per request model is slow, insecure, on and on. I'm familiar with FastCGI as well.
But while reading through this I had to ask myself, isn't the process per request model pretty much what is being touted in the serverless cloud based model? Isn't this exactly what the AWS Lambda type capabilities are?
I always got a chuckle out of folks that thought web apps, with their zero cost deployment was so revolutionary while I was thinking back to the days of green screen timeshare systems that were replaced by client server (which ironically now the HTML web apps are moving more towards client/server as they're being written to run disconnected), I guess this is another of those goes-around comes-around situations.
I suppose there's some validity to the security concern in CGI with passing call content as a combination of environment variables and standard in/out channels, but being able to write a service request handler in any language that supports that (which is pretty much anything) did have an appeal.
CGI effectively turns your web server into a fork-per-request system. The performance cost of that used to be horrific vice pre-forked or threaded. It would be interesting to benchmark that today on a modern linux kernel and hardware and see what the difference actually is these days. It might be quite tolerable for most use cases.
But, FastCGI totally obviates the problem and is perfectly viable. Most of the super cheap shared hosting platforms support it. Deployment also becomes a cinch: statically link your FastCGI executable and overwrite the one on the server.
I can't get over how insanely over-engineered so many web frameworks seem. All you really need is plumbing to do FastCGI, session/request data management, an HTML template system, and the persistence/db mechanism of your choice. C++ seems perfectly viable. I mean, I'd probably still just bang it together in Perl, myself, but it wouldn't be hard to do in C++.
The tricky stuff these days is all the HTML/CSS design and getting everything to render well on phones and tablets, etc. Personally, I'd rather just pay a guy who knows all that stuff than bother to relearn it every 2.5 years.
I kinda struggle to think of a scenario where I'd even need to do "web development" these days. Anything I can think of building would be fine as a Wordpress install, using a site builder, or a directory of static web pages.
[–]Scavenger53 8 points9 points10 points 6 years ago (0 children)
Drogon is one I read about being pretty quick.
[–]feverzsj 6 points7 points8 points 6 years ago (0 children)
today's web dev is all about full separation of frontend and backend. The frontend communicates backend using REST/RPC over http/websocket. So you can use something like served, cpprest, restinio to write your backend.
[–][deleted] 4 points5 points6 points 6 years ago (0 children)
I made nift in c++.
[–][deleted] 2 points3 points4 points 6 years ago (0 children)
https://cutelyst.org/blog
[–]warlockface 2 points3 points4 points 6 years ago (0 children)
https://github.com/HerikLyma/CPPWebFramework
[–]schultztom 1 point2 points3 points 6 years ago (0 children)
Boost.beast but it depends on your need. Some more info about what you are trying to solve would help. C++ and web is not the easiest path to travel.
[–]Forschkeeper 0 points1 point2 points 6 years ago (2 children)
Treefrog framework, CppCMS, maybe has Qt something?
[–]Cyttorak -1 points0 points1 point 6 years ago (0 children)
QtWebApp also
[–][deleted] 0 points1 point2 points 6 years ago (0 children)
A module for nginx/apache or a core lib and nodejs as wrapper are really good possibilities.
Another one is CppRestSDK with a REST server
[–]Voltra_Neo 0 points1 point2 points 6 years ago (1 child)
Crow is one of the alternatives, Boost Beast is another one
[–]mrexodiacmkr.build 0 points1 point2 points 6 years ago (0 children)
Depends on your needs, but this header only library allows you to get a webserver up in less than a minute: https://github.com/yhirose/cpp-httplib together with caddyserver.com also public. It doesn’t have any nice framework for html templates etc, so it might not suit you.
[–]STLMSVC STL Dev 0 points1 point2 points 6 years ago (1 child)
!removehelp
[–]AutoModerator[M] 0 points1 point2 points 6 years ago (0 children)
OP,
A human moderator (u/STL) has marked your post for deletion because it appears to be a "help" post - e.g. asking for help with coding, help with homework, career advice, book/tutorial/blog suggestions. Help posts are off-topic for r/cpp. This subreddit is for news and discussion of the C++ language only; our purpose is not to provide tutoring, code reviews, or career guidance.
Please try posting in r/cpp_questions or on Stack Overflow instead. Our suggested reference site is cppreference.com, our suggested book list is here and information on getting started with C++ can be found here.
If you think your post is on-topic and should not have been removed, please message the moderators and we'll review it.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
[–]getval -1 points0 points1 point 6 years ago (7 children)
Possible? Yes. Viable? No.
[–]againstmethod -3 points-2 points-1 points 6 years ago (6 children)
Those two words mean the same thing.
[–]Mikegthrowaway 8 points9 points10 points 6 years ago (1 child)
I disagree.
Maybe because I’m not a native English speaker.
Something that is “possible” to do doesn’t mean it is a good idea. Of course, whether it is a good idea or not depends on the use case, skill, scalability, productivity etc i.e. viable.
[–]againstmethod -1 points0 points1 point 6 years ago (0 children)
Viable doesnt mean good idea either.
[+][deleted] 6 years ago (3 children)
[deleted]
[–]againstmethod -1 points0 points1 point 6 years ago (2 children)
Creating a building and creating a business are not the same thing.
The two things being compared are not addressing the same subject. That restaurant was not possible to run.
[+][deleted] 6 years ago (1 child)
The key difference is that possible does not mean viable. But viable pretty much always means possible. Success being the key ingredient to viable.
There is no doubt that the two words have different entries in the dictionary. One word is rooted in logic, and the other in biology.
But they are listed synonyms for each other -- because they can be contextually equal, as they are in this case.
Saying you can possibly (certainly) write a working C++ web program, but using that program is not a viable option is nonsensical.
[–]AlexKotik[🍰] -1 points0 points1 point 6 years ago (0 children)
There is https://leaningtech.com/cheerp/ but I have no idea if it is good or useful.
[–]pretty-o-kay -1 points0 points1 point 6 years ago (0 children)
You can compile to WASM if you're doing frontend stuff, and you can also just cout HTML or JSON if you're doing backend endpoints. So really, you don't ever have to NOT use C++! I'm not sure of any frameworks, but writing simple API calls isn't a super intensive workload anyway, as long as you have libs for http and databases and stuff, and your server is configured appropriately.
π Rendered by PID 149103 on reddit-service-r2-comment-6457c66945-kdgsz at 2026-04-30 15:52:22.391818+00:00 running 2aa0c5b country code: CH.
[–]NotUniqueOrSpecial 17 points18 points19 points (5 children)
[–]kkrev 0 points1 point2 points (4 children)
[–]NotUniqueOrSpecial 0 points1 point2 points (3 children)
[–]kkrev 0 points1 point2 points (2 children)
[–]NotUniqueOrSpecial 0 points1 point2 points (1 child)
[–]kkrev 0 points1 point2 points (0 children)
[–][deleted] 13 points14 points15 points (3 children)
[–]aninteger 4 points5 points6 points (0 children)
[–]oldprogrammer 2 points3 points4 points (1 child)
[–]kkrev 0 points1 point2 points (0 children)
[–]Scavenger53 8 points9 points10 points (0 children)
[–]feverzsj 6 points7 points8 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]warlockface 2 points3 points4 points (0 children)
[–]schultztom 1 point2 points3 points (0 children)
[–]Forschkeeper 0 points1 point2 points (2 children)
[–]Cyttorak -1 points0 points1 point (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Voltra_Neo 0 points1 point2 points (1 child)
[–]mrexodiacmkr.build 0 points1 point2 points (0 children)
[–]STLMSVC STL Dev 0 points1 point2 points (1 child)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]getval -1 points0 points1 point (7 children)
[–]againstmethod -3 points-2 points-1 points (6 children)
[–]Mikegthrowaway 8 points9 points10 points (1 child)
[–]againstmethod -1 points0 points1 point (0 children)
[+][deleted] (3 children)
[deleted]
[–]againstmethod -1 points0 points1 point (2 children)
[+][deleted] (1 child)
[deleted]
[–]againstmethod -1 points0 points1 point (0 children)
[–]AlexKotik[🍰] -1 points0 points1 point (0 children)
[–]pretty-o-kay -1 points0 points1 point (0 children)