You cannot deny that Java is confusing and uninviting to amateur programmers...

You cannot deny that Java is confusing and uninviting to amateur programmers. So there's these things called abstract classes which can't be instantiated, but I thought classes were the blueprints for making objects? So then what is a class exactly? Ahh, the inheritance tree of this object is 6 layers deep. Don't forget to use annotations everywhere! Oh I almost forgot null checks, you don't want runtime errors do you? Your going to null check every variable...right?

Attached: 1200px-Java_programming_language_logo.svg.png (1200x2195, 116K)

Other urls found in this thread:

harmful.cat-v.org/software/java
github.com/groovy/groovy-core/blob/master/src/main/org/codehaus/groovy/runtime/ArrayUtil.java
jetbrains.com/help/idea/nullable-and-notnull-annotations.html
youtube.com/watch?v=hdHN4L-4t6E
twitter.com/NSFWRedditGif

Also you know the System class can't be instantiated, right? Even though it's not abstract?

You only have to deal with any of these things if you're using a shitty library.

Use composition over inheritance it's the same as every other oop language.

You don't need annotations everywhere.

You don't need to null check every variable. Use Optional for scenarios where something might return nothing or an object.

System can't be instantiated because the constructor is intentionally private. You can do this with any class in multiple languages.

Do you have anymore retarded questions?

Java is so super comfy, I don't even care.

Null checking is the only valid argument. Still you can easily work around it with a couple minutes worth of generating wrapper classes to do the checking for you. Other than that, your shit's all retarded. Abstract classes and annotations are super helpful in large projects, something you've probably never made.

Attached: 94F63D132CFE4F05B5A9F5E923769F23.png (620x581, 16K)

So then what is a class exactly if it isn't the "class" of instantiable objects? Yea it's fucking retarded.

most languages have static functions

There's a built in Optional class to avoid using null.

Fixed.

Attached: scala-spiral.png (304x492, 78K)

>You cannot deny that Java is confusing and uninviting to amateur programmers.
only to NEETs who got conned into C worship and shitting on everything else

Java is so easy even pajeets can pick it up and write working code

>abstract classes are confusing
>here use scala instead
dude

Look up the singleton pattern and factory pattern you fucking idiot. It's perfectly reasonable to use a class without ever being able to directly instantiate it.

use kotlin you fucking pleb

>null checks
the only valid argument

>You cannot deny that Java is confusing and uninviting to amateur programmers.
Compared to what. Because your "arguments" apply to dozens of languages.

Optional in Java is nullable so what's the fucking point.

Null checks aren't a valid argument. Every sane library for Java doesn't return nulls randomly. You should NEVER return null directly in your own code.

OP is just some freshmen who's been coding for a hot thirty seconds and thinks he's entitled to make complaints about things he doesn't even understand the mechanics or logic behind.

You use optional to force the caller of the function to anticipate that the function may return a an Optional.empty() or Optional.of(value). You can return a null but 'the point' is that you never would.

This is like complaining that I can make C++ segfault with 1 line so nobody should use it.

it should always be possible to enforce null checks at compile time imho. while you shouldn't return null randomly, enough libraries do. most devs are monkeys so if you give them the tools to write shitty code, they will.

The only language that makes this guarantee is rust and rust is garbage for a host of other reasons. C, C++, Python, Java, Go, and D don't allow you to force a null check. And even if they did you could just do
if (item.isNull()) {}
item.get().segfaultPlease()
.

There aren't any programming languages in existence that prevent the programmer from doing something dumb. Just a spectrum of language safety features.

optional really is just semantic tho, now you need to check for .empty() and null.

No it's not. Java is one of the, if not the easiest languages to learn. If you have any kind of experience with something you should be able to pick it up and get able to put out working code in less than two weeks.

There's a shitload of step by step tutorials for simple, intermediate and complicated programs where literally everything is spoonfed to you.

Also there are countless free books, wikis and code examples.

And the facts that all the pajeets produce somewhat working code and 12 yos teaching themselves through YouTube to write minecraft mods mean that you should end your pathetic existence if you can't even get into Java

swift also does this senpai

