Why Java is the best Programming language to Learn Coding for beginners?

javinpaul on September 30, 2019

Disclosure: This post includes affiliate links; I may receive compensation if you purchase products or services from the different links provided i... [Read Full]
markdown guide
 

Java is easy for beginners?

Here the "Hello World" program in Java:


public class HelloWorld 
{

       public static void main (String[] args)
       {
             System.out.println("Hello World!");
       }
}

You have to explain a lot of complex topics.

  1. What is a Class ?
  2. What is a Function ? e.g. what does this special main function ? What is args ?
  3. What does the static keyword ?
  4. What is String[] ? You have to explain Types String,Array
  5. What is System.out ? You have to explain Packages

And now in Python:


print("Hello World!")

 

There's php code:
echo('hello world'); this is just the reason for learning Java or other "more strict" languages before Dynamic ones, if you give a kid a php or python or... Similar languages it will be a mess due to non understanding of what a class is etc (and tell me how to work with Python without packages)

 

A similar answer (for the same reasons) can be given for Scala.

And when you learned Scala, you won't even need to downgrade to Java 😁

 

I think c/c++ is better for teaching underlying programming concepts. Particularly in regards to to memory allocation and pointers. However, if one wants to learn programming for practical "I want to get a job" reasons, then Java is a solid pick I suppose.

 

It's valuable to eventually learn concepts like pointers and memory management.

However, they're not critical to learning programming (and increasingly becoming less relevant as compiler and languages improve automatic/checked management of memory and resources), and distract from far more important concepts like abstraction, schemas, patterns, etc. (a lot of other misfeatures in C and C++ are also bad distractions).

 

If learning programming then I agree. If learning computer science, then the lower level stuff is usually better for learning concepts. It all depends on your goals.

If anything, the opposite is true. Computer science does not care about pointers, nor do they care about "low level" details, since those are implementation details that are dependent on hardware.

Pointers don't show up in the formulation of computation in many models (lambda calculus models, Turing machine models, stack machine models...).

They are not particularly important conceptually (in fact, the unsafety of general pointers makes it nearly impossible to talk meaningfully about any nearly computing concepts; you need to severely restrict the discussion to pointers used safely in particular patterns, which is very hard to actually do accurately). They are merely the way that hardware generally implements "constant time" array access.

Even then, that's not true -- there is no such thing as constant time access to memory!

The fundamental concept is just maps, which is entirely obscured by the messiness of pointers.

Hi Alan,

Exactly, do you advice books or sites or blogs to learn the lower level stuff to better learning concepts?

Thanks

 

I think c/c++ is better for teaching underlying programming concepts. Particularly in regards to to memory allocation.

I remember C and it gives me creep because of code like this one:

int **ptr;
 
 

hello @Alan, you have a point, Definitely.

 
 

I think Python is hands down the best choice for beginners, and I don't even like it that much.

If you prefer a language with static typing I'd argue C# is marginally beter than Java.

 

I'd say start with either C# or Java. They both allow you to work with pass by value and pass by reference. They enforce static typing which forces young coders to think about how they are developing. And both have huge enterprise and enthusiast communities behind them.

 

Marginally?

Where Java tried and failed to be a "better C++," C# succeeded at being a better Java

 

Python is multi-paradigm and Java is imperative OOP only. The biggest problem that at the moment pretty much every school teaches you how to write imperative code leaving the possibility to learn declarative functional programming to you with no help. I agree that for low level programming languages imperative code is reasonable and it is still good to know how memory gets allocated and Java doesn't give it. Picking up such language as python gives you freedom in choosing, which paradigm you want to stick with, or at least improving skills right from the beginning. Many developers don't want to learn FP nowadays because they spent years on learning only imperative programming and used it on their work so even mentioning FP makes them angry and dissatisfied.
So I think that C/C++ is still a must and python is a good choice for the next language.

 

How often do people actually write in functional style in Python though? OOP/imperative is still the first thing most Python programmers will learn.

 

Because imperative code is much closer to how human brain works. Line by line. FP is a bit difficult from the beginning because it forces to think in a different way. That's why it is always easier to start with imperative coding. However, if the tool also provides the possibility to write declarative code there is a chance developers try it. Java cuts this possibility making new developers OOP oriented only.

You've got a point. I totally agree that more people should learn FP. But learning declarative in an imperative-first language means that if you can't solve it in declarative there's a big chance you fall back into your comfort zone. If you are looking to learn declarative for educational purposes you're better off choosing an functional-first language. Programmers are expected to learn multiple languages eventually.

I'm not saying to not learn Python first. My point is that these so-called "multi-paradigm" languages are still very much focused on imperative (most of them at least), and choosing Python for the sake of it isn't a good reason.

 

