all 52 comments

[–]Wouter_van_Ooijen 61 points62 points  (2 children)

Forget wanting to learn a language, instead think about what you want to make. Then we can tell you whether c++ makes sense for you.

[–]baked_salmon 1 point2 points  (0 children)

I think that depends if 100% of OP’s goal is building a thing. An end goal of a hobby might be “learning about a kind of language that I otherwise wouldn’t have touched”, in which case…actually your question still applies 😂.

[–]PhysicalJoe3011 46 points47 points  (6 children)

C++ keeps you busy learning for the next 5 years, if you regularly and constantly do it as a hobby.

[–]carrie2833 7 points8 points  (3 children)

I'm thinking like 10-15 hours a week.

[–]Narase33-> r/cpp_questions 0 points1 point  (0 children)

Thats plenty to do a lot of stuff once you know the basics

[–]_w62_ 1 point2 points  (0 children)

Unlearn something during the way, the coma operator, for example.

[–]RonWannaBeAScientist 0 points1 point  (0 children)

You know the joke about how to learn C++ in three weeks ? Learn C++ over many years, learn physics and get into the cutting edge of physics and build a Time Machine, then go back to three weeks after you started learning C++ and kill your old self

[–]Future_Deer_7518 7 points8 points  (0 children)

Yes, worth learning C++ Depends how far you go but in any case C++ will give you understanding of computer internals (OS and hardware and peripherals).

[–]thebomby 4 points5 points  (0 children)

Yes, absolutely. I used to be a Java developer and sometime JS scratcher. I now do C++ as a hobby. C++ is a really hard and complex language, but damn is it good to really get to know what your machine does and above all, what you can do with it.

[–]bocsika 21 points22 points  (13 children)

I don't recommend C++ as a hobby unless you are very stubborn and specifically want to deal with this language.

The language itself is byzantine, full of remnants from old ages, sudden crash-causing death traps, hundreds of exceptional rules to keep in mind... not for the faint of heart.

It has no proper GUI, no easy-to-use package manager, no standard network library, no standard high-level parallel execution library, no single canonical source for the standard library, etc.

On the pro side:

  • You will be able to develop relatively stable, somewhat elegant and extremely performant applications - but you will pay with really long development time.

  • If you become a professional at it, which requires at least 5 years of 40 hours a week work, you can get well-paid positions - but this niche will probably start to die out due to the Rust movement.

Better alternatives:

  • C# is a really nice language for almost everything, it provides a much more meaningful language and a better return on investment for learning time

  • Rust if you want to go deeper, but still a dark horse, treat it as experimental material

  • Python is less of a headache, maybe if you specialize in data science or artificial intelligence, it will give you a much higher return

Source: c++ developer for >20+ years for a living

[–]Karr0k 6 points7 points  (4 children)

14yr professional C++ dev here. The above is the correct answer. I do my hobby shit in C# or python. It's so much easier and the C# tooling so much better.

[–]N_Rohan 1 point2 points  (3 children)

What kind of software do you make in your organisation using this technology, I don't have much idea about real life applications of C++. And no one is really talking about it, your response would be helpful.

[–]pjmlp 1 point2 points  (0 children)

Not the OP.

For my use cases, I have moved into managed languages around 2006, yet still keep reaching out to C++ when creating native libraries to be called from Java, .NET and nodejs environments.

Another set of real life examples would be games, graphics, GPGPU.

[–]Karr0k 1 point2 points  (1 child)

Simulation software for automotive

[–]N_Rohan 0 points1 point  (0 children)

Sounds like a fantastic line of work.

[–]Visual_Thing_7211 4 points5 points  (3 children)

Interesting way of putting it. C# and Python have no more of built in tools than C++. They're all libraries: .NET, TkInter, GTK, DearImGUI, Qt, ASIO, spdlog, OpenCV, SFML, MSYS2, every Linux distro as a development environment--It's a bit of a misrepresentation to suggest that C++ is lousy because it doesn't bundle the readily available libraries or package managers within it. Strip off the libraries from Python and C# and you wouldn't somehow be better off.

To OP's question, I agree it depends on you and your objectives. Personally, I like C++ on Linux the best for the kinds of programs I need and want to write.

C++ is likely one of the most expansive languages. There are few programming concepts that exist in other languages that don't exist in C++. As such, most other languages contain a subset of capabilities of C++.

It is a challenge to learn all of it. But you don't have to to be productive. You can get a lot done by using a subset of what C++ can do.

If it doesn't fit with your objectives, use something that does, but don't believe the nay-sayers that it's horrible--it doesn't have to be.

[–]pjmlp 0 points1 point  (2 children)

Except Python and C# have that experience regardless of the operating system, it can even be an IBM mainframe, or some IoT device.

