Are there any relatively-simple open source projects that are written in C++?
Posted by gh_1qaz@reddit | learnprogramming | View on Reddit | 13 comments
Hi. I'm currently learning C++ and I almost finish learning grammar of it for the first time. The language is pretty challenging to me as there are a lot of types/concepts that are new for me, and since I don't have the faintest idea why those are useful, I would like to read the actual code that primarily use C++. I tried to look up some codes myself, but most of the projects I was able to find just by simple googling were too hard for me as those used multiple files and I couldn't even figure out where to start.
So, my question is, do you happen to know any open source projects that have relatively simple structures that are easy to understand? Thanks in advance!
throwaway6560192@reddit
A lot of KDE apps.
emmaexe_@reddit
I wouldn't call Qt + CMake "somewhat simple" for someone who just started.
throwaway6560192@reddit
CMake is very widespread in C++. You'd be hard-pressed to find a real-world C++ project that doesn't use it, or some other build system of similar or worse complexity.
You don't really need to understand CMake at any depth to understand or contribute to the code, tbh. When I started contributing to KDE I didn't know jack about CMake.
And, if they're on Linux, KDE has a tool which abstracts away even having to run CMake commands.
spinwizard69@reddit
You might be going too fast here. Id work on getting real good at simple coding projects first.
You are right that eventually reading the code of others is important as is developing the skill to enhance it. The trouble is there is not much simple code out there im aware of. XCas is a one possible bit of C++ code worth studying if you are into math. In any event Google is your friend.
rustyseapants@reddit
What do you mean by "I'm currently learning C++?"
Striking_Rate_7390@reddit
OP is talking about the tutorial hell!!
rustyseapants@reddit
Oh.
Got it.
dinomacucule@reddit
Yeah, most big projects are overwhelming at first.
Try looking at smaller stuff like algorithm repos (like “TheAlgorithms/C++”) or simple command-line tools — those usually have cleaner structure and are easier to follow.
Also, don’t try to understand the whole project at once. Pick one file, figure out what it does, and go from there
setq-default@reddit
You should poke through the imgui source tree. Its whole thing is that you're supposed to read through the header files to figure out how to use it, so the code is well-structured.
Delicious_Sport_4125@reddit
bro you should check raylib - it's a C++ graphics library that's super beginner friendly. the examples folder has tons of small programs that show different concepts without being overwhelming
also maybe try looking at some command line utilities on github. things like simple file managers or text processors usually have cleaner structure than big GUI applications. i remember when i was learning, jumping into game engines was mistake - too many abstractions at once
start with projects that solve one specific problem rather than trying to understand entire frameworks. once you get comfortable reading smaller codebases, moving up to bigger ones becomes much easier
setq-default@reddit
Raylib is written in C not C++
Much_Managed1996@reddit
you might want to look at small utilities instead of full apps, things like mini json parsers, command line tools, or basic data structure libraries, those tend to have clean structure and fewer moving parts
x-ca@reddit
Find a repo on Github written in C++ based on your interests.
Find a way to make it better by forking it or from scratch.
Repeat.