What language do you recommend learning DSA with, and why?
Posted by giddyteddy@reddit | learnprogramming | View on Reddit | 18 comments
Hey developers! Hope y'all are doing great. I’ve got just one lecture left to finish OOP in C++, and I’m curious—what language do you recommend for learning DSA? Or should I stick with C++? Let me know your thoughts!
Digital-Chupacabra@reddit
The language you know.
giddyteddy@reddit (OP)
Great, appreciate it!
inbetween-genders@reddit
Master C++.
giddyteddy@reddit (OP)
Why should I master C++? I really like it, BTW, but I'm focusing on getting a solid grasp of programming concepts, since I want to pick the .NET stack in the future. Actually, I've already chosen the .NET framework for web development, because C# syntax is kinda similar to C++.
inbetween-genders@reddit
Because mastering one language is considerably much better than saying one “knows” all these other languages. You also have already started with C++ so just keep working on mastery of that. C++ has been around for a long time and it’s all over the place with that being said it has influence a lot of other languages. That’s why C# is similar and if you master C++ you can learn a lot of other languages much easier.
giddyteddy@reddit (OP)
I totally get it, and I truly appreciate your advice! Can I ask, what’s the best way to revise the fundamentals?
carminemangione@reddit
TBH, I did Sedgewick algorithms in FORTRAN, C, C++, Pascal (yes there is one for each). As the guy above said. Programming language is irrelevant although some are going to be harder than others.
giddyteddy@reddit (OP)
That’s awesome! You’ve really been around the block with languages! I totally get what you’re saying, and I’m convinced by the idea of understanding the concepts and theory behind the implementation. I appreciate it!
carminemangione@reddit
So, learning a language should be second nature. I have probably use at least 30 different languages in the last few years (we kind of made a drinking game of it).
If you learn the basics of algorithms, data structures and programming language theory, the world is your oyster.
Dohp13@reddit
JavaScript, don't at me.
DTux5249@reddit
Literally any of them. DSA is language independent.
C++ might show you how the computer is doing things a bit better. But that's it..
Beregolas@reddit
Normally I recomment pseudocode, but that required a tutor of some kind. If that is not available, choose the language you feel most comfortable in. Any language, no matter how high or low level, will do nicely. (Keep in mind that some languages, like functional languages, e.g. Haskell, will limit what you can implement. )
thirdegree@reddit
I fuckin hate c
C is imo the best language for DSA. It's straight garbage for making complex applications, but learning why and how computer shit is the way it is? C.
Reasonable_Boat_5373@reddit
Python for the ease in interview, C++ for the complete understanding of how things work under the hood.
mancinis_blessed_bat@reddit
Python is so simple and nice for algos, I would learn it just for that. But of course it has a lot of applications in other areas
giddyteddy@reddit (OP)
Yeah, I got you! It’s super beginner-friendly and really versatile. I have a background in Python too. I'll consider learning DSA using it. Thanks mate!
desrtfx@reddit
DSA are language agnostic concepts and as such best learnt language agnostic, e.g. with pseudo-code.
Yet, since you already know C++ it is perfectly fine to learn DSA with it.
Just make sure to focus on the concept and not on the implementation in C++. Understand the theory behind the implementation. Then, you can implement them in any language you know.
giddyteddy@reddit (OP)
You’ve convinced me, I'll go with it. I truly appreciate it!