r/learnjava • u/exdovik • Mar 02 '21
Is it ok to start learning Java first before Python?
I want to learn about programming and I'm interested in Java. I've been searching Google and most of the results say that I should start with Python. Do I really need to learn Python first? I'm 14 and I want to start and learn to program once I get a new PC.
78
u/Exclusions Mar 02 '21
You absolutely do not need to start with Python. That is a misconception made by people that just want to hype up the language. Java is also a very good introductory language, you can even tell because it's taught in many Advanced Placement high school Computer Science courses (if you have access to those). There are certainly languages that don't stand out for beginners, but trust me Java is NOT one of those languages. You wanting to learn a language and go through with it is 100% more important than what's popular. Learn something! (:
7
u/mr_poopybuthole69 Mar 02 '21
I never understood people who hype up the language. They will use python for everything. In my opinion it's really hard to transfer from python to other languages. Java is a good language to start with.
3
u/BeauteousMaximus Mar 02 '21
If your goal is to learn Java then you should learn Java. If you try for a while and are struggling with basics like for loops, variables, if statements etc. and you feel stuck, going and doing an intro Python tutorial may make it easier for you to learn those basics, then come back to the Java material again and have an easier time of it since you’ve learned the concepts that apply to both languages. But there’s no reason why you need to learn Python first; it’s just a strategy that’s available if you feel too overwhelmed by Java for some reason, since Python is a little easier to get started with. Ruby and JavaScript are two other languages that are really easy to get started with.
2
u/exdovik Mar 02 '21
I do want to learn Java because I want to somehow make an android app/game. And maybe in the future, once I learn Java properly, I'll definitely learn more programming languages!
1
u/BeauteousMaximus Mar 02 '21
That sounds like a fun project, I hope you’ll post about it once you have some progress!
1
u/exdovik Mar 02 '21
Thanks! However, it might take a while for me to get a new PC. I'll just watch YouTube for tips and learning about it, for the meantime.
1
1
u/ThatWolfie Mar 02 '21
For games it might be good to use the Unity engine, which you would need to learn C#. For apps you can make them with Flutter framework with the Dart programming language. Flutter is good for making apps for Android and iOS. If you want to make native apps for Android, Java and Kotlin are good for you.
5
u/rsandio Mar 02 '21 edited Mar 02 '21
I'd recommend start with Python. I tried numerous times to learn Java and C++ but got overwhelmed. It wasn't until I grasped some Python that I could get my head around Java. You don't need to become a Python pro before moving onto Java but understanding variable, loops, functions, arrays and other programming fundamentals will make Java less overwhelming.
Edit: I didn't do anything object orientated until I moved to Java. But I was writing simple text games in Python like toc tac toe and hangman without using OOP.
16
u/onlyforjazzmemes Mar 02 '21
Interestingly enough, I started with Python, but couldn't grasp OOP until I started learning Java. I also appreciated Java's static typing... it made me feel more organized and intentional.
1
u/exdovik Mar 02 '21
If I may ask, what's OOP?
1
5
u/javaHoosier Mar 02 '21
I agree with this. I had trouble with Python until I was forced to learn OOP with Java. While I love Python, you miss out on concepts like Arrays and Generics too.
1
u/AnotherRichard827379 Mar 02 '21
Static typing is a life saver for code organization and reliability. It’s just laziness that people don’t like it.
12
u/Apprehensive_Royal77 Mar 02 '21
If you're interested in Java then I say start there. I started with Java, I'm now interested in so many aspects of programming and want to know so many languages as well (Python, C#, Kotlin). I don't regret starting with Java, had very limited programming experience prior to learning Java. In the end, it all comes down to perseverance. Pick one and push through, it can get tricky, but push through. Come to this sub reddit for guidance stack overflow can also help, you'll be fine.
20
Mar 02 '21
Many programmers will argue you should start with a language like Java, it is a more powerful and professional language and teaches core fundamentals and concepts. Python is easier (language does more for you, and is often more forgiving with the trade off being the programmer has less control) and is great as a beginner language for a hobbyist that wants to create their first project. So yes you can certainly start with Java and it is a good language to do so, but if you want to get out of building data structures and console apps, Python will get you there slightly quicker at the expense of fundamentals.
6
u/badtux99 Mar 02 '21
Python very much has all the fundamentals. I've written complex systems to e.g. do semiconductor characterization in Python (via NumPy), as well as a commercial network backup system (that hides the fact that it's using Python behind a "compiler" that basically packs the entire Python code and runtime into one blob) and various other complex software. Python's main limit is the GIL, the Global Interpreter Lock, which prevents effective multithreading, thus why Python programs allocate shared memory for data structures then fork/exec when they need to spawn a new processing entity rather than just tossing a work item into a thread pool which would be the usual thing to do in Java. But it's just an alternative approach to doing the same thing, neither better nor worse at least on Linux which does COW page tables on fork/exec.
The reasons for learning Java are less that it's "superior" to Python but rather are practical reasons. Java is the new COBOL -- the Fortune 500 runs on Java. Most college instruction is done in Java, and AP Computer Science is done in Java. As a language with declared types, the compiler can catch most type errors at compile time rather than at run time as with Python (Python is a highly typed language but the types are attached to the actual objects themselves, not to the variables that point to the objects), and the development environments for Java are typically more helpful at pointing out programming errors and mistakes long before you run the program.
What Python gives you is immediacy and conciseness. A typical Python class will be roughly 1/3rd the length of a typical Java class, and you can try out code snippets on the Python command line while figuring out how to do things. For some people, that is helpful. That's why Python is often recommended as a first language. But just because it's recommended as a first language doesn't mean it *has* to be your first language. By the time I learned Python, I'd already learned a half dozen other languages. None of that stopped me from learning Python, and using it where it's appropriate. Learning Python *after* you learn Java is just as valid as learning Python *before* you learn Java. Indeed, you'll probably be happier that way, because you'll be tired of the verbosity and complexity of Java by that time and looking for something simpler if less performant for those little "glue" tasks that always seem to come up where you can't really justify the bulk and overhead of Java.
2
u/hugthemachines Mar 02 '21
it is a more powerful and professional language and teaches core fundamentals and concepts.
Powerful depends on the definition. It runs a bit faster and also has better support for parallell processing but both languages are powerful in their ways.
Professional? That is BS, both languages are certainly used in large companies etc.
You can absolutely learn fundamentals and concepts in both languages.
10
Mar 02 '21
Well Java has a lot of what people call "confusing notation", namely: {}'s scare noobs. Meanwhile Python for the most part only cares that you've indented properly.
But actually Java was released 4 years after Python and the concept of the Java Virtual Machine (JVM) will fucking blow your mind. Probably get you even more excited about computers than you already were
Definitely learn some of the history behind Java too and the concept of why the Java Virtual Machine (JVM) was useful
There's SO much you could theoretically do with Java
https://www.oreilly.com/library/view/java-programming-interviews/9781118722886/c10.html
(I've always really liked these oreilly books personally, definitely abuse their free trial.)
1
Mar 02 '21
I'm currently in the process of learning with one of the o'reilly books and it is the first book in years that I have enjoyed reading.
1
u/analogsquid Mar 02 '21
I'm learning with the Tony Gaddis books myself. If anyone is wondering, they're fantastic.
1
3
Mar 02 '21
You should look at a few things.
What language will do the kinds of things you are interested in learning how to do.
If you want a job, look at your local job market and see what is highly sort after.
Start learning something, anything. High level languages like java and python will both teach you how to understand programming.
That said, imo, python although "easier" can to me make less sense and therefore I would go with Java. Java is strict in the sense that you have to do things a certain way, have a comma here and semicolon there, public this private that. But I feel java gives you a clearer sense of what the hell is going on. Whereas python feels like pseucode ( coding but written with plain English) and uses tabs and other such things that might be confusing for a newbie to look at and understand. Once you master java, you'll be able to pick up python and c# and various others fairly easily.
2
Mar 02 '21
it doesn't matter. Pick a language you want to learn and learn it. Once you learned one, switching around isn't too hard.
2
u/TiDuNguyen Mar 02 '21
I would definitely recommend Java or any other verbose languages over Python.
For beginners, it is easier to "do things" in Python but it is significantly harder to "understand things" in Python as much of the details of algorithms are hidden away. Later on, we must stick to the way of Python to solve more complex problems.
On the other hand, proficient in Java will help beginners understand algorithms much more clearly, thus, enabling them to switch to other languages like C/C++ without much troubles.
2
2
u/badtux99 Mar 02 '21
Just go ahead and learn Java. Programming is programming, regardless of the language. Java is a large and complex language with a large and complex ecosystem, thus the usual advice to start with a simpler language, but it is by no means the worst language on the planet.
2
u/HarlotsLoveAuschwitz Mar 02 '21 edited Mar 02 '21
I would say start learning programming languages in this fashion- C/c++> Java> Python. Trust me, this will bring out the best version out of ya in long term perspective but it's gonna be hard when you start with c++. Python has great built in functions but coding in C will actually make you think and develop logic.
2
u/Snape_Grass Mar 02 '21
I learned java first and when I took a python class I absolutely hated it. To me python is so simple it’s harder for me read than java. Also I like my curly braces and semi colons
1
u/NoHaxJustPotato Mar 02 '21
Definitely not necessary. I'm a Computer Science student thats mostly learning Java and if anything, I found Python a lot easier to learn and understand because of my fundamentals from Java
1
u/Jon309 Mar 02 '21
Java is what I was taught first. I graduated college two years ago and never learned any Python except for on my own. I wouldn’t even suggest Python as a good language for beginners. I think it’s too simple
1
u/MoistAttitude Mar 02 '21
Javascript would be the absolute easiest to start with and learn general programming syntax. You can write and test code right in your web browser and you don't need to worry about classes or memory management.
1
1
u/afterhoursdev Mar 02 '21
I personally believe that programming should be started out with passion. There is a pretty steep learning curve so if you arent having fun it will be difficult to maintain motivation. If you have decided that Java is the language you want to learn then by all means do it! If you know Java then python will be fairly easy to pick up so don't worry about it. At 14, if you can develop a deep curiosity for programming then you will make amazing things and have a lot of fun.
1
u/ThatWolfie Mar 02 '21
Of course. Java is a good language to learn, Python and Java are quite different, learning java can be a bit more of a pain compared to Python (in my experience) but learning Java teaches you a lot of really good principles about coding, learning Python after learning Java will be a breeze, the other way around, not so much. It mainly depends on what you want to code.
1
u/xMultiGamerX Mar 02 '21
Start wherever you want. In the end, you’ll learn best with what you’re interested in. So, if you’re interested in Java, that’s where you should start.
1
u/MysticGrapefruit Mar 02 '21
Doesn't really matter which you learn first.
I messed around with Python at first learning on my own, but now studying com sci at university Java has been the 1st language we're dealing with.
1
u/ViralLola Mar 02 '21
I started with Java before Python and suffered no ill effects. Learn what interest you.
1
u/seanprefect Mar 02 '21
you can absolutely start with java. there's no order the programing languages need to be learned in.
1
u/DJCowGaming Mar 03 '21
I started with java, and I think if I had the choice, I would still pick Java. From my experience, knowing Java made learning C++ easier than learning Javascript.
Not to mention that most computer science courses you may take in highschool are going to be in Java or C# (C# is super similar to Java, if you know one, you know the other).
People say you should learn python because you can do anything in python, but so far there hasn't been anything that I have tried in python that I couldn't do in Java more efficiently.
0
•
u/AutoModerator Mar 02 '21
It seems that you are looking for resources for learning Java.
In our sidebar ("About" on mobile), we have a section "Free Tutorials" where we list the most commonly recommended courses.
To make it easier for you, the recommendations are posted right here:
MOOC Object Oriented Programming with Java from the University of Helsinki
Java for Complete Beginners
accompanying site CaveOfProgramming
Derek Banas' Java Playlist
accompanying site NewThinkTank
Hyperskill is a fairly new resource from Jetbrains (the maker of IntelliJ)
Also, don't forget to look at:
The official Documentation
The official Java Tutorials
If you are looking for learning resources for Data Structures and Algorithms, look into:
"Algorithms" by Robert Sedgewick and Kevin Wayne - Princeton University
Coursera course:
Part I
Part II
Coursebook
Algorithms 4th Edition
Your post remains visible. There is nothing you need to do.
I am a bot and this message was triggered by keywords like "learn", "learning", "course" in the title of your post.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.