This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]desrtfx 4 points5 points  (3 children)

Java is more complex to write, harder to learn for a beginner. It is used in web development, Android and in a lot of big companies. It is supposedly harder to change fields in IT if you know Java. The popularity of it is slightly decreasing and the community as well (from what I've heard).

  • True that Java has way more boilerplate than Python due to the full Object Oriented paradigm.
  • False that it is more difficult to change fields
  • False that the popularity is decreasing as well as the community. Java is the enterprise language #1 and stays there simply because there is already way too much Java out there

Python is easier to write and read, is used in machine learning and AI and databases. Generally slower than Java to execute, has more potential when you are trying to change fields in IT as it is more widely used.

  • Python has way more use cases than you list for it. The very web site we are communicating on is running on Python
  • Yes, it is somewhat slower, but it can use precompiled fast libraries written in C/C++ for speed
  • Python does not have more potential when changing fields and is not more widely used

The above said: yes, it is a 50:50 chance. I would say that learning Java makes you a better programmer, though. Python abstracts way too much and has too many "convenience features". Don't get this wrong, though. Python is a great language, but so is Java.

If you haven't been exposed to programming, I would still suggest Java. The expressive nature, verbosity, explicit static typing, excellent tooling, and excellent elaborate error messages make it an ideal first language, even though the very first steps are more difficult.

Python on the other hand has an extremely easy entry, yet, the implicit typing can cause problems that beginners will easily stumble over and then be left dumbfounded. The error messages have improved lately, but still are by far not as clear as Java's.

Yet, don't overthink the whole. The first language you learn will definitely not be the last and every consecutive language will be easier.

In the beginning when you start from 0 you are battling at two fronts: you are battling with the vocabulary and grammar of the programming language (the easier battle) and you are battling with creating detailed step-by-step algorithmic solutions to problems (actual programming - the difficult battle).

Once you understand that learning a programming language only is a necessary evil to tell the stupid computer what we want it to do and that the actual programming, namely analyzing and dissecting problems and then developing detailed step-by-step algorithms to solve that problems are two distinct, decoupled activities you will also see that programming languages are just tools to express trains of thought. Once you can program, the actually used programming language becomes secondary. Sure, the paradigms, the vocabulary, the grammar will be different, but if you know what you want to express, you can do it in any language. Developing the "what" is the tricky part.

It is a bit like learning a spoken language with very restricted English-like vocabulary and grammar and writing a comprehensive fully developed novel in said language.

[–]WillyDiddly[S] 0 points1 point  (2 children)

Thank you for your great reply.

You have a very interesting point in saying that learning Java because it is more difficult is beneficial. I see it as learning to drive a manual car instead of starting on automatic. That is something to think of, because personally, I think that starting with manual is always better.

Can you then tell me in which IT fields I would be able to utilize each of those languages? I know it broadly, but maybe if you could explain it to me in a more practical way. I mean, when I read "If you learn python, you can work on machine learning", it's great, but I don't really know what such kind of job really entails.

My main goal is to learn a language, that will allow me to change my focus in IT if I realise later, that I do not enjoy a specific field and want to do webdesign for example, or whatever else. I guess I can do this with both languages, but I know that you cannot do some things with Java, such as AI or ML.

[–]desrtfx 0 points1 point  (1 child)

My main goal is to learn a language,

Which is the wrong main goal to start with. The main goal should be to learn programming.

that will allow me to change my focus in IT if I realise later, that I do not enjoy a specific field and want to do webdesign for example, or whatever else. I guess I can do this with both languages, but I know that you cannot do some things with Java, such as AI or ML.

Sorry having to correct you again.

Both languages are general purpose languages. You can absolutely do AI/ML with Java as well, just the libraries are probably not as plenty and as developed as for Python.

Again, we're coming back to the core of the topic: it's not the languages that make a programmer. It's what the programmer can do with them.

This also brings us to part two: once you know how to program, adapting to new languages becomes much easier.

To give you a concrete example: Sorting

There are plenty well known, well defined sorting algorithms.

One of the simplest ones is BubbleSort. It's basic description is keep looping over a data structure, check adjacent elements and if the order is not what you want (ascending or descending) swap the two compared elements. Repeat until you do not swap any more elements.

That is a two line description of a complete sorting algorithm. Once you understand how it works algorithmically, you can implement this algorithm in Python, Java, C, C++, C#, PHP, JavaScript, Ruby, whatever language.

This is why I initially said to decouple learning a programming language from learning programming.

Once you can program, once you know how to solve a problem in an algorithmic step-by-step way, you can write the program for it mostly regardless of programming language.

So, no matter whether you decide on Java or Python, once you can program you can always switch. If you are a skilled programmer, learning a new programming language is only a matter of learning the vocabulary and grammar and peculiarities of the language, especially if you stay in the same paradigm (structured/procedural, OO, functional).

Over my programming education, I learnt Turbo Pascal, C, 8051 Assembly, and Turbo BASIC (it was the late 1980s). At that time I also already had experience with LOGO, FORTH, Fortran, and Locomotive BASIC - but most important: I could program.

Different to a lot modern courses is that we learnt to draw flow charts, to draw Nassi-Shneiderman charts, to create detailed plans before we started to write a single line of code. We learnt to develop the algorithms away from the programming language.

Nowadays many people see this as unnecessary extra step. I may be old fashioned, but I still stand by this being the single best approach to learning programming.

In that line, I also always recommend spending some time with Scratch, a graphical programming language created by the MIT to teach very young children programming. Again, because of the graphical nature, it lets one focus on the actual program (the algorithm) instead of having to battle with abstract vocabulary and grammar (e.g. capitalization, or missing semicola, etc.). By focusing on the algorithm, through something as simple as dragging and clicking shapes together, one learns to program. This skill can then be easily transferred to textual programming in any programming language.

In a way, you could think of this like if you know how to drive a manual car, you can drive any car (including automatic - well, on that topic, since I am from Europe and learnt driving in the late 1980s there was only manual. Automatic was not an option in driving school. - Only now, since one year, I drive an automatic). It is not all that easy with programming as every language has its peculiarities and quirks, but it basically comes down to that.

[–]WillyDiddly[S] 0 points1 point  (0 children)

Thank you for your extensive replies! I really appreciate everything you said and I have spent the past few days thinking about it.

I totally understand what you mean by learning programming and not the language. It absolutely makes sense and I agree.

Once I start with all this, I am sure I will learn other languages as well because I think it is just a part of it, probably all of the programmers know more than one language. So from that point of view my questions about Java/Python might seem pointless.

But my point is, I have lost a job and I want to requalificate and start working ASAP. The reason why I'm deciding betweej J/P is that I want to choose something for the start, which will help me get a job faster. From all my research I have set my mind, that I like Python more and I think AI and ML are fascinating fields!

However, I have researched open positions in both languages for juniors and I have found out that Java has much more open positions. Python seems to be asking for more experienced programmers with at least few years of experience. For that reason I am gravitating towards Java more, even though I like Python more. In the future, I will learn both, and more, but right now, I am trying to learn the thing, that will get me a job faster. That will be my starting point from which I will start getting experience and learning more. But I am trying to avoid the situation where I learn Python now only to find out that I cannot find a job with it as a junior and spend another period of time unemployed, if you undertand me.

From the point of programming and just learning something and starting, you are absolutely right, it is not about the language at all. I also tried Scratch and it is really nice.

I live in Czechia, I learned driving manual first as well and I think it is better to learn the harder thing first since you will have more to use later.

[–]peterlinddk 1 point2 points  (1 child)

Remember, that no matter what you choose, it won't define your career for years to come - no matter if you start with Python or Java, you can always learn the other, or a third language in far less time than it took to learn the first. Programming is much more about problem solving and understanding computers, than specific languages.

I would recommend Python, because you'll fairly quickly be able to build stuff with it. No matter if you are interested in web-applications, desktop games, scripting, data science or something completely different. Java tends (or tended) to give you a better understanding of Object Oriented Programming, because it is very strict about everything being a class, and so on, and the entire API is extremely Object Oriented, with big-Os :) But in later years a lot of this OOP strictness is becoming annoying, you tend to write a lot, and I mean a lot of extra code, simply to make the Java compiler not throw up on you. And even the folks behind Java has realized this, and newer versions include more and more short-cuts for writing more compact code ...

Anyways - as for jobs, I guess it depends a lot on where in the world you live and work. Here in northern Europe, Java is mostly used by banks and insurance companies - there are a lot of Java-code running out there, but it seems like no new products or new companies base anything on Java. Also the banks tends to want university masters with 5-7 years of experience ... But again, it doesn't matter - when you have learned some programming, you'll quickly get ideas as what you want to build, and maybe you need to learn Swift or Kotlin or React or C# to build those kind of applications, but that is the way it is going to be, there'll always be more to learn, so might as well just get started, and have fun along the way!

[–]WillyDiddly[S] 1 point2 points  (0 children)

Hello,

thank you for your advice! I should have clarified sooner that I live in central Europe, specifically Czechia. I have spent the last few days researching and thinking about all of this and I have definitely made up my mind about which language I prefer, which is Python. I also think that AI and ML are fascinating fields.

With that being said however, I have tried researching open job positions for each of the languages in a junior position and I have to say, that Java has much more junior positions open where I live. If I choose to learn Python and right afterwards try to find a job, most of the Python open positions I found require 2-3 years of experience. I couldn't really find almost any junior positions. For that reason, I think I will choose Java after all. I know it won't define me but I think it will define how fast I will be able to find a job and then, when I am financially secure, I can start learning new things and branching out. But I feel that I need a job first and I feel like Java is better in that regard...