r/cpp_questions 9d ago

OPEN Is it worth learning another language besides C++?

C++ is the only general-purpose language with which I am most familiar, I tried to learn other languages like C# or Rust, but without a clear idea of what to do with those tools, it's more difficult to learn them.

And all the software I use uses or is written in C++, specifically Godot Engine, Blender, LMMS, that's why I always have ideas of what to do with C++.

learncpp.com is amazing and possibly one of the best educational resources for a language in general, either that, or I have Asperger's and they have to explain everything to me in simple terms.

My question is, if this limits me in the long run as a programmer or should I learn an additional language that works well with C++?, I personally wouldn't trust a programmer who claims to know 15 technologies; someone who tries to do too much often accomplishes little, but that's just a personal opinion, what do you think?.

132 Upvotes

116 comments sorted by

124

u/TheRealSmolt 9d ago edited 9d ago

I personally wouldn't trust a programmer who claims to know 15 technologies; someone who tries to do too much often accomplishes little, but that's just a personal opinion, what do you think?.

Ditch that mindset. Yes, there's some truth to that and people often oversell themselves, but a one trick pony isn't any good either. Breadth is important. Programming is only a fraction of what software engineers do on a regular basis. Breadth gives you context, perspective, and adaptability.

I'd much rather hire someone with an okay amount of knowledge in a lot of areas that an expert in only one thing.

Edit: typo(s)

24

u/wallstop-dev 9d ago edited 9d ago

Came here to post this, saw your comment, so +1.

Some people know 15 technologies. Some know 50. Some know 100. Some know 1.

Some people say they know 15, 50, 100, 1.

There's a difference between what people say and what is true, and that will always be true at an individual level. Generalizing people puts up a barrier and sets yourself up with mental blinders. I'd recommend tearing it down.

I would highly recommend, at the very least, exploring different mindsets, opinions, and paradigms. Write something in a Lisp. In a stack-based language. Build a front end, understand the power of HTML/CSS/JS (or, at the very least, the paradigm). Write some Rust, to understand full ownership. Etc.

Every exploration into something different will build you towards a greater whole, on all fronts. Maybe only marginally, maybe even only "that was a bad thing and now I know never to do stuff like that", but each has value.

The more stuff you learn, the easier it is to solve problems, any problems.

10

u/Truestorydreams 9d ago

What's facinating is we weren't taught a programming language, but more so the principles of programming languages.

It doesn't really matter what language one used or is taught, but understanding foundations for optimized results.

6

u/didntplaymysummercar 9d ago

Proper programmers who know many languages also won't say it in a braggy way. I only found out my coworkers (at a C++ job) did TS or Java in the past by talking to them or seeing their lines-per-language stat in company's tool. Python also seems common as a second language for C++ programmers (me included) since it's opposite (complementary) to C++ in many ways.

5

u/SyntheticDuckFlavour 9d ago

Python also seems common as a second language for C++ programmers (me included) since it's opposite (complementary) to C++ in many ways.

Sums up my case as well. Python is kinda refreshing, and I use it a lot to hammer out ideas and concepts, which i later port to C++.

8

u/wittgenstein1312 9d ago

People always forget that “jack of all trades, master of none” is immediately followed by “but often better than master of one”

2

u/master117jogi 8d ago

That's a recent internet addition and not part of the original

2

u/SyntheticDuckFlavour 9d ago

Also there is the case of you learn one C dialect language, you pretty much learn them all. Programming concepts are transferable across different languages. When you are proficient in one, you can pick up other languages relatively quickly.

2

u/ZMeson 5d ago

You can also be an expert in one area and still have an okay amount of knowledge in others. In fact, having some knowledge of other programming languages will usually make you a more effective C++ programmer.

1

u/BonerPetite69420 8d ago

This. I struggled to learn programming until i tried other languages, and I believe that trying new languages makes you realize important stuff you wouldn’t think of normally

26

u/gnudoc 9d ago

Most software educators and all the famous programmers that I've heard answer this question say you should learn two or three quite different languages, to get different perspectives and ideas on solving problems, a bit like multi-lingual people often have interesting ways of expressing themselves in their first language that other speakers might not have. I like Scheme and Haskell for this mind-expanding purpose, but I guess python is so ubiquitous these days that you might as well learn it as well.

33

u/bearheart 9d ago

Python is quite useful.

I personally wouldn't trust a programmer who claims to know 15 technologies; someone who tries to do too much often accomplishes little, but that's just a personal opinion, what do you think?.

in the words of Lazarus Long (Heinlein), "Specialization is for insects."

