+ 1
What are the advantages and disadvantages of using Python over Java for OOP and Data Structures?
Some of my mates said that I should choose java for Data structures and object oriented programming as well, as they are claiming that data structures is not good to do with python like if I do I face difficulty in advance data structures... Also they suggest me to do OOPs with java .... So now I am stuck in between, so I want some suggestions on that ... I want to know that which language is better for 1) Data structures 2) OOPs ( java / python)..?? Please help me out.🙏
8 Réponses
+ 9
Aseem Ranjan I have a couple of recommendations when requesting help.
1. I don't respond to DMs. Since you posted this in Q&A, it will be easier to just post a link to me or mention me by name here.
2. Use simple, relevant tags. Otherwise, it's not as easy to filter on recent questions to find your question.
Replace your tag: "??" with "python" "oop" "java" "data-structures"
3. Make your question more concise and clearer. The goal is to lead with your specific question, then provide additional context.
Your current question is:
"As I am learning python, and very well comfortable in competitive coding as well as data structures with python"
There really isn't a question here. It's a statement about you.
A clearer question will be:
"What are the advantages and disadvantages of using Python over Java for OOP and Data Structures?"
If I have some time, I'll try to come back and respond to your question.
In the meantime, I recommend you apply the changes I just suggested.
+ 6
Aseem Ranjan AFAIK... you can handle data structure problems in either language without issues.
Python code will likely be less verbose than Java code. However, Java will likely outperform the equivalent version of the Python code.
I would need to know specific criticisms from your mates to address anything beyond this.
On the other hand, Java is more consistent with the C++ flavor of OOP, while Python is more aligned with the Smalltalk flavor.
Since C++, Java/Kotlin, C#/.NET, etc are far more popular and mainstream than Smalltalk, many people think Python is less OOP than the static typed counterparts.
Still yet... Java doesn't satisfy all the criteria for being a Pure OO language because primitive types and functions are not objects in Java.
Python might actually satisfy more criteria than Java for being a pure OO language.
That said, Python doesn't implement encapsulation beyond using naming conventions, which trips many Java people up.
Ultimately, both languages are OOP in their own rights.
+ 5
David Carroll I just read your suggestions and apply genuine changes to tags and question.. Thanks for your suggestions , I remember the way of posting questions and putting tags for future reference.
+ 3
Python is not a strict OOP language and Java is too bloated in its syntax.
+ 3
David Carroll The specific criticism of my mates on Data structures is that
1) They are saying that python is very easy and good to write basics like stacks, queues, linked list and basic of trees . But they also said me that python is going to be very tough for advance data structures like graphs, dynamic problems, segment trees, back tracking, greedy & tries..
So they are telling me to do java which is going to be easy for both (basics + advance) .
So that's why I concerned that if I just start Data structures in python, is I am going to stuck in between after completing basics??
As I am just starting data structures I want to ensure myself that in which language I am going comfortably with it, don't want to stuck in between ..
+ 2
Aseem Ranjan I suggest you should use python because that is what you learned first but OOP in python is easier than java
Data structures mainly you composed of numpy and stuff
But I suggest that follow your gut
You can ask David Carroll for more information
+ 2
Ya, I can understand that OOP is easy with python but all the good coders, my mates are saying that python is not that much capable for OOP in comparison to java .....
Also I started data structures in python and I am well in that but some of mates saying that python is very good for basic data structures like stack , queue , linked list ... But doing back tracking , advance algorithm graphs etc is not beneficial with python they said java is more easy to do advance data structures...
So that's my question which language I have to start because I didn't want to switch to another language when
placements or peek time of my career will arrive...