Stop triggering me, you don't need to check for null for a function that returns an Optional. If you don't code any functions that return null (you shouldn't) then Optional is perfectly adequate. Your argument is that it's not explicitly prevented at the language level so it's garbage.

Excessive null checking is one of the biggest thing that new java users do wrong. Please read effective java by joshua block and then come back once you understand a semblance of idiomatic java

Yeah but other languages make it so an optional can never be null. It will ALWAYS be an optinoal. They are good languages.

I've only used swift briefly but I remember there being an operator that allows you to bypass the check explicitly. So it ends up being the same as java where the compiler can't prevent me from making it fail.

which language? Anyway the existence of null in java is a non issue and this is a nit-pick of the language. There are other valid things to complain about like no unsigned ints or the verbosity of the language

harmful.cat-v.org/software/java

yes you can bypass a null check of an optional. the great thing is that if you dont declare your type as optional, there's no way to return null

>github.com/groovy/groovy-core/blob/master/src/main/org/codehaus/groovy/runtime/ArrayUtil.java
holy shit

Why aren't they using varargs?

Abstract classes can be instantiated.

You're making confusion with Interface classes, which are equivalent to C headers and therefore should hold no code logic nor instantiation, just declare which functions are available.

>Alternatives
>Go
opinion discarded

because you cant submit 1300 loc using varargs

hello rajesh, would you like to introduce yourself to the class?

Neither abstract classes nor interfaces can be instantiated. Abstract classes have at least one abstract method. interfaces have all their methods abstract.

> user discovers java is a bloated verbose language

ok

Attached: kotlin_250x250.png (250x250, 5K)

Wrong.

You can create a constructor method inside an abstract class. Try it yourself.

public abstract class Test{

public Test(){
}

}

If you're going to badmouth a language, at least shoot some factual arguments.

1.) Create own class and inherit abstract class
2.) Implement virtual methods
3.) Instantiate class
4.) ???
5.) Poo in loo

Why use Java when C# exists?

Now I understand what you meant.

God, why on earth would someone demand that an Abstract class functions exactly the same as a normal class?

Fucking dumbasses.

this has to be bait.
Yes, you can have a constructor in an abstract class.
That doesn't mean you can instantiate it. It only means every child of that abstract class will inherit that constructor (useful when you are doing very generic stuff that just needs a void constructor, it's very common in Spring)

now try to instantiate it

Swing gives me cancer every time I program it. I get where OP is coming from , especially dealing with large SDKs. It always feels like there is never enough documentation or the documentation is not intuitive. A lot of the time there are random ass classes that are super useful but you'd never know they exist unless you read about them on a forum.

Java is a professional language. Amateur programmers should stick to amateur languages like C, Go or Haskell.

Dude I have worked with Java and now I do C++ for the automotive industry what the hell are you even on about?
C is relevant in electronics.

imagine being too stupid for java

Attached: brainlet.png (621x702, 56K)

>You cannot deny that Java is confusing and uninviting to amateur programmers
It's the standard beginner instruction language.

I mentioned C, not C++, brainlet.

this lmfao

>Swing gives me cancer every time I program it.
>What is JavaFX
why is everyone on this board retarded?

>confusing and uninviting to amateur programmers
>despite millions of pajeets learned it without sweating
Maybe OP is a brainlet?

An utter abomination whose goal is merely to be a "better Java" rather than a good language.
No wonder it's full of inconsistencies and funky syntax.

>which language?
OCaml for example.

>Do you have anymore retarded questions?

Which medical records company do you work for?

>Java is so easy even pajeets can pick it up and write working code

Nobody writes working code in Java. Literally. That's why you HAVE to use error handling for half of its classes.

Yes, Java is bad.
Bad if the things you mentioned (except for null checks) really cause you issues, you should reconsider learning to program.

>Nobody writes working code in Java.
you might be using a different definition of 'working code'

>That's why you HAVE to use error handling for half of its classes.
as opposed to what error-less language?

Just use those in your code: jetbrains.com/help/idea/nullable-and-notnull-annotations.html
Any decent code base already uses them.

you could study java 1 week before start writing shit and none of this would be a problem.

OP here, I never said I had any trouble with the language. I'm saying that there are inherently retarded things about it that make it un-enjoyable to program in and un-intuitive to learn. I've probably coded about 50,000 LOC in my life in Java and most of it has been exceptions, keywords, and null checks.

>* This is a generated class used internally during the writing of bytecode within the CallSiteWriter logic.
* This is not a class exposed to users, as is the case with almost all classes in the org.codehaus.groovy packages.
*
* The purpose is the reduction of the size of the bytecode.
It's a fucking backend optimization.

Stop being retarded. Classes describe sets of objects that share a given number of properties. Subclasses describe subsets of the superclass, etc etc.

Abstract classes are a blueprint for any object that belong to their subclasses. They just don't provide a constructor.

doing it wrong

Gonna start with college soon, have to program in Java. Any good books/online tutorials? I have a liitle bit of experience in other languages.

youtube.com/watch?v=hdHN4L-4t6E

kek