Ask coding questions

← Back to all posts
6
Python vs Java
AquaMarine0421 (24)

Hey :) I'm a learner of C/C++ and LOLCODE; I'm nearly finished with both, so I'm thinking of a 'second' (rather, third) language. I'm getting confused of which to learn between Java and Python. People around me say that Java's more useful, while Python is easier to learn. What's your opinion? And why? Leave it below:)

Commentshotnewtop
4
Pythonier (299)

@SPQR, @eankeen, @Vandesm14: I think we all responded at the exact same time!

1
1
Vandesm14 (483)

@SPQR Yep! After posting my comment, I refreshed it and was surprised at how many people commented that fast!

2
Pythonier (299)

@Vandesm14 Although I think mine was just a minute before yours and @SPQR

3
eankeen (528)

🤔 Hmm. To be honest, you could go with either. If you're in academia (and they use Java) I would probably go with Java just to make your computer science classes easier. If you don't think you're going to be taking any Java classes in the near future I would go with Python. I'm not sure how much you're learned in terms of theory when doing C/C++, but Java is a perfect language if you want to learn about that kind of stuff.

Have you considered learning JavaScript? :) It's a wonderful language!

3
Pythonier (299)

They are both great languages, Python is easier to learn but that doesn't mean it is not useful. Java is great, but a little harder. You can choose either one and be happy with your decision, but If you choose Java, I would recommend learning Javascript first.

1
SPQR (331)

@Pythonier Personally I find that JS and Java are less similar than C++ and Java, so since he already knows C++ he's probably good (He might want to learn JS instead partially because Java and C++ are so similar and thus are often interchangeable for pretty much any given task)

1
1
AquaMarine0421 (24)

@SPQR It's OK anyone can make mistakes :)

2
AndrewBowers1 (1)

LOLCODE is like python so python will be easier

1
AquaMarine0421 (24)

@AndrewBowers1 thank u for ur reply! I am considering many different options at this point!

2
algore (8)

I for one know both languages decently well, and say this the people telling you Java is more useful are 100% wrong, not only does python have more application uses it is very common in Academia while java is being moved out of academic areas, and as well Python is one of the fastest growing needs in the Software Engineering industry, with great payments. Python is in my opinion one of the best languages for any purpose you may have for it, I use it for game programming, web programming, cybersecurity, and other tasks such as creating AI / messing about with machine learning. The only times I use Java out of class is never. So if you want to learn/master something practical and can very likely be what you will be working with 5-10 years in the future choose python, but if you are looking to learn more languages learning Java will also be beneficial as it shares many of the same concepts as other languages, while python is more unique. I would suggest if your only options are as listed, is to choose Python as your next language to learn, because of the practical uses the language has.

2
itbarsoum (37)

Python!

I recommend Python (3.7 - not 2.7) because of its use in data science. First, python has a simple syntax.

The Zen of Python:

Open a bash terminal
type python3
type import this
read!

Games

Python is a great language to write anything from simple text adventure games to complex ones - all using data collection. In its simplicity, it is the perfect second language (but not a good first language). I recommend learning python from an expert rather than from an online program such as CodeCademy. However, if there is no other way, use CodeCademy.

Alternatives

HTML, CSS, and JavaScript (NOT JAVA) are always a good trio of second or third languages. They are empowering, allowing you to make websites, style them, and power them. These languages are good to learn from CodeCademy, but also good coming from experts if possible.

It's always good to know as many languages as possible, in any order possible (except with python first)

2
Mavrick (77)

Python is so much better; if you've learned C, you can learn python in like 5 minutes.

2
MATTHEWBECHTEL (121)

I like python but java is more useful to me.

2
a5rocks (501)

Okay so, I recommend Java from your current experience.

It's "object-oriented", which means you need more code to do the same thing, but it's normally more expressive. At least, that's what object-oriented is to me. (though that's with stateful programming, https://dzone.com/articles/stateful-or-stateless-classes)

Though, if you want to die, try learning Lisp

2
ebest (407)

@a5rocks If you REALLY want to die, learn brainf

2
RoylatGnail (72)

@ebest or the MOO language (not in repl.it yet)

1
a5rocks (501)

@RoylatGnail or whitespace

or unlambda

or malbolge

2
1
a5rocks (501)

@RoylatGnail molbolge, unlambda, and whitespace are not meme languages... Just esoteric.

1
RoylatGnail (72)

@a5rocks I meant joke languages.

2
SPQR (331)

Java, especially if you've already learned C++, they're very similar and the transition is easy. Python's sole purpose is to be simple, it's not very good at anything else.
Side note: Idk what you mean by "finished" with the languages, there's always more to learn. I'd honestly recommend getting really into a language rather than knowing several with only baseline knowledge of each.

EDIT: Python is useful sometimes, when you just need to do something simple and performance isn't an issue. It really depends on what you want to be doing.

1
AquaMarine0421 (24)

@SPQR Yea maybe i should just stick w/ C and C++...

1
SPQR (331)

@AquaMarine0421 That's what I'd strongly recommend. With C/C++, knowledge of the language grows exponentially as long as you're learning. What i mean by that is, once you've learned the basics, everything else comes much easier and only gets more easy the more you learn. If you can't find a good course for learning the language, that's fine, what I ended up doing after i learned the fundamentals was I started working on more and more complex projects which required me to implement more and more advanced concepts to work properly. When I found something I didn't know, I'd think of a potential solution to a problem, and a quick Google search would usually yield a solution, and reference documentation to learn from. If it doesn't, you can always ask here (or if you're so inclined, ask me personally, my email is in my profile and I like helping)

2
Vandesm14 (483)

Java would be better since it is supported by a wider spread of systems. Plus, you can use Java to code games, and not just text adventures (*ahem*, python). Although, Python is easier to program, the language is not as powerful or expansive as Java.

Please mark this as answered if I helped your problem 👍

1
Steven_The_GuyT (197)

I know both Python and Java. I think that Python is easier to read, and you have to type less. Java is longer, but I have created many more non-console games in Java than I have in Python. You could always use Pygame, but I have to learn more about Pygame.

1
AquaMarine0421 (24)

@Steven_The_GuyT thank u for ur helpful reply! I'll have to find out more tho...

1
SethPeace1 (1)

Python. It would help me in my argument against LB (he's my friend). He thinks Java's better (it's not).

1
ebest (407)

@Vandesm14

Really, you are correct about the game thing, without turtle.

https://repl.it/@ebest/space-game

Not advertising, it was from someone else. Python gets hard to program when the problem is complicated, but if you're a beginner at coding python would be recommended. But you already know C++/C, so Java is better, as it's more usable.

Unrelated: You really like Scratch, don't you? You're name description made something in my mind click.

1
AquaMarine0421 (24)

wow you guys are experts!

1
HarperframeInc (227)

Why worry about choosing python and java? Have you ever considered Jython?
Jython combines Java and Python to make a useful, easy to learn language. There is also Cython, which is C and Python Combined. It gives more support to other libraries, and you can use python for low-level programming.

1
pyelias (657)

@HarperframeInc Jython is just a Python interpreter with Java bindings, not a separate language.

1
TheDrone7 (510)

I would recommend Java out of the two that you're planning to learn. But if I were to make a third suggestion of my own, I would recommend you to learn JavaScript and eventually node.js too.

1
KeaganLandfried (5)

You learned LOLCODE...? ._. how

1
AquaMarine0421 (24)

@KeaganLandfried i just read the newsletter N found some tutorials