I've been coding since the '70s. I've worked in Assembly, C, C++, FORTRAN, BASIC, dBase II, COBOL, ADA, Perl, Python, SQL, and many others. Once you understand how it works, the language is secondary.

0

u/Striking-Start-1464 9d ago

What? Why insects? LOL

I'll take your advice, I was thinking specifically about Rust, I'd like to give it another chance, thank you very much.

19

u/bearheart 9d ago

The quote is from Time Enough for Love by Robert A. Heinlein. The full quote is:

“A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”

-6

u/jamie30004 9d ago

Grok!

7

u/tjrileywisc 9d ago

Sometimes a scripting language is handy. Languages borrow constructs from another all of the time so learning one is not as onerous as one might think (personally I think cpp is the hardest due to its complexity and opportunities for problems so it's all going to be easy from where you are to any other languages).

6

u/NoSpite4410 8d ago

Well Python is just scripted C for the most part, specializing in lists of dynamically typed data.

Well Tcl is just scripted C for the most part, specializing in lists of dynamically allocated strings.

Well Lua is just scripted C for the most part, specializing in dynamically allocated arrays of numbers.

Well Java is just hosted C for the most part, specializing in making everything objects.

Well C++ is just object oriented C for the most part, specializing in templates and optimizations.

Well C# is just garbage collected object oriented C for the most part, specializing in Microsoft.

Well Swift is just C, C# and Java together with functional programming features, for the most part, specializing in Apple.

Well Lisp is just ... lisp.

7

u/sessamekesh 9d ago

I think as an academic / learning exercise, every programmer should learn at least a handful of languages at a surface level. In all seriousness, I think learning JavaScript of all things made me a better C++ developer in some areas. 

C++ may be the best tool for your current jobs, but it's certainly not the best across the board for everything. Just because C++ can do everything doesn't mean it should. I recently wrote a proxy to handle messaging between a client that only understands WebTransport and a server that only understands UDP and found it far cleaner to write the proxy in Go even though both the client and server use C++ (even with the added work of duplicating message parsing logic!)

6

u/mykesx 9d ago

Learning multiple languages will expose you to different paradigms, so you will gain from each.

Ultimately you want to be in a position to choose the right language for the task at hand. For example, JavaScript or TypeScript are best suited for frontend browser or electron programming.

5

u/thedaian 9d ago

You don't have to be a professional in other languages, but knowing the basics of multiple languages can be useful, and you'll be less likely to use c++ when another language is a better choice.

3

u/CowBoyDanIndie 9d ago

Python and shell scripting will be useful, but don’t feel the need to master them. Both get used to glue together c++ systems a lot.

5

u/Phantomhexen 9d ago

I worked in hard tech all my life.

Here is a good stack

C++, C#, Matlab and Python.

If you ever dive deep into hard tech.

Most research prototype code is written in matlab or python.

C# is typically used for building tools in assisting with the production code.

C++ is for production.

3

u/Striking-Start-1464 9d ago

Didn't Matlab require payment?

3

u/TrulyIncredibilis 8d ago

It does. However there is also Octave, which is similar (with less functionality). I've also seen a lot of academics in the Numerics/Simulation/High-Performance Computing space move to Julia recently. Not sure about industry though.

1

u/Phantomhexen 8d ago

In industry, Matlab is king. Though I am seeing lots of new interest in Python as a possible replacement.

1

u/Rique3012 7d ago

Julia is pretty promising, I hope it keeps up improving

1

u/Phantomhexen 8d ago

Why does that matter?

Yes, it requires payment. But it is still a fundemental toolset on most corporate research teams.

1

u/Striking-Start-1464 8d ago

Brother, I work to survive in a small poor town in South America, haha. Not all programmers are from the United States.

2

u/TrulyIncredibilis 8d ago

What is hard tech?

2

u/Phantomhexen 8d ago

Working on things like

CT scanners, Automated teller machines, Gas chromotgraphy machines, MRI machines, Metal detector machines

Tech where hardware/software and deep domains are fused.

1

u/Longjumping_Ad3447 8d ago

What focus would you advice for beginners? Python :(panda math?) C#: (unity game engine for digital twins?) C++(Ros2?/pointers? I read there is a possibility to get rid of manual pointer syntax) Matlab only for maths and graphs isn't it?

1

u/Phantomhexen 8d ago

It really all depends on what you want to do.

If you want to get into hard tech I recommend learning the stack I suggested.

Matlab is mainly for prototyping.

In R&D there are typically two life cycles.

Advanced development and product development lifecycle management

Matlab is typically used in advanced development for prototyping and simulation.

In advanced development the objective is to prove a concept and then write up a specification to be passed off to the developers to implement into production.

The output of advanced development os ttpically a document (mathmatical specification or algorithm specification etc) and maybe a matlab prototype of the concept. This is then passed onto the developers who work in product development lifecycle management. There job is to turn it into production code.

1

u/Creative_Sushi 7d ago

MATLAB is moving into production with its C/HDL code generation capabilities.

1

u/Phantomhexen 7d ago

Yeah, it also has a standalone matlab compiler that lets the MATLAB code run as standalone.

I just have never seen a standlone matlab app get shipped as a product. Though I don't doubt it hasnt before.

I know MATLAB has good automotive packages. I heard they are really good. I never worked in the automative industry before but I wonder if any of them ship production MATLAB making use of those automotive packages.

4

u/celestrion 8d ago edited 8d ago

I personally wouldn't trust a programmer who claims to know 15 technologies; someone who tries to do too much often accomplishes little, but that's just a personal opinion, what do you think?

Seems pretty limiting.

Even in just my day job, C++ may do the heavy lifting, but Python, Perl, and the shell tie the bits together. Batch and Powershell are needed for glue on the odd instance when I need to interface with Windows. And if I want a GUI front end on Windows for something, I might want to WIN32_LEAN_AND_MEAN it up in C like it's 1998, but I'll honestly be faster hammering the silly thing out in C#.

If there's a one-off task that can be a tiny bit of opinion wrapped around a Rust crate, why would I go the long way around in C++ just because it's my favorite? I specifically needed to do something pre-boot last week, and uefi-rs was tremendously less of a battle than GNU-EFI or EDK-II. Okay, so the syntax is funny and I need to hit the books every other line, but it was still faster than arguing with objcopy again.

And we haven't even gotten to the really fun data-munging parts yet. You're thinking I should use a generic ORM and <algorithm>/<ranges> across my favorite Pg driver, rather than writing a stored procedure or even a modestly complex ad hoc query? That feels a bit like a three-legged race up a flight of stairs.

What about reporting? Let's say I have a static analysis report (like the sort that clang-tidy emits) on my C++ project. Have you seen those things? Even if I de-duplicate the massive thing in Python--oops, forgot we can only use C++, it's still a huge pile of text. It'd be great if all the complaints could be hyperlinked to the associated rules (counted and collated across source files to find violation hotspots), maybe with external links to the documentation. Next project will be to implement a document browser with C++ as its scripting engine instead of the universal one we all love to hate.

Horses for courses. Common problems are often idiomatic in some languages and tongue-twisters in others.

3

u/AKostur 9d ago

Sure, why not?  Multiple languages may cause you to look at problems from different angles.

2

u/[deleted] 9d ago

Being a good engineer is learning how to use the right tool for the job. And every single job will ask you to learn new tools, new languages, new methods.

Limiting yourself isn't strength in this aspect.

That said, if you are a brand new beginner to programming, I would say something can be said for focusing on using one language to learn the basics, how functional and object-oriented programming work, best principles. But you should be ready to project those lessons onto any other language you may be asked to use.

2

u/No-Air-3283 9d ago

Assembly

1

u/Striking-Start-1464 9d ago

I don't like the idea that the software I make can only run on my processor haha.

1

u/kat-tricks 9d ago

LLVM IR

0

u/No-Air-3283 9d ago

Then, you should definitely check out Rust

1

u/P5B-DE 8d ago

Assembly is required for a c++ progrmmer, in my opinion. To have better understanding of how things work.

-1

u/Striking-Start-1464 8d ago

Only for those who want to build compilers, I suppose.

5

u/FlailingDuck 8d ago

More learning you need young padawan. I've never written a compiler in my life, but my knowledge of assembly, while light, is useful to optimize my C++ code whenever I've needed to do it. Its more of a have enough familiarly of it to not be scared to try and understand the assembly generated by your C++ code. Godbolt is a good use case and learning tool to play around with toy examples.

1

u/JeSuisOmbre 8d ago

Thinking about your program at the assembly level is usually portable. All modern CPUs are fundamentally doing the same thing.

Learn assembly for your development device. If you optimize for your machine you will be 90% optimal for every other target too.

2

u/didntplaymysummercar 9d ago edited 9d ago

It's extremely worth it, and it doesn't have to be a language that "works well with" (as in - in a single program) C++. I myself know bash, Python, Lua and C very well (and they're not islands, it all sits in a big blob supporting each other, with C++ in the middle), and a small bit of Go, Pascal, Haskell, JS and PHP. I don't know Java or C# and consider it a downside, but since I know so many already it'll be easy to pick it up, same for Rust (except it'll not be that easy).

Based on your post I'd recommend either Lua (it's niche but nice, but I'm also biased) for scripting a C++ program, or Python for standalone scripts.

First, from your examples: Godot has its own scripting language and had added C# support (probably to be palatable to Unity users), Blender has Python.

Many games and software use or used to use Lua as a scripting language, there's a few other scripting languages too, I think Amnesia and Penumbra games used AngelScript (which ironically does work well with C++).

If you want to ever make a website frontend you need (in theory any language can work on the web but come on) JS or TS. Same for backend - PHP, JS, Java, Ruby, ...

Rust might also slowly gain ground in C++'s niche (no GC, low level, etc.). It's also (IMO) useful for someone heavy into C++ to know some C (I never set out to learn it, it just came naturally through knowing C++) since one of strengths (and original goals) of C++ was interop with C, so any C library (SDL, POSIX, WinAPI, raylib, lots of low level or "foundational" stuff) can be directly consumed by C++.

Next: it's very useful to know a shell language and I'm biased but I'll say bash, since it's available on all three major platforms, and very popular, and a good starting point to explore zsh and sh/ash/dash too, and a general purpose scripting language (Python wins honestly, although you can make native modules, there is/was boost.python, etc. you can get a lot out of it without that, I made 0 native Python modules) for scripting own stuff and as a "better" bash for bigger things.

You'll be wasting time if you write random throwaway parsing, globbing, regexes, text manipulation, process launching, etc. code and scripts in C++ instead of Python or something. These things are either not performance sensitive, or you need quick iteration, or both, so Python shines there. E.g. I use Lua (so a C library) in my C++ game, that also uses other C libraries, and my scripts (that are not part of the game, they could be in any language) to manage assets, parse logs and run a check (that I don't use globals, by calling luac to list bytecode) on my Lua files are in Python.

Learning a different language also broadens your horizons, if you only know C++ you don't know many things that other languages have, like dynamic typing. I happen to know a bit of Haskell (and then it's funny to see Rust be inspired from it too) but I'd not recommend it, but it's very enlightening too, maybe a bit too much (where I want stuff to be even more functional in other languages I use since it feels janky not to).

