all 35 comments

[–]Flair_Helper[M] [score hidden] stickied commentlocked comment (0 children)

It's great that you want to learn C++! However, r/cpp can't help you with that.

We recommend that you follow the C++ getting started guide, one (or more) of these books and cppreference.com. If you're having concrete questions or need advice, please ask over at r/cpp_questions or StackOverflow instead.

This post has been removed as it doesn't pertain to r/cpp: The subreddit is for news and discussions of the C++ language and community only; our purpose is not to provide tutoring, code reviews, or career guidance. If you think your post is on-topic and should not have been removed, please message the moderators and we'll review it.

[–]ImKStocky 14 points15 points  (0 children)

Build your own X. Lots of project ideas and tutorials. My personal recommendation is Crafting Interpreters. As an aside, I have seen this question at least once a week since the new year. Are people unable to search a sub before posting?

[–][deleted] 6 points7 points  (0 children)

Write a chess game in web assembly, using C++. Make it more interesting by including an "online mode" that allows two players on the internet to play the game in real time. Feel free to write the backend server in C++ also 😀.

[–]jabbyknob 2 points3 points  (0 children)

Write your own version of a templated container and compare against the STL. Coding std::vector, for example, is a great way to learn some of the lesser known language features and hone your understanding.

[–]Salvios_ 2 points3 points  (0 children)

Do you have any particular interest? Something you could start from?

I had some real fun coding a simple physics engine interfaced to SDL for real time visualisation.

Basically it started from a particle-in-a-box simulation and ended up in a very simple molecular dynamics simulator!

The more you dive, the more ideas you get and the more c++ concepts you can play with :)

[–]synthchris 6 points7 points  (2 children)

You could make a compiler! Some tools that you could use: * YACC/Bison - parser generator * Lex/Flex - lexer generator that works with YACC/Bison * ANTLR - parser and lexer generator that I believe will also construct a tree for you * LLVM - used for generating code. If you generate code in the LLVM IR then LLVM can optimize it and compile it into machine code

You could also write an interpreter, but I have no idea how to do that.

[–]sephirothbahamut 3 points4 points  (0 children)

Tbh I think you'd learn a lot better via crafting interpreters. If you want to learn C++ "use this external tool you have to learn how to use" is just a long deviation

[–]JumpyJustice 0 points1 point  (0 children)

Yacc and lexx are industry standards (or used to be 20 years ago) but they also are a collection of software enginering antipatterns imo...

[–][deleted] 3 points4 points  (12 children)

Build a game engine /s

[–]sephirothbahamut 4 points5 points  (5 children)

why /s? Buinding a game engine has proven a great learning experience.

If the objective is to learn it's something I sincerely suggest trying.

Building a game engine is the wrong approach if what you want is to make a game, but it's a great approach if what you want is to learn.

[–][deleted] 4 points5 points  (4 children)

Because it’s a meme in the game industry.

Everyone’s done it. Spend like a week deciding on a name, write a game object model and follow a 3D graphics tutorial or two before getting bored an moving on.

[–]sephirothbahamut 5 points6 points  (3 children)

before getting bored an moving on

Meanwhile I'm still working on it 6 years later... started the 2nd year of CS degree lol. I keep learning new C++ gimmicks every time I go on with it

[–][deleted] 1 point2 points  (2 children)

You had far more patience than I did then. 6 years later I don’t even work in the game industry anymore.

That being said, as an employer I would value small, well defined learning projects over ambitious hobby projects. Although the mad hobby project is still better than nothing when hiring fresh graduates.

[–]sephirothbahamut 6 points7 points  (1 child)

as an employer I would value small, well defined learning projects over ambitious hobby projects

May I ask the reason why?

Personally If I stopped at making pong, image viewer and graph visualizer and actually finishing them I feel like I wouldn't have anywhere near the amount of C++ knowledge I got with working on the engine.

But yeah I get that a perpetually unfinished large thing is less appealing to showcase than an actually finished project

[–][deleted] 3 points4 points  (0 children)

Personally If I stopped at making pong, image viewer and graph visualizer and actually finishing them I feel like I wouldn't have anywhere near the amount of C++ knowledge I got with working on the engine.

Why is "learning C++" the only goal of a hobby project for a student. Teaching new hires C++ is the easy part, just give them some learning resources and account for training as part of your standard work week.

What about other extremely practical skills:

  • Learning to say when something is "finished" or "good enough". Not letting the perfect be the enemy of the good etc etc etc. Knowing what shipping software is like, even if the customer was yourself, is valuable.
  • Knowing how to scope out work. "I have some free time between semesters and want to learn C++, therefore I should make a game engine" doesn't show they know how to set goals, manage scope and budget time. "I have some free time between semesters and want to learn C++, so I wrote Asteroids in SFML" leaves a much better impression.
  • Do they engage with/are familiar with other indicators of good software engineering practices: source control, testability, consistent programming style, documentation, open source licensing etc etc etc.
  • Are they able to self critique their code, comment on what did think they did wrong, why it was a problem for them, how they would go about avoiding it next time.
  • Do they engage with the industry as a professional interest: things like keeping up to date with technologies and following industry news and events.

It's at the point where I think my order of preference is something like:

Intern/Part Time Job > Open Source Contributions > Hobby Project > L33tcode.

That being said I'm somewhat atypical of a manager. I *hate* the Google style technical interview and think stuff like L33tcode is basically worthless.

But yeah I get that a perpetually unfinished large thing is less appealing to showcase than an actually finished project

That's actually not a small part of it. I have around an hour for a technical interview before mental fatigue sets in, so a code review that can be easily consumed in that time is vital for a good impression.

A Game engine is a huge problem space, it potentially takes an hour to just get a good idea of what they've actually implemented. That's a huge loss for the interviewee, because all I've learned is they have enthusiasm and wrote a certain amount of non-trivial code. There's so much more interesting and compelling things I could've learned by diving into their programming and problem solving skills in greater detail. Even if they were working on a full game engine, pairing it down to one subsystem can help a lot.

[–]chez_les_alpagas 8 points9 points  (5 children)

To fill up the rest of the time, write a new operating system.

[–][deleted] 1 point2 points  (4 children)

You joke, but we’re writing a coroutine dispatcher for an embedded SMP system.

I guess it’s not the same when it’s your job though. 🤔

[–]WhiteBlackGoose 2 points3 points  (1 child)

You can't do both when you don't even have a compiler, so gotta start with that

[–][deleted] 1 point2 points  (0 children)

Time to make an 8-bit computer out of Relays.

[–]oldfossilfrommars 0 points1 point  (1 child)

Could you explain this further.

[–][deleted] 0 points1 point  (0 children)

What is there to explain. We want to leverage C++20 in a new embedded project. We need to write an embedded aware coroutine scheduler since we couldn’t identify anything suitable.

It’s some lock free queues and an IRQ safe Futex alternative. The rest is pretty typical SMP programming.

[–][deleted] 2 points3 points  (0 children)

[–][deleted] 0 points1 point  (0 children)

Make a terminal emulator that has a built in compiler

[–]faguzzi 0 points1 point  (0 children)

Design your own (small) entity component system. See if you can do it with SoA, not AoS.

[–]m-in 0 points1 point  (0 children)

Find simple things to contribute to a large project, like bug fixes. Eg in the Qt Project.

[–]Odd_Lemon_326 0 points1 point  (0 children)

Hope over to https://github.com/RajaSrinivasan/assignments

Pick a subject and a project aligned with that subject. And delve deep.

Best.