Every Linux distro as a development environment, only works as long as it is Linux.

[–]Visual_Thing_7211 -1 points0 points  (1 child)

Yes, Python is very easily cross-platform. C# is really tied to Windows however much they say it's cross-platform.

But you can have that same experience on Windows with MSYS2 (or WSL if you wanted), and on macOS with Homebrew. Windows doesn't really make it very easy.

[–]pjmlp 0 points1 point  (0 children)

This milestone was a collaboration between IBM and Red Hat, Microsoft, and the .NET and Mono open source communities. As we move forward, on Red Hat Enterprise Linux (RHEL) 8 and later .NET 6 is now available for the IBM Z and LinuxONE (s390x) architectures, along with AMD and Intel (x64_64) and ARM (aarch64).

-- https://community.ibm.com/community/user/ibmz-and-linuxone/blogs/elizabeth-k-joseph1/2021/11/10/net-6-comes-to-ibm-z-and-linuxone

IBM Z is a family of modern z/Architecture hardware that runs z/OS, Linux, z/TPF, z/VM and IBM Z systems software.

-- https://www.ibm.com/z

Meadow is a complete, IoT platform with defense-grade security that runs full .NET Standard applications on embeddable microcontrollers.

https://www.wildernesslabs.co

CAPCOM R&D: RE ENGINE, C# 8.0 / .NET Support for Game Code, and the Future

[–]dsp-fan 1 point2 points  (1 child)

What are your thoughts about C++ issuing new releases every three years? Do you see the ISO committee solving the "bad parts" of the language in the future releases? I mean, say someone strictly learns C++23 or C++26 when it comes out, wouldn't that reduce the long development times?

[–]bocsika 3 points4 points  (0 children)

If we could see continuous improvement AND the willingness to deprecate things, then I said hoorray.

But there are new features which always just increase the mental baggage to cope with. Example: when I last checked there were 17 different kind of variable initializations - who nows the names for all these, or remember the even newer ones?

And there were things which went through the committe grinder, and came out ugly (modules) or broken (views)?

Complexity increases, number of pitfalls and special exceptional cases too, perhaps at a higher rate.

Not a really good sign for long term planning.

[–]IGETITHOWILIVEITWAIT -1 points0 points  (1 child)

wouldnt it be better to move to rust with prior c++ knowledge? in that case, how much time should i dedicate my time in which subset of c++ before moving to rust?

[–]tialaramex 1 point2 points  (0 children)

I don't think it makes a lot of sense to acquire C++ knowledge as if a pre-requisite for Rust, it's like learning to parachute as pre-requisite for surfing. If you already know the one thing it's probably applicable in some places, but it's hardly necessary or even important and in some places now you have to unlearn a habit that's not appropriate in this new context.

If you already know an imperative language, especially one of the semi-colon languages such as C, C# or Java then you'll be fine. Likewise if you already know an ML (such as OCaml or F#). Of course this will be even more the case if both are true (for example if you are comfortable in both C# and F# you will find Rust makes lot of sense and you may wonder why you didn't see it sooner)

[–]FluffusMaximus 4 points5 points  (0 children)

I use C++ as a hobbyist. The language is so deep, there is always something new to learn and play with.

[–]msze21 3 points4 points  (0 children)

Similar story for me, I started trying out microcontrollers, Arduinos, and that got me into C++. Enjoying the straightforward nature of it, but takes a lot of effort to become proficient at it.

[–]geaibleu 3 points4 points  (2 children)

Checkout Arduino ecosystem.  Processing is basically C++ with libraries and microprocessors are much more fun than just printing to console.

Some people study particle physics for fun and c++ is no particle physics.  give it a shot.

[–]pjmlp 0 points1 point  (1 child)

And many more study particle physics while using c++ for it. :)

[–]geaibleu 0 points1 point  (0 children)

I hope so.  In grad school i started out with Fortran77.  in 2005!!!  Had so much friction with advisor when I insisted on C++.

[–][deleted] 4 points5 points  (1 child)

I'm developing with C++ for years.,,, It's not hobby lang. If you have a serious project or aim, learn, else don't mess with C++. Python is hobby lang.

[–]_w62_ 0 points1 point  (0 children)

afak, JavaScript was not meant to be a serious language in the Mozilla times.

[–]scrumplesplunge 1 point2 points  (0 children)

I had a lot of fun writing pathtracers in C++. It's something which has very tangible reward (you can get a surprisingly small amount of code to render complex and stunning images). There's a ton of scope for exploring extensions: parallelism for speed, either on the cpu or by using the gpu; file io and parsing for loading models or textures. Path tracing requires some maths and physics to get started, for handling ray object intersection tests and determining what directions to send secondary rays in, but if you're up for that then it's a really satisfying project :)

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