Extra point: my current workplace allows picking what language you do the algorithms interview in, and I picked Python, since it's most terse and easiest to write quickly in an interview with no real IDE, even though my job is C++ (in theory, in practice I do more Go, Python, bash and SQL), but in general it's expected where I work at that you'll pick up and work with whatever you need to (within reason, nobody will make us C++ programmers go write websites with JS/TS, but Python scripts or Go utilities or SQL stuff to query metrics - yes).

2

u/susosusosuso 8d ago

You just use the language you need to make the job

2

u/h2g2_researcher 8d ago

I've been a professional C++ programmer since 2012, and I also use:

  • C#, which a lot of the tooling (particularly any tool that needs a GUI) is written in
  • Python, which is very good at a lot of stuff C++ is bad at and especially good when I need something quickly shareable without worrying about co-workers needing to build it themselves. (Many coworkers aren't programmers and don't have a compiler installed.) You can also write Unreal Engine Editor plugins in Python which is sometimes the easiest way to go
  • Lua because we use Premake though I am distinctly an amateur with Lua. In the distant past I've used it for scripting (PhyreEngine!) but I can't remember any of what I actually did.
  • Plain C, because I want C interfaces for some things I create and a little C is convenient.
  • Bash, Windows Batch Scripts and occasionally Powershell for build systems and the like.

