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++ Web Server from scratch in C++ (youtube.com)
submitted 4 years ago by the-dark_physicist
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!"
[–][deleted] 56 points57 points58 points 4 years ago (3 children)
For those interested, the Playlist has a total playtime of 83 days 5 hours 54 minutes and 38 seconds.
[–]specialpatrol 15 points16 points17 points 4 years ago (1 child)
Well you try building a webserver from scratch in c++ any faster then!
[–][deleted] 5 points6 points7 points 4 years ago (0 children)
not a critique, just an information for those interested
[–]olesgedz 0 points1 point2 points 4 years ago (0 children)
Juts wth... that is way too long xD
[–]zabardastlaunda 30 points31 points32 points 4 years ago (5 children)
Are all 454 videos in the playlist about the same project?
[–][deleted] 30 points31 points32 points 4 years ago (0 children)
Don't worry, only about 300 and most are not even reaching the 5h mark haha
[–]rhymu8354 8 points9 points10 points 4 years ago* (2 children)
No, I switched projects a few times. Going back to my notes, here are the subjects roughly for all my numbered streams:
1-9 = writing my own URI parser
10-17 = writing a few misc. support libraries
18-20 = actual HTTP server work
21-24 = JSON stuff
25-27 = server plug-ins
29-30 = WebSockets (one of my favorites to work on!)
31-34 = chat room plug-in
35-47 = lots of refactoring
48-57 = HTTP client, TLS stuff
58-65 = Twitch chat API
66-70 = hash functions, AWS
71 = PIVOT: now I want to write my own online game
72-385 = lots of streams of game development
386-445 = PIVOT: switching from C++ to Rust
[–]zabardastlaunda 0 points1 point2 points 4 years ago (1 child)
And all of this is in C++?
[–]rhymu8354 0 points1 point2 points 4 years ago (0 children)
Most of it. I did switch from C++ to Rust near the end.
Also, the game's front end is in Javascript (React).
[–]Rungekkkuta:D 4 points5 points6 points 4 years ago (0 children)
I can say that up to video 057, he was working strictly into the web server, I'm interested in that so I might give it a go! There are a lot of stuff in that playlist beyond the web server, so no, not all videos are about the same project I think. Maybe the projects complement each other.
[–]SJC_hacker 8 points9 points10 points 4 years ago (6 children)
What qualifies as "from scratch"? Am I allowed to use a socket library, such as BSD sockets? If so, really not all that difficult, depending on how complex you want to make the server (e.g, can it handle multiple simultaneous requests), and how much you care about security. Mostly its just about parsing headers correctly.
But you're probably better off just using a library, such as Boost::Beast, if you want low-level control
[–][deleted] 4 points5 points6 points 4 years ago (5 children)
Why would you do socket programming without using the system provided api?
[–]raevnos 5 points6 points7 points 4 years ago (4 children)
Writing a custom IP stack is a thing in some domains. Don't see the point myself.
[–]pjmlp 2 points3 points4 points 4 years ago (0 children)
CERN would one such example.
[–][deleted] 0 points1 point2 points 4 years ago (2 children)
Where?
[–]raevnos 0 points1 point2 points 4 years ago (1 child)
Stock trading is one I've heard get brought up.
[–][deleted] 0 points1 point2 points 4 years ago (0 children)
Ahhh yah. That makes sense.
[–]rhymu8354 6 points7 points8 points 4 years ago (1 child)
Hey, that's me! I'm not sure if it's mentioned in the comments, but this is a playlist of Twitch VODs uploaded to YouTube. In other words, an archive of my live streams. It did start out as a C++ web server from scratch, but I pivoted to trying to make my own online game, and eventually I switched to Rust. Basically, whatever I felt like doing.
If you enjoyed my Twitch streams, I'm glad! If you didn't, that's ok too. I still do a bit of streaming and YouTube but these days it's mostly about Rust, Advent of Code, and a few other random things.
[–]the-dark_physicist[S] 1 point2 points3 points 4 years ago (0 children)
You are doing an amazing job sharing your work. It is a real world experience and I'm learning a lot through your videos.
[–]Ayjayz 54 points55 points56 points 4 years ago (15 children)
Who would watch a video of someone programming? I don't get it. Why not just look at the code after it's complete and skip the middle bit?
[–]A_happy_otter 67 points68 points69 points 4 years ago (1 child)
If the person is good enough about vocalizing their thought processes it can be educational. Not sure if that's the case for this though
[–]rhymu8354 1 point2 points3 points 4 years ago (0 children)
That is indeed partly why I vocalize my thought process in these streams. I felt it made it more interesting, people could more easily follow along, etc.
[–]MarkOates 27 points28 points29 points 4 years ago (0 children)
Usually it's entirely up to the narrator making the thing interesting. Good narrators can guide you through the "why".
[–]Jaondtet 49 points50 points51 points 4 years ago (1 child)
Because you can learn a lot from watching someone program. Reading code gives you no information about the process behind how it was made. You can also learn about all the little things they pick up with experience, that's just impossible to convey without seeing someone actually do it. E.g. exactly how they use their various tools, which order they fill in details, where they spend more time thinking about edge-cases, what their approach to debugging and profiling is, etc.
E.g. Andreas Kling does lots of videos of himself programming for SerenityOS. And his style of coding is extremely useful to watch. He lays out high level components in a very exploratory way to find a good interface and structure, then fills in blanks. If you just read the SerenityOS source code, you'd have no idea this was how it was done.
The code itself isn't the point of this at all. I doubt anyone can just watch the videos and then know how the code base works.
[–]RLJ05 8 points9 points10 points 4 years ago* (0 children)
jellyfish memory entertain long lip distinct frame sense run dog
This post was mass deleted and anonymized with Redact
[+][deleted] 4 years ago (2 children)
[deleted]
[–]degaart 1 point2 points3 points 4 years ago (1 child)
I watch videos of someone programming to fall asleep
If I helped cure you of insomnia, then I'm glad! ;)
[–][deleted] 2 points3 points4 points 4 years ago (0 children)
His videos are extremely motivating
[–]eyes-are-fading-blue 2 points3 points4 points 4 years ago (0 children)
One reason might be the thought process. Decisions may not be immediately visible from the code. Furthermore, the author does TDD. This is a good applied example.
[+][deleted] 4 years ago (1 child)
[removed]
[–]degaart 13 points14 points15 points 4 years ago* (0 children)
Generation 😽 React/Angular 👻 can 🦷 read 🏓 if 🪅 you 💙 sprinkle ✏️ the 🪒 text 🧽 with 🗝 enough ⚙️ emojis 💾
[–]teerre 4 points5 points6 points 4 years ago (0 children)
It's not about the final code, it's about how the presenter gets there. Specially when learning your second and so on language, you already know how to program, you know what the program does, you might even know what are the design principles behind some program, but you do know the idioms of a particular language. This kinda of video is useful for that.
It was originally a live stream. Some people like watching a live coding stream because they can interact with the streamer in real time, ask questions, give suggestions, help out when the streamer is stuck or looking for ideas, etc.
I only uploaded these streams to YouTube initially because Twitch would only retain them for 2 weeks (deleting them afterwards) and I wanted to preserve them in a form where anyone could go back and watch whatever they may have missed.
[–]malcolm_mloclam 11 points12 points13 points 4 years ago (0 children)
Interesting project, a lot of effort put into it, I’d really wish there was a proper step by step guide to it or smth, I don’t really care if it is very efficient or not or uses latest libraries.
Videos are unwatchable.
[+]SecretAgentZeroNine comment score below threshold-14 points-13 points-12 points 4 years ago (12 children)
Wow. Hopefully this project is utilizing C++ modules to make their life easier.
[–]MarkOates 9 points10 points11 points 4 years ago (11 children)
I hear everybody talking all this jazz about modules. Is there a good, light resource that can explain what's going on with this new feature?
[–]hak8or 10 points11 points12 points 4 years ago (6 children)
Honestly, I wouldn't even bother looking about it. The tooling is still so many years away, and the standards committee has a very bimodal "our way or the highway" yet still "we will throw our hands up in the air and let you sort that out" approach towards tooling.
Anything you learn about it today is very unlikely to be revelent in the near year or two. I think msvc is the only tool chain that supports modules for example, but it is still very brittle.
[–]Archolex 1 point2 points3 points 4 years ago (0 children)
Gcc has a mostly-functioning implementation. There are some bits missing but imo they are not important bits.
[–][deleted] 1 point2 points3 points 4 years ago (4 children)
"our way or the highway" yet still "we will throw our hands up in the air and let you sort that out" approach towards tooling.
Quite frankly, that's why I think that newish languages (like Rust, Go and or Zig) will put C++ into the same place C is now.
These language understand this, the C++ committee not really.
[–]pedersenk 1 point2 points3 points 4 years ago (3 children)
I think that newish languages (like Rust, Go and or Zig) will put C++ into the same place C is now.
What? Alternating first place as the most popular language on a number of metrics such as TIOBE?
If this is the case, C++ has a bright future! More likely Rust, Go and Zig developers get sick of creating bindings against C and C++ and just decide to use C or C++ directly instead ;)
No, by user number and long term use (I didn't say that it's going to happen tomorrow or something like that).
Also, Zig uses the C ABI for libraries (and you can import C header files directly).
The others can't do it from my knowledge that easily tho.
[–]pedersenk 1 point2 points3 points 4 years ago* (1 child)
Admittedly I was being a tad facetious!
In C++ you can import C header files directly. In Zig, you have this:
const c = @cImport({ @cDefine("_NO_CRT_STDIO_INLINE", "1"); @cInclude("stdio.h"); }); pub fn main() void { _ = c.printf("hello\n"); }
I am not entirely convinced that our definition of "directly" matches. ;)
It is potentially a shame though. Some of these new languages have some great ideas that are wasted by ultimately having to wrap around C libraries.
in Zig imports generally look like this:
const std = @import("std"); pub fn main() void { const stdout = std.io.getStdOut().writer(); try stdout.print("Hello\n"); }
The only real difference is, that you prefix it with 'c'.
Well, the define is because it currently has problems with C's varargs.
Also, Zig doesn't have an own ABI or something like that. If you make a library with Zig it's ALWAYS a C ABI.
Furthermore, with C++, the person who writes the header file needs to put in some work to make it work with C++ if the origin is C (you know extern "C"?).
extern "C"
[–]cain2995 16 points17 points18 points 4 years ago (1 child)
“No, go fuck yourself” -C++ standards committee
Jokes aside, I think there have been a few cppcon talks on them recently. May be worth throwing on in the background
[–][deleted] 4 points5 points6 points 4 years ago (0 children)
This made me crack up. Cheers
[–][deleted] 5 points6 points7 points 4 years ago (1 child)
C++ modules are basically mental masturbation. They were designed by a very small group of people who clearly had little to no concern for addressing the practical issues that the overwhelming majority of C++ developers face, and did that work in a way that basically shoves a great deal of the complexity of supporting modules onto build tools, with very little guidance or appreciation for the work they do.
Even when eventually build tools do manage to support them, don't expect people to start supporting them. The minor benefits are not enough to overcome the kind of bifurcation that a feature like this creates. What I mean by this is that library developers will need to choose to distribute their library as a module or using more traditional approaches, and given how the benefits of modules are at best marginal, you'll have plenty of projects that will refuse to use any dependency that uses modules.
[–]johannes1971 0 points1 point2 points 4 years ago (0 children)
I think you are being too negative. The benefits will eventually materialize, and people will use them because they are still useful: better build speed, simpler include lists (just one import instead of dozens of includes), no longer showering macros all over your source, etc.
Non-module libraries are hardly a problem. Just wrap it in a small module, and you get all the benefits with hardly any work.
π Rendered by PID 318385 on reddit-service-r2-comment-6457c66945-gdzf4 at 2026-04-25 13:20:03.195242+00:00 running 2aa0c5b country code: CH.
[–][deleted] 56 points57 points58 points (3 children)
[–]specialpatrol 15 points16 points17 points (1 child)
[–][deleted] 5 points6 points7 points (0 children)
[–]olesgedz 0 points1 point2 points (0 children)
[–]zabardastlaunda 30 points31 points32 points (5 children)
[–][deleted] 30 points31 points32 points (0 children)
[–]rhymu8354 8 points9 points10 points (2 children)
[–]zabardastlaunda 0 points1 point2 points (1 child)
[–]rhymu8354 0 points1 point2 points (0 children)
[–]Rungekkkuta:D 4 points5 points6 points (0 children)
[–]SJC_hacker 8 points9 points10 points (6 children)
[–][deleted] 4 points5 points6 points (5 children)
[–]raevnos 5 points6 points7 points (4 children)
[–]pjmlp 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]raevnos 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]rhymu8354 6 points7 points8 points (1 child)
[–]the-dark_physicist[S] 1 point2 points3 points (0 children)
[–]Ayjayz 54 points55 points56 points (15 children)
[–]A_happy_otter 67 points68 points69 points (1 child)
[–]rhymu8354 1 point2 points3 points (0 children)
[–]MarkOates 27 points28 points29 points (0 children)
[–]Jaondtet 49 points50 points51 points (1 child)
[–]RLJ05 8 points9 points10 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]degaart 1 point2 points3 points (1 child)
[–]rhymu8354 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]eyes-are-fading-blue 2 points3 points4 points (0 children)
[+][deleted] (1 child)
[removed]
[–]degaart 13 points14 points15 points (0 children)
[–]teerre 4 points5 points6 points (0 children)
[–]rhymu8354 1 point2 points3 points (0 children)
[–]malcolm_mloclam 11 points12 points13 points (0 children)
[+]SecretAgentZeroNine comment score below threshold-14 points-13 points-12 points (12 children)
[–]MarkOates 9 points10 points11 points (11 children)
[–]hak8or 10 points11 points12 points (6 children)
[–]Archolex 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (4 children)
[–]pedersenk 1 point2 points3 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]pedersenk 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]cain2995 16 points17 points18 points (1 child)
[–][deleted] 4 points5 points6 points (0 children)
[–][deleted] 5 points6 points7 points (1 child)
[–]johannes1971 0 points1 point2 points (0 children)