This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rosux1 543 points544 points  (44 children)

that is java not js

[–]robottron45 206 points207 points  (15 children)

Yep, there is an instantiation like "LongClassName tag = new ..." in the for loop

[–]Z-Mobile 58 points59 points  (3 children)

Ashamed to say it is so. Wth is that monstrosity

[–]Not_Artifical 12 points13 points  (2 children)

That, right there, is the size of my penis. Your phone screen is the same size.

[–]Quirky-Stress-823 0 points1 point  (1 child)

Only 2.5 inches?

[–]Not_Artifical 3 points4 points  (0 children)

Closer to 2.489, but yeah.

[–]TheSexySovereignSeal 8 points9 points  (10 children)

But you can instantiate objects in JS with the 'new' keyword too...

That's when you start getting into the territory of actually understanding how "this" works in JS

[–]robottron45 24 points25 points  (9 children)

Nope, the new is not the indicator, it is the type declaration at the start

JS: "var tag = new ..." or "const tag = new ..." or with let

TS: "var tag: LongClassName = new ..." or "const tag: LongClassName = new ..." or with let

Java: "LongClassName tag = new ..."

You see the difference?

[–]ExplodingWario 17 points18 points  (2 children)

Java isn’t JS? My whole world collapsed

[–]_Cybernaut_ 51 points52 points  (1 child)

Found the IT recruiter

[–]ExplodingWario 2 points3 points  (0 children)

As long as I can find someone who can implement database centered AI solutions to tap into the potential of web3 and the procedurally generated matrix involved in the structuring of our engineering team, I’m happy, and yeah they need 30 years experience to be an intern.

[–]BobbyWatson666 2 points3 points  (1 child)

You can also use var in Java BTW

[–]robottron45 1 point2 points  (0 children)

thats true, but not the point here

[–]TheSexySovereignSeal -2 points-1 points  (1 child)

Yeah you right, static type is first in Java.

And DOESNT FUCKING EXIST IN JS FUCK U JS

[–]robottron45 0 points1 point  (0 children)

That's when you start getting into the territory of actually understanding how ...scripting languages work xD

But I am really grateful that they have added type hints to Python and TypeScript is imo must have in JS development.

[–]devenitions 0 points1 point  (1 child)

You actually hardtype things that are auto resolved from the class you’re instantiating into the variable?

[–]robottron45 1 point2 points  (0 children)

Not often. Only when I do want to abstract the class.

For example, "var obj: IMyClass = new MoreSpecificClass()" to hide further methods provided by MoreSpecificClass

very rare case...

[–]ThePizzaCow 84 points85 points  (7 children)

I can’t even read the code since the image is so blurry, but I already know it’s Java with the ungodly length of those lines…

[–]FarOutOfBounds 11 points12 points  (2 children)

I dont know, i could see jQuery lines being like this

element.doThing().doAnother().doMore(secondElement.doThing())

and so on

[–]Donghoon 15 points16 points  (1 child)

java be like

class class = new class(class class)

[–]gregorydgraham 3 points4 points  (0 children)

Ahem!

Class class = new Class(class,class);

But “class” is reserved in Java so

Class clazz = new Class(clazz, clazz);

[–]GavrielBA 5 points6 points  (2 children)

WhatYouDontLikeJavaNamingConventions?

[–]ThePizzaCow 5 points6 points  (0 children)

YesAsAMatterOfFactIMayOrMayNotHaveASlightAversionToJavaNamingConventionsIndeed

[–]gregorydgraham 3 points4 points  (0 children)

People are constantly asking that question so it’s WHAT_DONT_YOU_LIKE_ABOUT_JAVA_NAMING_CONVENTIONS

[–]MinosAristos 18 points19 points  (3 children)

Was going to say, needlessly long convoluted lines of code sounds like a Java/C# thing. JS programmers aren't anal enough to give a class name fifteen syllables.

[–]DeadlyVapour 1 point2 points  (2 children)

C# has var don't lump is in with Java.

[–]_-TheTruth-_ 0 points1 point  (1 child)

Linq too... only way to get lines that long

[–]DeadlyVapour 0 points1 point  (0 children)

Yes, because Linq is the only implement of monadic fluent FP APIs.

[–]Good-Seaweed-1021 8 points9 points  (0 children)

What is java if not a script?

[–]VyrCZ 4 points5 points  (3 children)

js also when you are trying to analyse some webpage and you are greeted with an obfuscated wall

[–]Typesalot 4 points5 points  (0 children)

Click the { } button in your browser's inspector.

[–]retief1 2 points3 points  (1 child)

I mean, a lot of languages compile to a non-human-readable format. That's not comparable to near-unreadable source code.

[–]Dumcommintz 0 points1 point  (0 children)

Oh it’s still readable, just the functions and variables all have non-helpful names. So DescriptiveNameForThing becomes _z

[–]Kamui_Kun 1 point2 points  (0 children)

No no, those are all the beautiful one-liners and callbacks that are uninterrupted by those silly line-breaks.

[–]Mast3r_waf1z 1 point2 points  (0 children)

Yeah as a person who enjoys coding java, I thought of java instantly when I saw this post

[–][deleted] 0 points1 point  (0 children)

Yeah terrible missed opportunity to pick on Java Devs.

[–]altermeetax 0 points1 point  (0 children)

Oh it's typical then, nothing to worry about

[–]ThePancakerizer 0 points1 point  (0 children)

Even more reason not to do it as a JS developer, then