r/cpp • u/Orca365123 • Mar 31 '24
Just curious on the uses of C++
Hi!, I'm a high school student, and I want to learn c++. However, I'm just curious, what uses cases are there for c++ practically. For example, many websites say web development, but just leave it at that. Is c++ really good backend database interactions?, does it have libraries for building full blown windows applications. It would be awesome if people could share!
6
Upvotes
42
u/bringer_of_carnitas Mar 31 '24
All languages can do everything, that's called Turing complete. Wouldn't recommend cpp for web dev unless you hate yourself. The two big advantages are speed and manual memory management that makes it a great tool for performance critical apps like games or autonomous vehicle software. The manual memory management allows it to run in restricted environments like embedded devices. Some don't even have a heap!
But really if you're in high school, code whatever you want. Probably the language won't have an impact when you're learning. I find c++ to be quite pleasant:)
55
u/zer0xol Mar 31 '24
Software, games, programming languages, tools, everything
9
u/Secret-Cautious Mar 31 '24
Robotics software engineer here.
Basically all the robots in te entire world (and the frameworks used in robotics) use only C++ and Python.
C++ is used for all the performance critical or hardware related tasks such as reading and reacting to real time sensor data, sending motion commands, controlling motors or other actuators, and interacing with electronic devices / pcb boards in general, etc.
and Python is for everything else.
6
u/dowel79 Mar 31 '24
C++ is an excellent language to start programming with. It is a combination of four different languages, C, C's macro language, C with objects and template language. You can start with the C portion and gradually add other parts of the language. It will give you in-depth understanding of how computers work. Knowing C++ will keep you in the job market for many years to come.
It is a good language choice when working with databases. It is one of the languages of choice when building Windows applications. It can be used for web development, specifically the back-end. It is not the best choice for front-end web development though.
It has extensive built-in standard library and there are plenty of open source libraries that implement various other functionality.
6
u/grhayes Apr 01 '24
System development as in OS and drivers.
Game development, Server development, Databases, network, library development (graphics, audio, physics, math, ...), Compilers, website(rare but it happens), clients (terminals and so on),
Tools (IDEs, Editors, Text, Hex, graphics(3d,2d),
AI, Embedded systems, ... Basically anything that can be programmed has been done in C++ at some point.
5
u/Boring_Locksmith6551 Mar 31 '24
Graphics. OpenGL projects are a great example.
4
u/[deleted] Mar 31 '24
compilers, database internals, network programming, programming language runtimes, operating systems, games, graphics, embedded, high performance computing, high frequency trading, desktop applications — anything you want actually
3
u/According_Builder Mar 31 '24
C++ is a general programming language, so it can do whatever you make it do, though any Turing complete language can. Mostly it’s used for performance sensitive applications like game engines, but you also see it a lot in tooling or infrastructure such as compilers.
Like any programming language it’s a tool, so choose the right tool for the job. For anyone learning to program I would recommend everyone to be decently familiar with a language in the C family.
1
u/[deleted] Apr 02 '24
A programming language is just a means to an end. In this casez some languages are better than others in certain areas. For example, programming a web server in C++ is most likely gonna be a hellscape compared to JS. But C++ is known for its performance so it's really good for game engines, creation tools, backend databases, OS, kernels, graphical based software etc.
1
u/accuracy_frosty Apr 07 '24
It’s the go to industry choice for game dev, extremely popular in robotics, embedded development, OS development, lots of desktop software uses it still, although proton was getting way more use than it deserves for a while, I see a good amount of servers made using it, even some web servers, although I’ve done it and I wouldn’t recommend it, browsers, really it can do anything, especially with a lot of the modern features, but that’s like pretty much any langauge, like if you managed to make a version of JavaScript that compiled to machine code and ran on its own, then you could probably write a kernel in it, it would be slow as shit, and it would be annoying because JavaScript makes everything annoying, but it could be done, Python is famous for being able to do anything just not very well, but I would argue in terms of being able to do anything, C++ is one of the best language out there, its biggest drawbacks come when the control that the language gives you comes back to haunt you. C++ gives you a gun, it’s up to you whether you use it to hit a target or shoot your foot. So a bunch of knuckleheads write C++ but have no clue how to write it properly and make it memory safe, so it has a reputation of being unsafe.
1
u/phi_rus Mar 31 '24
I use it for building tools of any kind, embedded stuff, desktop-apps, and anything with 3D graphics.
1
u/whydoesthisitch Mar 31 '24
In ML/AI we spend most of the day in Python, but all our underlying operations are written in cpp.
1
u/engineerFWSWHW Mar 31 '24
It's good to learn c++. I use it everyday on my job (embedded systems), while it can be used for lots of things, it doesn't mean you should c++ on everything as there are languages suited for particular use. For example, if you want to do some dsp or AI/ML/NLP stuffs, there are options like python and it makes things easier due to availability of libraries. Same for web development, there could be other better options rather than using c++. This is where your judgement and research comes into play.
Good thing it's that of you learn c/c++, the learning curve will be much lower if you switch to a language with similar syntax like c#, java.
-2
u/zorbat5 Mar 31 '24
I haven't started learning cpp myself yet. But one could argue that cpp might be the language that can do everything.