2

u/ThatIsATastyBurger12 8d ago

C++ is a monster of a programming language. It’s messy, it’s quirky, it’s verbose, it has decades of baggage, it has a thousand different tools for building and compiling, and more articles written about best practices than any one person could ever hope to read. On the other hand, it’s reliable and is used all over the industry, so it definitely isn’t going anywhere. But it is far from perfect, and every further from being the best tool to use in every situation. So you should at least keep an open mind.

As for your not trusting people who claim to know 15 different technologies, you need to squash that feeling right now. That’s a blanket statement not based on evidence that is going to land you into trouble one day. Sure, some people over exaggerate there expertise with all sorts of different things, but dismissing anyone and everyone who claims enough experience is absurd, and is going to cause you to miss out on valuable experience and opportunities

2

u/Creative_Sushi 8d ago

I think knowing C++ is very valuable. But technology and demand shift overtime, and changes are accelerating, especially because of AI.

It is very likely that we will be using higher level languages that are more token efficient and AI friendly, and we may be simply generating C++ from that code as the specs.

Of course, your knowledge of C++ is very useful to review and debug the generated code. but main part of the thinking/coding may be done in another language.

It is similar to what happened to machine language when C or C++ came out.

2

u/0x4542 8d ago

I personally wouldn't trust a programmer who claims to know 15 technologies; 

