Comments

Why I use Java and Why You Should Learn It Too

If you’ve been following me, you’ve probably noticed that I’ve used Java in my Ultimate Data Structures and Algorithms course. I’m also planning to use Java in my upcoming Design Patterns course.

But why Java? Why not C#, JavaScript, or Python?

Well… there were a few well-thought reasons behind this decision.

The top 3 programming languages in the world right now are Python, Java, and JavaScript. Sorry my C# friends, C# is not in the top 3 list. I’ll talk about C# later in this post.

I wanted my Data Structures course (and the upcoming Design Patterns course) help the majority of people out there. So I had to choose between Python, Java, and JavaScript. Out of the three, Java is the one with the best support of classic object-oriented programming concepts.

Why not JavaScript?

Yes, we can do object-oriented programming with JavaScript and I do have a course on that. But let’s be real. Object-oriented programming with JavaScript is a bit messy. JavaScript classes are not real classes. They are syntactic sugar over constructor functions. Also, in JavaScript, we don’t have access modifiers like public and private. Yes, we can achieve them using other ways and I’ve demonstrated that in my Object-oriented Programming with JavaScript course. But still, JavaScript is not the best language for object-oriented programming.

Why not Python?

Python is a great language. I love it! It’s free of clutter and is simple to use. It also has better support for OOP features. So, why didn’t I choose Python? Because based on my research, Python is often used among people in the data science community, rather than professional software engineers. A lot of people are learning Python because it’s the best language for machine learning and AI.

Yes, you we use Python to build desktop and mobile apps as well as backends. However, Python is not the language of choice for building mobile or desktop apps. These days, the majority of people are building mobile apps using cross-platform solutions such as React Native or Flutter. Others do native development in Java (for Android) or Swift (for iOS). The same applies to building desktop applications with Python. Python is not very well known for that reason.

Why not C#?

C# and Java are very similar in terms of syntax and they both have great support for OOP features. So, why didn’t I choose C# given that I have several C# courses?

Well… I looked at different sources to see the popularity of Java vs C#. Google Trends is a great resource. As you saw earlier in the post, Java is way more popular than C#. Does it mean it’s a better language? Well, it depends on how we define “better”.

What is better? A Ferrari or a truck? It depends on what you want to do. Ferrari is a super-fast car but it’s useless if you want to use it to move house. Programming languages are the same. There is no such thing as the best programming language. Every language has pros and cons. C++ is well known for its speed. Python is popular for its simple and clean syntax as well as tons of resources for machine learning.

Just because Java is more popular, it doesn’t mean it’s a better language than C#. In my opinion, C# is a more feature-rich language but Java was marketed better.

C# and Java have been rivals since day one. Many of the features we’ve had in C# for a long time were introduced in Java years later. Some features don’t exist to this day! For example, in Java, we don’t have optional parameters which are very handy. We have to overload a method. Ugly! Jave interfaces are also bad. They allow implementation (default and static methods) which don’t belong to interfaces. I’ve talked about this issue in the second part of my Ultimate Java Series.

I personally prefer C#. But as I said, Java has had better marketing and that’s why it’s always been more popular than C#.

Why Java?

So, I chose Java because it’s used more widely than C# amongst professional software engineers. There are more Java developers out there than C# developers. Most universities and colleges also tend to teach Java, rather than C#.

Now, all that aside, C# and Java are very similar in terms of the syntax. Recently I posted this tweet asking my students if this is Java or C# code?

 

The reality is I wrote this code in IntelliJ (a popular Java IDE). But the code is valid C# and Java code. Someone argued that this is an over-simplified example and shouldn’t be used as a basis for comparison. That is true. But my whole point is that if you understand this code, you can perfectly take my Data Structures or Design Patterns courses.

The point is: You don’t need to be a professional Java developer to take these courses.

What You Should Take Away

In my opinion, Java in the programming world, is like the English language in the world we live in. If Italian or Hindi is the only language you speak, you’re probably not gonna get very far ahead.

If you understand English, you have access to tons of valuable resources. Whether you want to learn programming, or painting, or piano, if you “understand” English, you have tons of resources in front of you. You don’t need to be fluent in speaking English. All you need is to just understand it.

It’s the same story with Java. There are tons of great programming books written and these books use Java. If you simply understand the Java syntax, you can take advantage of these amazing resources. You don’t need to become a Java developer and let go of your favorite language, whether it is C# or JavaScript or Python or PHP.

So, that’s it my friends! That’s why I’ve chosen Java to teach the fundamental software engineering topics such as Data Structures and Design Patterns.

My Upcoming Design Patterns Course

My upcoming Design Patterns course is gonna be one-of-a-kind. I can proudly say that. Most design patterns books and courses are average at best. Many of them are awful. So boring, so dry, without real-world examples. They teach you the concepts using ducks, cars, and pizzas. And worse, most of them don’t teach you the thought process behind these patterns. They don’t tell you how GoF patterns were discovered. My course is gonna be the one that fills the gap. Unlike other courses, I’m not gonna give you a list of patterns to memorize. I’ll teach you how to think and how to design extensible and reusable object-oriented software. 

All you need to take this course is basic Java syntax, which you can learn in an afternoon or two.

I know people feel very strongly about this, some might not even take this course because it’s not for C#. But if you want to be a professional developer, you need to be open-minded, and unfortunately, I don’t have the time to repeat the same concepts for C#, Python, JavaScript and every other programming language out there. I have a long list of courses that my students have requested such as Git, MongoDB, HTML/CSS, Vue and after finishing the Design Patterns course, I’d be working on those.

So if you’re totally set on not learning anything that’s not C#, I think you’re missing out. The choice is yours!

Hi! My name is Mosh Hamedani. I’m a software engineer with two decades of experience and I’ve taught over three million people how to code or how to become professional software engineers through my YouTube channel and online courses. It’s my mission to make software engineering accessible to everyone.
Tags: , , ,

One response to “Why I use Java and Why You Should Learn It Too”

  1. Ochi Fortune says:

    Well said

Leave a Reply

Connect with Me
  • Categories
  • Popular Posts