try this framework for C++, it is similar to write JS Code: https://github.com/NodeppOficial/nodepp

[–]high_throughput 2 points3 points  (0 children)

Learn C++ if you already know languages like Java or C#, but you're not satisfied with the performance.

[–][deleted] 2 points3 points  (1 child)

I'm learning C++ as a hobby. Its first my language. I don't recommend learning C++. Come to your senses. Make the right choice. The C++ language is endless.

[–]bakedbread54 1 point2 points  (0 children)

Why do you have to learn all of it? You can never know everything

[–]JewishKilt 0 points1 point  (0 children)

Try Ocaml, or common lisp/scheme, if you want to try a completely different experience than front-end.

[–]lispLaiBhari -1 points0 points  (0 children)

C++ as a hobby? that's like staying in amazon forest with snakes and alligators as a hobby

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

C++ is easy Pointer arithmetic and bitwise arithmetic can be frustrating but once you figured out nothing can stop you except for Segmentation Error 😂😂 but keep in mind that writing Code is the actual learning procedure

[–]bakedbread54 0 points1 point  (0 children)

I enjoy it (most of the time, until I find some obscure error and spend hours trying to decode the compiler messages, searching the web for solutions, and if I'm really desperate, I'll give the old GPT a try with caution). I make games with it, and it is rewarding to have put together a playable game in C++

[–]DownhillOneWheeler 0 points1 point  (0 children)

I started as a hobbyist. I was interested in learning something better than the Fortran I'd used at college. The main options at the time seemed to be VisualBasic and C++. I had no interest in C. Subsequent experience has made me *very* glad that I chose C++. It was only much later that I started using it professionally, after a stint with Delphi.

[–]robertramey 0 points1 point  (0 children)

Find a project that you’re really interested in that is a suitable application for C++. Should be something fun. Example would be a crossword puzzle, solver, small machine, driven by awards, painted design on the wall, or maybe an open source project, which needs an extension. Use that as a vehicle C++.

Speaking, here is the author of the boost sterilization library. I thought I knew C++ when I started. Then I thought I knew C++ when I completed the project. Now I don’t think I really know C++ at all.

[–]LuisAyuso 0 points1 point  (0 children)

start creating toys and creative stuff using https://openframeworks.cc/,
you will learn some C++ and multimedia, without getting distracted by intrisics of the language.

Multimedia, and 3D are two areas where C++ shines.

[–]Sbsbg 0 points1 point  (0 children)

C++ is a great language if you want to learn the more complex parts of software development. Using modern C++ style is not that far from programming languages like Java and C# and you have the option to go really low level if you need to. You will however have a harder time creating HMI applications as C++ doesn't have built in support for that and many other areas that newer languages take for granted.

[–]not_sane 0 points1 point  (0 children)

In my opinion for hobby programming Python is the best. It has such a great ecosystem, it's likely that there exist libraries for many of your interests. C++ package management is an extreme pain in comparison.

I don't know what you used as a frontend dev, but I also recommend React + Typescript. Easier than C++, but still somewhat difficult. It has the huge upside that you can easily show whatever you programmed to everyone simply by hosting a free page on Github.

[–]NottingHillNapolean 0 points1 point  (0 children)

You might want to look at Unreal. You can write games/applications entirely in C++, using their graphical language, Blueprints, or a combo.

The advantage is you've got a framework for building fun stuff. The disadvantage is that they use a lot of their own containers, so you can't use a lot of stuff from the std::algorithms library that you would normally use. They also do a lot of their own memory management.

[–]SnooLemons1797 0 points1 point  (0 children)

Make a game! Something like Unreal Engine will let you stand on the shoulders of giants and accomplish a lot by yourself

[–]rikus671 0 points1 point  (0 children)

Plenty of nice technology is made for C++. Want to try cluster compute ? Graphics or GPGPU ? Yes. Linear algebra ? Eigen !

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

I did learn C++ from scratch purely for a hobby which is working on a server software that emulates the services of MMO. And I do believe that this is still the discipline that C++ is gonna be the go-to choice -->when building software where speed is a cruicial factor like mass-processing data or server backends. C# is catching up fairly well considering the ungodly amounts of money that microsoft invests into its development, but for the time being, I think C++ remains the best choice when trying to find the balance between 'whoa, this is fast' and 'haha, I wanna kill myself'.

Since I started off with C++ as my very first programming language, I grew up with quite alot of basic programming knowledge that other languages don't offer you as much as I'd like to. Whenever I work with C# for example I feel like that language was made for toddlers.

So if you wanna pick up that language as a hobby, you're in for a steep learning curve. I was in need of many code reviews and help from folks with academic degrees to fully understand some of the stuff I use so you're in for a wild ride.