More often than even they realize.

The moment you write your first generator expression, you've already discovered the power of a functional style.

Yes, they start out with OOP (in a rather Self-like style), but much of the language does, despite Guido van Rossom's poor understanding of it, in fact support strong functional style very well, and Python programmers learn it very early on.

 

Java was my fourth or fifth language to learn in my life and I would not dare to say it is good for beginners. Yes, I started with Basic 30+ years ago.

 

I found out that huge impact in this process has an IDE.
Until I tried IntelliJ IDEA I was not able to work with Java either.

 

How is Java syntax easier to read than JS, Ruby or Python?

 

Almost every language is easier to read than (not very curated) JS 😬; Perl being one of the exceptions, of course.

On the other hand, it's a bit harder writing unreadable code in Python, Ruby, or even Java.

 

I think it comes down to what an individual wants to accomplish.
That will dictate what language they should start with.Do they want to do game programming or full stack web design?.There can never be a best language to learn coding.

 

Hey Peter B, I think you have a point. If you want to quickly develop a website then definitely its lot easier in Python and Ruby than Java, but at the same time for getting a job and working in a large project in a big company, Java is always preferred over Python/Ruby.

 
 

Python is just so boring language. In comparison to many other languages looks old and misses modern concepts.
Moreover, it is quite different from C#, Java, Kotlin, Delphi... so if somebody wants to learn or work in those languages Python is not a good choice to start with.

 

How is python a boring language? There's so much you can do with it, it's used for ML/AI research. That's pretty not boring.
Python3 is pretty modern, yes there are oddities that you need to be aware of when switching over. But it's a great language to learn on.

 

I first learned programming with python and then I coded professionally in Java many years. Never had any issues translating my knowledge from one language to the other.

 

Being a boring language is a plus when learning the first one. And Python is pretty complete both in applications and ecosystem.

 

I agree with article because Java is simple, that's why is a good language for beginners. And it is equal to C# in this case.

But Java has one big problem - after you try Kotlin, you never want to go back to Java or C# or C++ or Python...

 

"Java is... Simple... Reads like English"

Lol.

Either it's a troll statement or someone is being ignorant to the existence of languages like Py/Ruby.

 

I've found that my peers who learned programming through java think of code more in terms of blocks of text, while those who learned via python/lispy pathways think of code more in terms of values and control flow. I think the former is rather damaging.

 

As someone who started with Java I most definitely do not think in "blocks of code" when I develop I see the flow and system as a whole. It sounds like your Java friends need more experience.

 

Java and java-like languages are wrong implementations of software development.
Indoctrinations with concepts such as abstract classes, inheritance by extending which suppose to represent real life objects wil hurt you.
Software development is much simpler than that. Learn how to use association relations. You might read somewhere 'Composition over inheritance'. Again, the reality is that the inheritance by extending should not be there at all.

To learn software programming, not to confuse with software development, learn a functional language that do not bother jou much with objects.

 

Just because you don't like OOP doesn't mean it's wrong. You actually gave no reasoning for it to be wrong, which you really should for making such a widesweeping claim against the vast majority of the top languages.

 
 

I have to say that this article is extremely disappointing. I think the author is expressing clear bias and an unfamiliarity with languages he is criticizing.

About the only factual statement made in the entire article is that Java will "help you get a job." This being one of the worst reasons to learn a language, in my not-so-humble opinion.

Yes, Java does have strong institutional presence in the industry, but not often for any good reasons. But that's not a point in its favor, but a neutral one at best.

The syntax, however, is absolutely not "more readable" than C or C++. Java is rather more verbose than modern idiomatic C++, and significantly less readable than C#. It is also certainly not easier to understand than Python, and I question the author's qualification to make such an assertion. Having tutored several beginners in both Java and Python, I can say with certainty that Java is abominably more complicated and difficult for beginners to understand.

I'd also assert that Java's concept of OOP is fundamentally broken. It tried, and failed, to be a "better C++" by going whole-hog on Simula-style OOP, and the travesty of "Enterprisey" code, with its FactoryFactories and CommandManagerFactoryActors, is exemplary of everything wrong with the Java platform and community. Java programmers read GoF as their Bible, when they should read it as the cautionary tale that it is.

Alan Kay was right: Java is not OOP, but Smalltalk is.

Author, stick to your day job. Please.

 

Personally I'd just teach JavaScript to a beginner since web development is always in high demand

 

Definitely not a bad idea, but there was a reason they teach Java in academics. JavaScript is a must if you want to do web development.

 

JAVA is surprisingly easy but nobody works on Vanilla-Java.

So, usually, the pipeline is JAVA+spring or Java+javaee or another technology.

code of conduct - report abuse