Why is java such a shit language?

I’ve been taking a course in Java for the last couple of months and I’m constantly baffled by the sheer volume of verbose bullshit I keep having to deal with. Sorry, just venting.

Attached: DE7C9404-95C3-4A63-98F6-0148AD9F4736.jpg (728x546, 76K)

Other urls found in this thread:

docs.oracle.com/javase/specs/jls/se8/html/jls-4.html#jls-4.3.1
dmc.fmph.uniba.sk/public_html/doc/Java/ch5.htm
twitter.com/NSFWRedditImage

The reason you can't do this is because you never specify what it's supposed to be an arraylist of.

That being said, Java is definitely a shit language full of verbose bullshit.

Complaining about languages being verbose is infantile

In Java, everything is an object, except for the
things which aren't objects.

It’s not the verbosity I have a problem with in particular. It’s the alien way that they went about creating it. The way it seemingly constantly contradicts itself.

man, I forgot how kinda dumb Java was
like, I forgot that you couldn't specify a list of primitive type ints and have to use the wrapper class
var list = new ArrayList(); //java 10 finally has var, fuck
list.add(5);
int i = (int)list.get(0);

You can always program Scala, Ceylon or Kotlin etc. later. You just need to understand Java.

That said, in the absence of better design, I still prefer Java's verboseness to Python's dynamic duck typing (they had to tack on more "verbise bullshit" with gradual typing so it can occasionally be easier).

Contradicts itself how? Not saying there isn't a bunch of ugliness, but usually it isn't contradictory or terribly confusing.

The keyword was seemingly. Like how objects are determined and how some things that seem as though they should be considered objects aren’t. I’m just confused but I’m working through it slowly but surely.

Bait thread.
Go ahead. Give example of what "seems to be object but is not"

array

It sounds like you've never used a language besides those two. In C++ declaring a list of ints is just list;. And go makes it even more concise with := . Static typing does not require verbosity, java is unique in the amount verbose nonsense you have to type out.

(NULL)

Array is an object

>good Sir

And in Java it is declared as List muhList . So what?

brainlets shouldn't even try. that iq thread needs to be reposted on this board daily

um sweetie all of those can compile except the last one cause primitives don't have methods you fucking idiot

>there are things that looks like they should be objects but are not!
>list them
>this object right here
>it is object
>oy wey, this was bait thread all along herp derp.

I'm not even OP, I'm the user who replied "array." But anyway, arrays aren't objects, mr durga.

>arrays arent object
in java they are. Go read javadoc.
Here I will help you imbecile docs.oracle.com/javase/specs/jls/se8/html/jls-4.html#jls-4.3.1

>An object is a class instance or an array.
No this is wrong, objects are only class instances, therefore an array isn't an object

> Arrays in Java are objects that can be treated just like other objects in the language.
dmc.fmph.uniba.sk/public_html/doc/Java/ch5.htm

>I cant be wrong
>language creators are wrong
oh fuck off.

No it's not. If you program in java for years, think about how much of your life you're wasting typing out garbage like System.out.println; and ArrayList list = new ArrayList; It also makes everything hard to remember as well as time consuming to type which basically forces you to use a big bloated IDE to make up for it's deficiencies.
No, it's ArrayList list - new ArrayList; You have to explicitly use new for everything then type out the type a second time. It's like 3 times as long.

This is why you aren't the weapon of java nor a real-tim certified expert

Attached: 1567981338189.jpg (474x525, 22K)

Well I mean they are though.

>wasting time typing
ide has auto completion
>wasting time typing
That 'verbosity' later helps debug and maintain old code.

No they are not. Learn language before you comment on it.

I know the damn language and arrays are not objects, they're reference primitives. I don't give a shit what the creators say.

>No, it's ArrayList list - new ArrayList
Wrong. It's just List list for declaring a List of integers. If you also use new, you instantiated it - that goes beyond just declaring the type.

That said, of course Scala and other more modern languages are nicer if you also want to instantiate with their type inference.

Again, if you have to install some big bloated program to automate writing code in a language then that's a good sign it's defective. I don't see how it's relevant to debugging or maintaining old code.

Objects and arrays are manipulated by reference in Java, and arrays are objects.

(cont'd)
PS: Kick your rote learned C++ shit overboard, it doesn't apply to Java. Learn Java as it is, not in terms of C++ doctrines.

>Objects and arrays are manipulated by reference in Java
That is what I just said.
>and arrays are objects
No they fucking aren't, an object is an instance of a class, an array is not an instance of a class.

i did it at uni. was xperienced programming before i got there. imo , with emacs, it is hugely flawed .. what is with the massive, repeating pathnames.it's non explicit. requires much boilerplate. horrible shit, imo

No, fuck that, first of all I've already learned both C++ and Java, secondly fuck Java, it's literally just C++ with GC, implicit asterisks everywhere, type safety, and a giant standard library, and finally fuck C++ too, it's an absolute mess, there's really no reason not to just stick with C.

They ARE an instance of a class, Even arrays declared with [].

int arr[]={3,4,2,4,4,4,4,3,2};
Class c = arr.getClass();
String classNameOfArray = c.getName();
System.out.println(classNameOfArray);

You're just a brainlet.

You clearly haven't learned anything about Java. You're literally making shit up left and right

i don't even use them because arraylists are more convenient and if i cared about minimizing runtime bloat over my own personal convenience i wouldn't be using java but wow that's incredibly retarded

no u
if you don't realize java is just virtualized C++ minus the ability to pass or reference records in any way except by pointer and plus GC and type safety then on the contrary it's you who haven't learned anything about C++

>Int hash = 3.hashCode()
If primitive data types had methods they wouldn't be primitive. Java isn't a scripting language. Who the fuck would ever think that would compile?

Arrays are a class instance. That's why they have built in methods for them. Create a an array in C/C++ to see the difference.

>please do the needful

>brainlets dont know about diamons
ArrayList list = new ArrayList();

You're complaining about things that make no sense. You were saying arrays are not objects though they "should be", you've been proven wrong, then you say its retarded that it is this way. Maybe try not being such a brainlet.

This does compile in C#, but because C# doesn't have primitives.

>then you say its retarded that it is this way.
Because it is. First of all I never said arrays should be objects, I was just giving an example of something an inexperienced person such as OP might think should be an object since it's an aggregation of data. But besides that, it's stupid that arrays are instances of a class, because that implies they have a method table reference, and an array shouldn't contain any runtime metadata, that defeats the purpose of using a plain array.

>that defeats the purpose of using a plain array.

Underneath it there is an array but you have methods that allow you to manipulate it. Java can't give you a raw c style array and be memory safe.

Sure, but the only metadata it needs to be memory safe is the length. A method table on top of that is just gross.

>I am paid per byte of text
And I thought pulp writers expired in the 1930's.

this is retarded you should just do var list = new ArrayList() it's most obvious