[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Why do you hate java?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 23
Thread images: 2
File: kek.jpg (29 KB, 250x300) Image search: [Google]
kek.jpg
29 KB, 250x300
Is it a shit language?
>>
Only if you're an epic memer on /gee/
>>
>>54467572
>>54467134

Delete this thread, please.
>>
>>54467572
It's too verbose, i have no idea what every function really does
>>
>>54467606
This
I just finished learning it and it takes 4 lines for what takes 2 one word in Python
>>
>>54467595
>not understanding what this thread is about
>>54467606
how's it better than C++ in that regard?
>>
it's pretty designated
>>
File: photo.gif (936 KB, 500x400) Image search: [Google]
photo.gif
936 KB, 500x400
>>54467692
>>
>>54467572
It's not that Java is a bad language.
It's that Java lends itself to writing bad code.

More specifically it lets you write working (but bad) code that interacts with other working (but probably bad) code you've never paid attention to.
This is the called "the OOP paradigm", and employers like it because it lets them add or remove barely competent people from projects with minimum hassle.
>>
IDK OP, it's pretty easy.

 int rValue = calculateHighScore(1500);
displayHighScorePosition("gary", rValue);

rValue = calculateHighScore(900);
displayHighScorePosition("Geodude", rValue);

rValue = calculateHighScore(400);
displayHighScorePosition("Metts", rValue);

rValue = calculateHighScore(50);
displayHighScorePosition("Gayrbo", rValue);

public static void displayHighScorePosition(String playername, int position){
System.out.println(playername + " got into position "
+ position + " on the highscore table.");

}

public static int calculateHighScore(int playerscore){
if(playerscore >= 1000){
return 1;
} else if(playerscore >=500 && playerscore <1000){
return 2;
} else if(playerscore >=100 && playerscore < 500){
return 3;
} else
return 4;
}

>>
>>54467828
That if else forest is kinda sloppy. Clean up your act bro.
>>
>>54467922
IntelliJ reformatted it like that but I'm trying to get better. ;_;

public static int calculateHighScore(int playerscore) {

if (playerscore >= 1000) {
return 1;
} else if (playerscore >= 500
&& playerscore < 1000) {
return 2;
} else if (playerscore >= 100
&& playerscore < 500) {
return 3;
} else
return 4;
}
>>
>>54467976
I don't care about the formatting. The logic is sloppy. You're checking for stuff twice and that's redundant.
>>
>>54468004
pls teach me
>>
>>54467572
Having a class for every little fucking thing sucks
>>
>>54468068
1. There is no need for [else] if you're returning from the method. Just if if if if if is enough.
2. If the first if fails then you can assume playerscore is < 1000. There is no need to check for that again. Same for the other ifs.
3. The most common score should be the first if so that the method runs as fast as possible. This optimization is optional.
>>
>>54467583
/thread
>>
As an opsman, I dislike how much RAM it ends up using every time I see it deployed. That might be more of what I see deployed rather than Java itself. With that said, it gives far more tools for inspecting its heap than, say, NodeJS.
>>
Java is a bad language. Why?
>Null pointer errors
>Most clunky syntax ever
>Its an AbstractFactoryAbstractThreadFactory kinda bullshit
>Eats all your ram
>stupid high spin up time
>lambda's are clunky
>option sum types are stupid, and still don't prevent null pointers
>aspect oriented programming is the new GOTO
>function overriding is brain damage

Basically if I had you java source code you don't know how it behaves unless you know the entire code base. Your methods will be overriden. A logger maybe summoned from the fucking void to log every instance to a AbstractFactory. Inheritance means you'll have a class with no discernible data that just overrides a shit load of methods so you'll read its damn source code wonder where all this shit comes from.
>>
>>54467572
Yes, even setting it up on a fresh install of ubuntu is aids.
>>
>>54467976
public static int whatTheFuckIsThisEverUsefulFor(int playerscore) {

if (playerscore < 100){ return 4;}
if (playerscore < 500){ return 3;}
if (playerscore < 1000){ return 2;}
return 1;
}
>>
>>54467572

Bloated as fuck.
>>
>>54467572
I don't hate it, I just don't like it. It's the oatmeal of languages
Thread replies: 23
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.