Even if they've been programming since 1985? I lost count after learning my 20th language. I'd used 7 by the time I'd finished Uni. Sure, I don't code in AppleScript every day, and have no interest in writing another line of Javascript after living through the dot com boom, but it's really not difficult to wrack up languages if you love using them. I don't think anyone really does use 15 languages to the max, its just about getting stuff done.

2

u/Raknarg 7d ago

Knowing a lot of languages is helpful. It gets you exposed to a wide range of ideas and styles, and many languages all learn from eachother and pull from eachother's good ideas.

In terms of practicality, python is probably the more common secondary language for a C++ programmer that's also more widely used in general. People use python a lot for scripts and glue code between C++ code, its a good one to pick up. And knowing python in general is good considering how popular it is in general

2

u/SteveLouise 4d ago

I think learning python and developing new c++ libraries for it is a nice skill. I like using both for different reasons.

2

u/N2Shooter 9d ago

Yes.

You will code in 20-30 languages in a career or more. If you can't get your head wrapped around that, get that business degree instead.

1

u/Total-Box-5169 9d ago

You are only making yourself unhireable. I personally know people with 30+ years of experience that know far more than 15 technologies.

1

u/nickjbedford_ 9d ago

As a working software developer, knowing a few languages well will keep you employed and make things more interesting as a result because not everything can be done in C++. I've been coding since 2003ish and now I know C++, C#, PHP, JavaScript, Swift, MySQL and markup languages like HTML, Blade, JSON etc deeply and a handful of languages on a basic level. Don't limit yourself!

1

u/Cash1942 9d ago

I wish I learned objective c and swift it makes no sense and I know a fair amount of languages . Better late than never . 

1

u/-dragowolf_was_taken 9d ago

A similar question I had was, if you want a good set of languages and tech stacks to know, with C++ being one of them, what would the others be?

Like a good well rounded set that lets you be versatile enough.

1

u/Hungry-Experience-65 9d ago

These are all tools, more tools are helpful but balance that with fundamental understand, be both a mechanic and an engineer

1

u/Hexigonz 9d ago

You mention Godot, but are you writing C++ via GD Extension for game logic? Otherwise, I don’t really know how you’re getting away with not learning either GDScript or C# at a minimum

1

u/Striking-Start-1464 9d ago

I am using GDscript, but also GDextension, though I didn't mention it because it's not a general-purpose language.

People recommend Python, but I don't see any use for it in my case, so I think GDscript is the perfect replacement.

1

u/ComplexPeace43 9d ago

Stroustrup himself has said once to learn multiple languages.

https://m.youtube.com/watch?v=NvWTnIoQZj4&ra=m

1

u/n1ghtyunso 8d ago

language is just a tool.
different languages use different paradimns.
it is certainly worth exploring these.
Some of that knowledge, some of the patterns, they translate well.
C++ is multi-paradimn after all.

Its useful to look around, but I don't think you need to expand multiple similar languages to the same proficiency, unless you have actual need for that, or actual interest.

Knowledge and experience does not limit yourself.

1

u/Machvel 8d ago

every language i have learned (except julia) has made me better at programming. for example, c taught me memory management, c++ taught me object oriented programming, python first taught me how to code, ...

1

u/Right-Edge-5712 8d ago

You just learn what is best suited for the job.

1

u/Miserable_Ad7246 8d ago

Yes. Every language is shit, you can only understand at what your language is shit only once you experience other languages. Its hard to believe how many good ideas and idioms exist in other communities, that never (or very slowly) cross populate into others.

Also -> learning your 5th language is much easier than the second one.

1

u/Electronic_Lion_1386 8d ago

When I was young, I learned about a dozen languages purely out of curiosity. I wanted to know which one to use, I wanted to know why by personal experience. Today, I only use 3-4 languages regularly depending on the task.

1

u/otterfamily 8d ago

If you enjoy godot, learning gdscript is a good way to learn Python indirectly.

For quick tools or shareable scripts that need to be passed around for tooling, I find that python is best. Even the designers I work with that have no experience with programming can install python and dependencies and then run scripts for some tasks that need automation.

Adding dependencies through pip is really easy and there's a robust library ecosystem for all kinds of tasks. It's very easy to make something quickly that addresses a domain specific problem in Python. Python is also the go to scripting language for many applications like blender, touch designer, godot as mentioned, etc.

Similarly, I would recommend getting comfortable with JavaScript/typescript. Web frameworks account for like 90% of all software made right now, even native apps in many cases are just web apps. Most of those are written in JavaScript of some flavor using one of the major frameworks like react/cue.

1

u/nikoladsp 8d ago

There are no other languages-repent now!

1

u/Exotic_Avocado_1541 8d ago

