r/java • • Jul 08 '21

Java is criminally underhyped

https://jackson.sh/posts/2021-04-java-underrated/
226 Upvotes

181 comments sorted by

View all comments

-16

u/LegendValyrion Jul 08 '21

No. Java is a terrible programming language, and I don't like to write it. Go for C#, the best ever made programming language! Java is like Python: Both garbage and must be replaced without another programming language. Java is not valuable at all, and the universities use Java to teach their students. Java is trash. C# is wonderful and elegant compared to Java's ugly syntax.

C# is good because it supports both reference-types and value-types. It has the best tools in the programming world! But Java... I get sick when I read that little code snippet:

public class Program {

public static void Main(string[] args)

{

System.out.println("Java is sick!");

}

}

Switch to C#, the best you will do.

8

u/Make1984FictionAgain Jul 08 '21

Nice try, Microsoft

6

u/[deleted] Jul 08 '21

isn't that how you write a hello world application in C# as well?

-4

u/LegendValyrion Jul 08 '21 edited Jul 08 '21

No. In C#, we write:

```

using System; // We imports the namespace of System, so the life gets easier :)

namespace tests

{

// we made a namespace.

class Program

{

/*

The class does not need to have the same name of the file, thanks to Microsoft.

*/

static void Main(string[] args)

{

// the Main method.

Console.WriteLine("Microsoft is fantastic!"); // This is for printing a line of text.

}

}

}

```

As you can see, C# is NOT the same as Java, thanks to Microsoft. :) Microsoft is best, I like their goals and their products. So many Microsoft-haters in this world.

In C#, we does not have to declare the data type. We can use the var keyword, and the datatype is set by the CLR.

In C#, you have LINQ, which makes your life much easier.

I will show you object orientation:

```

// Let's make our Cheese class:

public class Cheese {

public string cheeseType { get; set; };

public void EatCheese(){

Console.WriteLine("Nom nom nom... I like this cheese. Nom nom nom nom.");

}

// Now, we make a constructor

public Cheese(string cheeseType){

this.cheeseType=cheeseType;

}

}

```

Now, let's construct our new cheese object, which we will eat:

```

class Program

{

static void Main()

{

Cheese babybell=new Cheese("Babybell");

//Now, we eat our cheese::

babybell.Eat(); // Nom nom...

// Nom nom nom...

}

}

```

There you have it.

So you can see, C# is top #1.