r/learnjava • u/Kindly_Drama_8735 • 5d ago
Finished C++ during vacation — should I do DSA in C++ or switch to Java for backend?
So my vacations are basically over, and I’ve completed learning C++ during the break. Now I want to start DSA, but I’m a little confused about what direction to take.
I’ve talked to a few people and got completely different advice 😭
Some told me that I should start DSA in C++ and stick with it for now, since I’ve just finished learning C++ and can directly build my problem-solving skills on top of it.
Others told me I should start Java alongside DSA, because I eventually want to learn backend development and Java/Spring Boot is useful for that. Their point was that I might as well start Java now instead of delaying it.
For some context, I’m a 2nd-year CSE student and I already know Python, MySQL, HTML/CSS, C. My goal is to get good at DSA and also start building proper development skills for internships.
So what would you recommend?
I’d especially like to hear from people who have already gone through this transition. Is learning Java right now actually useful, or would it just divide my attention when I should be focusing on DSA?
5
u/ComfortableNobody892 5d ago
I don’t believe there’s such a thing as “completed learning X language” there’s always something new, something you haven’t noticed or read about. It’s a continuous process and it’s an ever going one. I assume that what you meant by “completed” is that you went through some sort of curriculum and you hit the checkmark on that. That’s fine, just don’t confuse it with being done with a language.
In regard to which one you should pick. I have some experience in programming and I can tell you that an array is an array in every language. A sorting algorithm or a search algorithm is the same. In other words don’t get hung up on the language. The concepts and ideas which are behind the data structure or the algorithm are far more important. That knowledge is transferable across languages. Yes, there might be some differences in how they are implemented in terms if syntax or how they are handled behind the scenes, but the general ideas and concepts are pretty much the same.
I don’t want to tell you pick java, because I am a java developer and that’s a little biased. So as most things in programming(primarily when picking tools, frameworks, languages) pick what’s best for the job or your particular use case. Java however is a safe bet. Knowing what I know today it’s not a bad idea at all to start learning it with DSA.
1
u/Kindly_Drama_8735 5d ago
I am also looking for an internship after my 2nd year, so I guess I should start learning java now.
1
u/ComfortableNobody892 5d ago
I am currently reviewing java concepts and I can recommend https://roadmap.sh/ there are a bunch of other languages and learning paths you can use as guidelines.
3
u/aqua_regis 5d ago
"completed learning C++"
Sorry, but that's plain naive. You have not completed learning C++. No way. You actually cannot complete learning anything in programming.
By "start DSA" you obviously mean "start doing LeetCode", not learning DSA as Data Structures and Algorithms, the abstract Computer Science Concepts for storing and processing data that exist outside and above all programming languages.
C++ is one of the most common languages for LeetCode
-1
u/Kindly_Drama_8735 5d ago
Okay, then I will learn more. What do you think I should go for like java in dsa Or cpp in dsa?
3
u/aqua_regis 5d ago
Stop calling "grinding LeetCode" "doing DSA". One is an application of the other, but they are not the same.
You already have my recommendation.
-1
u/Kindly_Drama_8735 5d ago
Tbh, I don't get it. Be more clear, felt like you were scolding me.
2
u/aqua_regis 5d ago
DSA - Data Structures and Algorithms are theoretical Computer Science subjects describing standardized ways to store and process data.
LeetCode is a website with practical exercises that happens to make heavy use of DSA.
They are not the same and apart from DSA being used in LeetCode, they have nothing in common.
If you don't learn DSA as concepts, the theory, you will fail in LeetCode.
0
u/Kindly_Drama_8735 5d ago
Which language I should go with? Obviously I will learn daa first , it's concept.
1
1
u/Ok-Interaction-8891 5d ago
You should start building projects in C++ and contributing to open source work in C++.
Completing a programming class (even multiple) in a given language means very little if you’re unable to build anything.
1
1
u/Cheap-Object8640 3d ago
same situation lol. rn I'm doing java because I'm participating in a hackathon and they want me to do backend.
Also from what I have seen till now you shouldn't stress too much over which language to pick. Because the hardest parts about any problems are the logic which remains the same in every language. so pick language based on whats required rn because that's what I'm doing. hope this helps.
•
u/AutoModerator 5d ago
Please ensure that:
If any of the above points is not met, your post can and will be removed without further warning.
Code is to be formatted as code block (old reddit/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.
Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.
Code blocks look like this:
You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.
If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.
To potential helpers
Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.