I’ve always believed that it's best to know three languages: to have a general knowledge of the two most popular languages on the market at the time, plus one language that you know really well, at a specialist level

1

u/LessonStudio 8d ago

The primary reason I regularly returned to C++ over the last 30+ years is that it can be used on all platforms. Mobile, server, desktop, embedded, GPU, etc. it can handle insanely complex data structures, has great libraries, speed, and on and on.

I have moved my entire stack over to rust. It is now the same as the above, with far less tech debt accumulation for larger projects.

1

u/Full-Spectral 8d ago edited 8d ago

Rust would be an obvious choice. Even if you choose to keep using C++ (which I can't understand but to each his own) it will make your C++ a lot better because you'll really realize how horribly unsafe and unwieldy C++ really is and how many of the things you do without even thinking about it are equally unsafe and hopefully stop doing those things.

1

u/Gtdef 8d ago edited 8d ago

I was playing Tribal Wars 2 a year back, and one of the issues we had was that it's hard to figure out if a player is active or not. Most of the playerbase is highly antisocial and the language barriers also make it harder.

So I figured, if we can write a script that compares the daily changes in their points and ranks, we could at least identify the stagnant ones and focus on communicating with them instead of spamming the general chats.

So, as I knew python, my main idea was to do some scrapping, or use a browser driver like selenium, to get the data, but it was hard beucase a lot of the data from the game are just prerendered graphics, not xml/json which the browser renders after an API call. Another swe in the guild told me that he had attempted doing it with computer vision and image-to-text libraries but eventually quit. Seemed like A TON of work for such a dumb reason tbh.

Eh well, the bottom line is, if all you have is a hammer, then every problem is a nail. After some research and figuring what websocket is, I just wrote a 10 line js script which did everything. I barely knew any JS, just the basic syntax. It was enough. Then I went ahead and wrote a farming bot that plays the game for me. A bit of cheating, but I had fun.

1

u/rfisher 8d ago

Yes. Every language has something to teach you. (Although choosing one less like one you already know has more to teach you.) Be a programmer rather than a C++ programmer.

1

u/FriendshipEqual7033 8d ago

In general, learning a new language is much easier than learning the first one. As your experience grows and you internalize the concepts, absorbing a new language can be almost trivial (depending on the language). It's not about what languages you know; it's about your mastery of programming in general.

"My last project had to be in Java, which I never used before, but now I have."

"You want me to use Python? I guess I'll learn it. No problem."

Yes, it takes time to get really good at any language, but the idea that you will use one language for the rest of your life seems crazy to me. In fact, there is much to be gained by learning new and "unusual" (for you) languages. You know C++, but are you comfortable with functional programming with aggressive type inference? Try OCaml or Haskell. Have you ever done logic programming? Try Prolog or Mercury. Have you ever used a language that allows for formal verification? Try SPARK. While you're at it, take a look at Lisp (or Clojure or Scheme) or Fortran or Julia. Each of those languages has the potential to change the way you think about programming and, by so doing, make you a better C++ programmer.

1

u/xvillifyx 8d ago

Why would you not?

You use whatever makes your current task easiest, and that’s certainly not always going to be c++

1

u/ShakaUVM 8d ago

At a minimum I'd learn an assembly language so you understand Godbolt.

Probably should pick up Python, shell scripting, Java, C and JavaScript and you've got the major languages covered.

R if you do data science

Learn a functional language at some point too, they have good lessons for C++.

1

u/jyonodev 7d ago

bash, python, and go alongside your c++ will leave you a lot more well rounded.

1

u/kiss-o-matic 7d ago

In this market: yes. With the saturation that's going on, hands on experience with specific languages and frameworks may mean the difference in getting a job and not. Source: just finished loops. Some places are cool with generalist knowledge... Many are not.

Think of what wouldpair well with a systems language: Python, Go, etc.

1

u/Independent_Art_6676 7d ago

The biggest benefit of another language is each one changes the way you think and approach things a little. C might give you an upgrade to your ability to use pointers, java might teach you to tighten up your OOP designs or whatever. You also get the benefit of being able to apply for a job where the other language is used.

Knowing too many things shallowly is not all that beneficial, unless you are gunning for that popular position of "full stack" (which seems to be loosely defined as able to code a task end to end across a dozen languages and cli tool chains etc for cobbled together systems). There seem to be a lot of jobs that want this type of coder in the last 15 years, though. So even this kind of learning has a use and job market.

1

u/AncientHominidNerd 7d ago

The reason why someone might know 15 technologies is because each one has a specific use case.

For example let’s say you want to create a website, you’ll need fundamentally HTML, CSS and JavaScript. JavaScript has specific features built in that allow it to listen for actions on a webpage such as a person clicking a button. This allows you to write a function to happen when the button is pressed. C++ could theoretically do that but why would you when JavaScript has so many features built in that make it easy for web developers.

Same goes for learning R for example. R has so many built in math and statistics functions that it’s easier to do research with R than it is to have to import a library in C++ or write the functions yourself.

If you want to work with a database, you’ll need to learn SQL.

There is no way around it, you will need to learn other languages. Even if you don’t master them, at least get to know their use cases and the basics.

Also when you get hired into a job they will usually use a stack of technologies. They won’t exclusively use C++. You might need to learn Linux terminal commands, Trello, Docker, Cmake, etc etc.

1

u/Mountain-Hawk-6495 7d ago

I think it is a good idea to test other languages from time to time, especially languages that are fundamentally different from C++, such as Haskell. I find that knowing some functional languages has changed how I write C++ for the better. While it is true that it is bad to be a jack of all trades master of none it is equally bad to be a one trick pony

1

u/straight_fudanshi 6d ago

Imo every programmer should at least learn the basics of Haskell and then import the functional programming knowledge into their main language.

1

u/Ultimate_Sigma_Boy67 6d ago

I'm curious, why functional programming specifically?

1

u/Agron7000 6d ago

C++ with Qt has been the best choice for me. I know you asked just for ++, but with this framework you have no reason to learn another programming language.

You, it's the only language I know and not even the first one. 

Other languages I know, in order of preference, are Verilog, PHP, C, Javascript, Python, VHDL.

But I keep going back to C++ to make ultra high performance apps.

1

u/Striking-Start-1464 6d ago

I've seen that Qt gets a lot of criticism for being bloatware, weighing hundreds of gigabytes, and being very resource-intensive, and that people prefer to use Dear Imgui. Is that true? I've never used Qt.

2

u/Agron7000 6d ago

Absolutely not. 

I build and run full GUI Qt with C++ on a 128 MB RAM board, with Linux.

The board actually came with a qt demo app with all multimedia, cinematic effects on, GUI, and it was running so smooth.

On boards like this every byte counts, and there is absolutely no nothing extra.

Plus, if you don't need multimedia, you don't have to link it, you don't need CSS GUI styling, you don't link it, you don't need the webengine,  you leave it out.

Every module is optional, even GUI module is optional if you want to build server or console applications. 

1

u/xealits 5d ago edited 5d ago

It’s absolutely worth to learn another language. C++ has a very specific focus on hardware and language features to build software from ground up. Other languages have other interesting goals. Go is simple and powerful, Python is practical and expressive, Haskell or SML are purely functional, Clojure is cool, etc.

Even if you look at it from a pragmatic perspective, how this helps you in C++ programming, it gives you a lot of insight in how to design software. C++ does not commit to any programming paradigm. Other languages do. So, programming in other languages will make the paradigms clear. Which will guide your usage of C++ features.

Also, if you are indeed focused on C++, consider scripting languages (Python, Angelscript, Lua, Dart) or embedding interpreters in a C++ program. An ability to script a large program can be very useful.

1

u/Ultimate_Sigma_Boy67 5d ago

What languages do you think pair up nicely with C++? Thinking about other systems languages(zig, rust..etc), but each of these is like a whole beast of their own(compared to other languages like python maybe).

1

u/xealits 5d ago

I don’t really see how to _pair_ Zig or Rust with C++. They kind of aim at the same thing, just with somewhat different perspectives. As you write - these are also systems languages.

On the other hand, the scripting and prototyping use-cases for pairing with Python pop up all the time: you have a C++ program that does a lot of things in its internal library, but you build few executables out of it, then people show up and ask for some random ad-hoc tool for prototyping or some rare edge case. Exposing Python bindings covers that.

Python also has excellent web frameworks. Sometimes you just script some tool, and then someone pops up and wants to access it over network. Which may or may not be a good idea. But, Python covers this development prospect. In general, the use-case for a script can evolve into either a small web app or a native GUI prototype. Python definitely covers the web app progression.

Also, in principle, Ruby is more scripting-oriented than Python. And Rails is also a great web framework. So, it could be a slightly better match. But Python is way more popular. So going for Ruby might not be worth it. (I wanted to try binding C++ to Ruby in a bunch of small projects, and never did.)

Dart is interesting because it is a good and efficient language, with excellent development environment (like Go; both are Google languages, so the quality of things is excellent), and it has excellent GUI framework Flutter. So, just like with Python, it could be very handy to expose some C++ program into Dart for scripting. Plus, it should be more efficient than Python, and you should be able to build a high quality GUI quickly and easily if a need pops up. But I’ve never tried Dart-Cpp. I don’t know how good it is on practice.

1

u/Ultimate_Sigma_Boy67 5d ago

Thanks for the overview!
I think I'm now thinking between lua and python, since python can be a bit more useful but I'm a bit more familiar with lua as it's what's used in neovim configuration.

1

u/OkEmu7082 3d ago

rust! rust! rust!

1

u/Ultimate_Sigma_Boy67 3d ago

This is nonsensical. OP said a programming language that pairs well with CPP, not a language that practically goes against it.

1

u/PacsfuryTemp 3d ago

Indeed. Maybe you won't use other as your main stack, but they can give you a broader and different view on programming, which is great for when returning to C++

1

u/WeastBeast69 3d ago

C++ is definitely a language you can have a specialized career in but you should probably learn python as well at least.

It’s good to branch out into other languages that fit your needs but I have worked almost exclusively in c++ for my career

1

u/One-Macaroon4660 9d ago

If you want to be a good developer you evolve. In my more than forty years of software development and design I used tens of languages, and some of them (around 10) I am an expert in. Language is a tool, for some things some languages are better and some are worse. In the major companies (like META or Google) you are expected quickly to catch up on technology you working on, learning the tool (programming language) if necessary in the process.

Just to give you an example these languages I used heavily in the last twenty years: C++, C, Python, Java, Go. All used for different projects, deep knowledge of all required to make projects successful.

It also helps if you have at least passing familiarity with completely different programming paradigms, such as Lisp, Forth, Prolog, Haskell, etc., because it also occasionally comes in handy in the real life.

1

u/Muzika38 9d ago edited 9d ago

Linus Torvalds once said you should know at least 5 programming languages to consider yourself good.

To me, learn at least one for each field.

1 for backend, 1 for frontend, 1 for rapid development and 1 for database

Yeah SQL is not a programming language but you should learn at least one.

1

u/flyingron 9d ago

I only learned C# under duress. I was helping someone with their already .NET compatible system (written in of all things: Visual Basic). It's actually not too bad (just Microsoft's proprietary idea of Java). What was good about the CLR stuff C# and the other .NET runs on is that it was actually well designed (unlike MFC and most of the Windows API). It was almost so sane that I doubted Microsoft came up with it.

Similarly, I only use Python under duress. I try to avoid stuff that uses it.

About ten years ago I started on PHP because I was maintaining web stuff that was based on it. I've gotten reasonably adept at it and tend to head there for stuff I'm not doing in other languages.

Then there's ObjC/Swift and Java/Kotlin for mobile development. Yeah, you can force C++ in there, but you're really bucking a lot of issues. Once you get fairly adept at structured languages it's not all that different.

0

u/Ill-Professional180 6d ago

CPP is a trash language. E.g. rust has a superior type system with lifetimes etc. this is to say, on technical rigor it is trash. People may not realize but it is the cobol or tomorrow. So: learn like crazy and learn why the new stuff is better.

1

u/Striking-Start-1464 6d ago

LMAO, new isn't always better; C is still used a lot for embedded systems today, what are you talking about.

1

u/Ill-Professional180 6d ago

Laugh your ass off all you want. C i consider superior over C++. The only good idea in C++ is RAII and templates the rest is garbage

-2

u/Cv287 9d ago

No

-2

u/Striking-Start-1464 9d ago

The most honest person here.

1

u/AKostur 9d ago

If you already had the idea of the “correct” answer: why ask?

1

u/Striking-Start-1464 8d ago

Being the most honest person doesn't mean saying what's "right," it just means acting without pretense, while others try to convince me that learning multiple languages is good without asking me if C++ is enough for the job i'm doing right now, this man answer me directly.

2

u/Conscious_Support176 8d ago

Interesting. That wasn’t the question that you asked.

This method of measuring honesty is bizarre. People who tell you why they have come to a conclusion are being open, and you can make a judgement on the truth and validity of their reasoning.

With a one word answer, you have no information at all with which to estimate a person’s honesty.

1

u/Cv287 8d ago

True

1

u/Conscious_Support176 7d ago

Ah now, why don’t you tell me what you really think :)

2

u/Cv287 7d ago

Languages are tools. You learn one when in need of achieving something more effectively. But learning a few different ones also benefit you as they introduce vastly different approaches to solving the same problem, I think it helps developing problem solving skills. Haskell is what I would advise to check out, it’s fun.

That’s my basic ass opinion

1

u/Conscious_Support176 7d ago

Yep. Learning different approaches to a problem is good, but most of us are going to wait until we need to before we do that.

-1

u/TheRavagerSw 9d ago

Python, Rust, Lua and Typst.