← Home ← Back to /g/

Thread 106239106

276 posts 34 images /g/
Anonymous No.106239106 >>106239126 >>106239220 >>106239222 >>106239517 >>106239800 >>106239929 >>106239957 >>106239959 >>106241919 >>106243080 >>106243149 >>106246599 >>106246963 >>106252165 >>106254218 >>106254576 >>106254619 >>106254992 >>106254996 >>106255645 >>106255919 >>106260364 >>106262446 >>106263385 >>106266186 >>106267023 >>106269331 >>106272697 >>106272835 >>106274245 >>106282401
I assume most people that hate Java just got filtered and/or are unemployed.
It just works.
Anonymous No.106239126 >>106239996 >>106272835
>>106239106 (OP)
I assume most people that like Java just have AIDS and/or are dying from it.
Anonymous No.106239220 >>106239996 >>106257466
>>106239106 (OP)
It works but you have to write 5 different classes to do something that in a sane language would be a simple function.
Anonymous No.106239222
>>106239106 (OP)
i assume indians aren't human
Anonymous No.106239387 >>106241985 >>106255240 >>106256133 >>106258000
I'm white, employed and like Java. AMA
Anonymous No.106239404 >>106239898 >>106257451
I sure do love search-replacing javax with jakarta.
Oh boy, more hibernate deprecations!
At this point, I'm just waiting for broadcom to fuck up Spring somehow.
Anonymous No.106239467 >>106239996 >>106243093 >>106244057 >>106263429
It's a mediocre language, everything is verbose and mutable. It hugely improved in recent years though.
Spring and Hibernate on the other hand are complex pieces of trash, would not recommend.
Anonymous No.106239517 >>106239579 >>106241505
>>106239106 (OP)
This is odd to me. How can you care enough to make a thread about this? Programming sucks, programming languages suck. This shit is all boring and awful and destroys your soul.
Anonymous No.106239579 >>106239618
>>106239517
>Programming sucks, programming languages suck. This shit is all boring and awful and destroys your soul.
What that's BS I've been programming for over 10 years now and I still enjoy it, maybe it destroys your soul if you never liked it to start with but there's immense satisfaction in being able to use programming languages to solve or automate various tasks you do yourself.
Anonymous No.106239618 >>106239644 >>106258032
>>106239579
Give me one example of a task you automated that gave you immense satisfaction
Anonymous No.106239644 >>106239679
>>106239618
Importing metadata into calibre for manga and doujinshi, I could pull it from the e-hentai API and then parse and turn it into csv files that I could read into it. I've also wrote my own local "booru" like software for managing and cataloging my image collection and numerous other smalls projects, thread downloaders for 4chan, a 4chan scraper, and other scrapers for websites etc. It's all interesting and good fun. Plenty of other smaller things, just like shell scripts to hash and sort files on my PC etc.
Anonymous No.106239679 >>106239699
>>106239644
So you wrote some scrapers... an LLM can shit one out in 5 seconds
Anonymous No.106239699 >>106239726
>>106239679
Yes, and I wrote these well before LLMs wrote code.
Anonymous No.106239714
they are removing the need to set the max heap size, the jvm will adjust to the memory pressure of the os. pretty neat, no more guessing if 80% of the container risks oom or wastes memory
Anonymous No.106239726 >>106239757
>>106239699
Ok. Still not at all interesting or "fun". You fetch some data and parse into csv or whatever the fuck format, oh wow how riveting. How can someone programming for 10 years get immense satisfaction from this?
Anonymous No.106239757 >>106239792
>>106239726
it did not exist before, then you made it and it works. always magical
Anonymous No.106239792 >>106239840
>>106239757
Except it's not magical at all. You just wrote a simple set of instructions at a very high level, probably using a high level language and leveraging a bunch of code a lot of people wrote before. The same level of excitement that messing with spreadsheets can give you.
Anonymous No.106239800 >>106239941
>>106239106 (OP)
Sorry I'm a C# tranny.
Anonymous No.106239840 >>106239868
>>106239792
it's also satisfying when the spreadsheet works
Anonymous No.106239868 >>106257878
>>106239840
Man I wish I was high on life like you are
Anonymous No.106239898 >>106257482
>>106239404
>I sure do love search-replacing javax with jakarta.
So you're grumbling over something you can fix with a small Perl script?
Anonymous No.106239929
>>106239106 (OP)
It's awesome. Java is India's favorite language for a reason!
Anonymous No.106239941 >>106239976
>>106239800
Too slow for anything that isn't crud webapp #320321391931923.
Anonymous No.106239957 >>106272051
>>106239106 (OP)
>It just works.
I like sealed classes and pattern matching. The best thing since lambdas.
Anonymous No.106239959 >>106250354 >>106265782
>>106239106 (OP)
There are at least 2 things wrong with Java: the idea and the implementation. Using a VM for a small or restricted device is one of the most retarded things ever.
Anonymous No.106239976 >>106240317
>>106239941
Use LINQ! It makes sure you can't work out where you're doing something stupid like loading a gigabyte of table into app memory just to compute a trivial existence check! (Seriously. My boss is an idiot at times.)
Anonymous No.106239996 >>106243103 >>106251956
>>106239126
>immediate ad hominem with no argument
still butthurt from the last thread?

>>106239220
not "have to" - you can write procedurally in Java if you like amassing technical debt for the sake of "faster" fixes

>>106239467
>everything is verbose and mutable
terseness is a misguided virtue. since at least a decade, IDEs have smart auto-complete by initials - you can give full names to things but type only as much as if it were an acronym
mutability means you don't have to juggle state as an external parameter
Anonymous No.106240317 >>106243971
>>106239976
Don't get me wrong. I like how it uses C style syntax for the most part and linq is quite nice but I tried to do some basic stuff in raylib with C# and it was a fucking disaster in terms of performance. 1/2 the speed of Go, 1/3rd the speed of C++. All I was doing was pushing a bunch of number into a couple dynamic arrays, and updating them to bounce a few thousand balls around the screen/push them a bit when I click. Either the dynamic array implementation in C# is a joke or the FFI is completely unfit for purpose and calling C code grinds the CLR to a halt for some reason. I was using the CS raylib bindings to draw
>https://github.com/raylib-cs/raylib-cs
and compiling for release base on what MS recommends in their documentation. The language, base on my initial usage, seems unfit for anything computationally expensive.
Anonymous No.106241505
>>106239517
>Programming sucks
programming is just glorified problem solving, and problem solving is rewarding (at least when you're successful with it)
Anonymous No.106241919 >>106246674
>>106239106 (OP)
HELLO SAAR I DID THE NEEDFUL AND LEARNED JAVA IT IS BEST PROGRAMMING LANGUAGE SAAR EVERYONE SHOULD REEDEM JAVA
Anonymous No.106241985
>>106239387
Any recommendations on starting out?
What's it like being white and employed?
Anonymous No.106243080 >>106245219 >>106246674
>>106239106 (OP)
>I assume most people that hate Java just got filtered and/or are unemployed.

You're late for your Durga java webinar, pajeet.
Anonymous No.106243093
>>106239467
>It's a mediocre language,

You're being lenient.
Anonymous No.106243103 >>106245211
>>106239996
>mutability means you don't have to juggle state as an external parameter

lol you're either a junior or a seriously mentally challenged person
Anonymous No.106243149 >>106243158 >>106243996
>>106239106 (OP)
It doesn't "just" work and the fact that outside of ides the tooling isn't that newbie friendly, but it sure as fuck is better than p#$%on.
Anonymous No.106243158
>>106243149
>and the fact ...
isn't exactly nice, I would rather use vim than jeetbrains or vscoom.
Anonymous No.106243971 >>106244148
>>106240317
>Pinvoke overhead by using a shitty library
>No fucking clue about data structures or GC pressure caused by using the wrong data structures
>Shit load of boxing/unboxing by using again a shitty library
>Being a faggot no coder larper
skill issue
Anonymous No.106243996 >>106244010
>>106243149
why are you programming outside an ide?
Anonymous No.106244010 >>106265664
>>106243996
It's comfy to me.
Anonymous No.106244057
>>106239467
yeah, java's biggest failure has ironically been DI. hibernate is a very neat concept with a very grim reality.
Anonymous No.106244148 >>106244386 >>106245266 >>106245608 >>106246684 >>106246875
>>106243971
If your language can't call C code without significant overhead then your language is a toy. Microsoft depreciating C# for a combo of Rust, JS and Go was a smart move.
Anonymous No.106244386
>>106244148
skill issue
If you want an "import solution" "use solution()" language you should stick with javascript or python
Anonymous No.106245211 >>106248100
>>106243103
>ad hominem
not an argument
Anonymous No.106245219
>>106243080
get new material, sir
Anonymous No.106245266
>>106244148
C# can, PInvoke has a decent amount of overhead and can cause a lot of needless allocations if the implementation isn’t well written, it’s just there so you can easily import from DLLs without fiddling with build settings. You can also just link in a DLL or .lib and call directly. C# will happily do direct pointer arithmetic and unmanaged stuff with unsafe enabled. Look at IMGUI.Net for a competent example of FFI where performance matters.
Anonymous No.106245608
>>106244148
Retard.
Anonymous No.106246599
>>106239106 (OP)
I just assume people who don't like Java like hardware, so they prefer C, and people who like Java don't work with hardware.
Anonymous No.106246674
>>106241919
>>106243080
>muh durgasoft
gojeets are so pathetic when it comes to fitting in naturally
Anonymous No.106246684
>>106244148
>Rust, JS and Go
>Rust
Aryan
>JS and Go
Microsoft no longer has skilled white engineers, only Indian street shitters who vibe code everything.
Anonymous No.106246721 >>106246951 >>106250238 >>106250260
Java should just add a delete operator and operator overloading honestly.
>muh that ruins the point of java
So do anonymous classes and yet they added that.
Anonymous No.106246816 >>106247275
saar java gud saar
>shits on desk
Anonymous No.106246875 >>106247322
>>106244148
benchmarking is hard you probably did something stupid.
C# interop is fastest in its class.
Anonymous No.106246935
Yup, Indian and employed
stack is spring boot + couch base
Anonymous No.106246951
>>106246721
no one but the eldest boomers use anonymous classes
nowadays it's all lambdas, or sometimes a named nested class
Anonymous No.106246963
>>106239106 (OP)
If your standards are low enough to be eating shit i don't think your measures of quality are relevant.
Anonymous No.106247275
>>106246816
saar go better than java saar
>shits on desk
Anonymous No.106247322 >>106247478 >>106255195 >>106255346
>>106246875
If there are footguns using 2 dynamic arrays, allocated once, and doing some basic math on one of them based on the state of the other, then the language is shit. No other language has a problem doing this and pretty much everything that isn't Python or JS out performs C#, by a lot. The program was a mainloop, 2 dynamic arrays, a single nested loop that does some basic linear algebra (translation and collision) and a single draw call which takes 2 integers and a float(the draw call takes about 10% of the cpu time to execute, the math takes around 85%). There are no classes, no reallocations, just some basic math. All the math is identical from implementation to implementation between languages. The only reasonable conclusion is that Microsoft's dynamic array implementation is garbage and has foot guns or the language is too slow to do real work in. Either way, it's unusable.
Anonymous No.106247478 >>106247492
>>106247322
dynamic arrays as in dynamic[]?
Anonymous No.106247492 >>106255195
>>106247478
https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1?view=net-9.0
Anonymous No.106248100 >>106251736
>>106245211
>not an argument

A statement as ridiculous as "mutability is good because you don't have to juggle state as an external parameter" doesn't really deserve a reply, so be grateful.
Anonymous No.106249342 >>106250518
Java is based, though they've should've started working on Valhalla ages ago.

I wanna make games with Java but having to fiddle with JNI/C puts me off it.
Anonymous No.106250238 >>106250518
>>106246721
overator overloading is planned after value types. but i believe they want to limit it to the mathematical operators. something like implementing an "Algebraic" interface and getting + and * with contracts that say what invariants they must uphold. the intention is to make it really unergonomic for the people hating their colleagues to overload + to append to their shitty event sink or something
Anonymous No.106250260 >>106250518
>>106246721
>delete operator
but i don't umderstand what that should do, if you want manual memory management, you can use the ffm api fir that and arena allocate / malloc to your hearts content
Anonymous No.106250354
>>106239959
>Using a VM for a small or restricted device is one of the most retarded things ever.
most java programs are backends in enterprises with tons of business logic. java is pretty great at that (static typing, don't have to worry about memory management, tons of libraries for obscure algorithms and file formats, can dynamically link in all kinds of crap you don't have to build, even if you lose the source code of ancient libs the decompiled code is sometimes even more readable than the original, best in class backward compatibility, little feature overlap and relatively small language so style guide not essential etc.)
Anonymous No.106250518 >>106251087 >>106252103 >>106255978
>>106249342
I would like to use Java for making games but I hate JNI. Even FFM feels extremely verbose to use. I would like to use Java the same way you can with C# and making games, are there any good engines for Java?

>>106250238
Hmm, if (ever) Valhalla finally releases I might consider just dumping C++ entirely, fucking hate that steaming turd of a language. I was considering Rust but literally doing anything with external libraries is dependency hell.
If they are willing to allow operator overloading I sure hope they also revisit String and implement Iterable, the fact that you cannot iterate String in a for loop is preposterous.
Also an operator[] for all collection types and Sequence types would be greatly appreciated.

>>106250260
I want to be able to deallocate objects that are directly inside the Java heap. FFM is verbose and ugly and also allocates OUTSIDE of the Java heap.

CAPTCHA: 0GR8M8
Anonymous No.106250550 >>106251160 >>106251870 >>106263400
And also I hate ::malloc(). I want to be able to match new with delete or even use smart pointers. Maybe disabling garbage collection could be an opt-in feature, or you could manually manage some objects while leaving the rest to the garbage collector. I just feel cleaner being able to clean up after myself, even if the JVM GC is extremely efficient.
Anonymous No.106250699 >>106251066
>make a software
>sell said products to companies
>your software isn't supported by our company
>they still use java 8
Anonymous No.106251066
>>106250699
many such cases
big companies still use c89 or c++98
either way ancient versions
Anonymous No.106251087
>>106250518
>I want to be able to deallocate objects that are directly inside the Java heap
that's probably not going to happen, your best bet is to use ZGC for sub millisecond gc pauses, stop referencing the object and hope for the best. when value classes are done, you can avoid generating garbage altogether though
Anonymous No.106251160 >>106251194
>>106250550
>disabling garbage collection could be an opt-in feature
you can disable it globally by "UseEpsilonGC", but not selectively
Anonymous No.106251194
>>106251160
but don't do it, the standard library obviously allocates and nothing will get collected and you'll run out of memory (unless you manage your own object pools for everything)
Anonymous No.106251736 >>106251977
>>106248100
how do you put state into an immutable object?
Anonymous No.106251870
>>106250550
>I want to be able to match new with delete or even use smart pointers.
Sometimes that's easy, but sometimes that's a total pain to get right (witness the knots that C++ and Rust tie themselves into).
Anonymous No.106251956
>>106239996
>terseness is a misguided virtue. since at least a decade, IDEs have smart auto-complete by initials
code is read a lot more often than written so names should be descriptive, not terse, but there is a limit where names become too unwieldy so they lose their meaning because nobody can remember them, they become "that long one starting with s and ending in consumer" or something in your head, at least for me. typing speed is never the bottleneck, agreed
Anonymous No.106251977 >>106252138
>>106251736
>how do you put state into an immutable object?
by calling a constructor?
Anonymous No.106252036
OOPs, all POOs!
Anonymous No.106252092 >>106252168
https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
Anonymous No.106252103 >>106252113 >>106252417
>>106250518
>Iterable
by the way, that's not great because char is just a 16 bit utf-16 code unit, so it will split code points in half. there already is codePoints() on String returning a stream of ints i believe, that's probably more in the direction you want. but things like modified emojis etc. won't fit in a code point, so you'll probably want grapheme clusters anyway and i'm not sure java has that built in. iterating over individuals chars is not very common in my experience
Anonymous No.106252113
>>106252103
also, wrapping every char into a Character will kill performance, but maybe valhala will fix that so we can enjoy it when we retire
Anonymous No.106252138 >>106252249 >>106252290
>>106251977
how do you update the state, and where do you keep the value of it?
to make a trivial case: if an object's state were a counter that goes up each time a specific operation is performed, how do you update the counter if it's immutable?
Anonymous No.106252165 >>106252195
>>106239106 (OP)
It's quite good and good language design decisions but why the fuck is it so hard to have a .exe in the end. Just distribute all the jre" (a bit big no?) "just use modules bro" (it's horrendous to use and the space saved is not that much compared to the full jre).
Anonymous No.106252168
>>106252092
first rule of enterprise software is that it works, and that shit doesn't compile
Anonymous No.106252195
>>106252165
>hard to have a .exe
they are working on it, but it will probably take a while still
https://cr.openjdk.org/~jiangli/hermetic_java.pdf
Anonymous No.106252249 >>106252390
>>106252138
if you use biginteger for the counter, that's the best thing you can currently do, i.e. offer ergonomic methods that call the constructor to create a new instance with the new state (potentially doing clever sharing with the old instance). for records, they are plannimg to introduce new "wither" syntax so you don't need to write the method
Anonymous No.106252290 >>106252390
>>106252138
even better example, you work with immutable values the same as you work with String (because that's the prime example of an immutable class, modulo the hash code, but that's an internal detail)
Anonymous No.106252390 >>106252446
>>106252249
that doesn't really answer the question
>if you use biginteger for the counter
what if it's just an int primitive?
and even if it's a BigInteger, how do you tether it to an object for which it's acting as a counter?

>>106252290
you also have StringBuilder, which is the main recommended way of constructing Strings dynamically (it's faster than plain String concatenation that creates a new String every time)
StringBuilder is stateful
Anonymous No.106252417 >>106252523
>>106252103
Doesn't String already implement CharSequence anyway? What would be the problem?
>iterating over individuals chars is not very common in my experience
Perhaps the use is mostly relegated to JeetCode exercises, but some kind of iterator for String seems like a reasonable thing to want.
Anonymous No.106252446 >>106252791
>>106252390
>how do you tether it to an object for which it's acting as a counter?
if the object is mutable, reassign the counter field. if the object itself is immutable, apply the same trick recursively. makes it really hard to update a single field nested way down in the graph, but you can use lombok to generate builder methods from existing state or better, use a build plugin like record-builder. but that doesn't come up too often, usually you construct your value at the entry point into your system and then act on it
Anonymous No.106252523 >>106254207
>>106252417
>What would be the problem?
if you are fine with mostly ascii, nothing is wrong. but if you paste the poop emoji into a string, ask for chatAt(0) and print that expecting to see the poop emoji, you'll be disappointed. turns out codePoints() comes from CharSequence though, learned something new today
Anonymous No.106252791 >>106252937 >>106253010
>>106252446
>if the object is mutable, reassign the counter field
why not just mutate the field value? especially if it's encapsulated, ie. not visible from outside of the object
>if the object itself is immutable, apply the same trick recursively
so now something as iterative as iterating a counter has to be done recursively?
Anonymous No.106252828
the fuck are you supposed to run a huge saas service if not java? Some microservices might try to run in different code, some are just using libraries that end up being c so shit doesnt matter anyway

unless you tell me I am supposed to want to next.js
Anonymous No.106252937 >>106253395
>>106252791
class Button {
BigInteger counter;
}
var button = new Button();
button.counter = BigInteger.ONE;
// change counter: BigInteger is immutable, have to reassign field
button.counter = button.counter.add(BigInteger.ONE);
// does not work, no method "setValue"
button.counter.setValue(BigInteger.TEN);
Anonymous No.106253010 >>106253395
>>106252791
>so now something as iterative as iterating a counter has to be done recursively?
record Widget (Button button) {}
record Button (int counter) {}
var widget = new Widget(new Button(5));
// records are immutable, to change counter in widget, need to create new Widget with new Button with new counter value
widget = new Widget(new Button(widget.button().counter() + 1));
Anonymous No.106253395 >>106255463
mutable version - implementation:
class Button {
private int counter = 0;
public void special() {
// special logic
counter++;
}
// ...
}

usage:
Button button = new Button();
button.special();
button.common();
// ...
button.doSomethingDependentOnCounterValue();
note: no parameters used for any method, including constructor
also note that counter value is safe from external modifications

>>106253010
so the state (counter value) has to be juggled as a parameter for the constructor
not only that, the logic for calculating the value is also outside of the object; it's not constrained to the specific operation which it was supposed to count for

>>106252937
same issue with no constraint on setting the value only when the specific operation is called
Anonymous No.106254207 >>106255579
>>106252523
Does it not just return char both times?
Anonymous No.106254218 >>106272835
>>106239106 (OP)
only people I have seen hate on Java are dumbass who are afraid to learn it or got too late to the game hence use new languages to try to make other things poplular...
Anonymous No.106254576
>>106239106 (OP)
A language is not merely is grammar, its syntax, nor is it the complete story to just also consider its runtime semantics, you must also consider the compiler (or choices of compiler), build system, dependency management, and overall ecosystem of tools and available libraries, and finally, the set of peers you will inevitably need to interact with as a user of that language.

Java's syntax might have improved massively over the last 10 years (about fucking time), and its compiler might be "fine", but you to need to manage JVM versions manually, wade through maven XMLs (or if you're truly damned, gradle) to accomplish the most basic of tasks, and once its time to write code beyond hello world, its time to meet your new best friend: Spring. You will spend the next 10 years of your life writing Spring, not Java.

And guess what? All those improvements like record classes and the like? Doesn't matter, doesn't count, every big corpo is still using JDK 8, and will be until the heat death of the universe. You might as well be posting Rust for all the difference it makes.
Anonymous No.106254619 >>106254641 >>106254742
>>106239106 (OP)
I can write backends without all those bullshit hierarchies of abstractions
Anonymous No.106254632 >>106254641
Java is genuinely the best language out there. Any complaint you have about it pretty much already has a solution. Don't like all the boiletplate shit? Use Lombok. Need high throughput? Virtual threading. Java syntax too fucking stupid? Use Kotlin or Scala. Want to build an enterprise-grade REST service? There's a million framework, and half of them do most of the work for you with annotations.
Anonymous No.106254641 >>106254655 >>106254674 >>106254742
>>106254619
good morning saar dont redeem it benchod

>>106254632
Kotlin syntax is retarded zoomer nonsense. Why do nulangs constantly feel the need to invent gay syntax to "distinguish" themselves from C++ and Java?
Anonymous No.106254655 >>106254664
>>106254641
Java is too fucking verbose and C++ syntax is pure niggerdry. See their new annotations syntax
Anonymous No.106254664 >>106254674 >>106254703
>>106254655
Java verbosity is good, it is self-documenting.
C++ syntax is invented by autistic cnile boomers, I expected very little but WHO THE FUCK DECIDED [[=Annotation]] WAS BETTER THAN @Annotation???
Anonymous No.106254674 >>106254742
>>106254641
>>106254664
>he needs annotations
Anonymous No.106254685
>if err != nil
Anonymous No.106254703 >>106254711 >>106254834
>>106254664
Java:
final Integer myInt;

Kotlin:
val myInt: Int?

Both do the same thing, but Kotlin actually says more with less.

Java:
@NonNull final Integer myInt;

Kotlin:
val myInt: Int

Both do the same thing, but Java's nullability requires using a framework for @NonNull where you pick from a million of them, potentially opening the door for human mistakes, leading to inconsistent NPE error messages which may break something for QA/downstream shit. Or, you could write your own logic manually and waste time on boilerplate plus write spaghetti/repetitive code. Kotlin's null check is built-in.
Anonymous No.106254711 >>106254729
>>106254703
This is more because Kotlin was newer than Java and could thus have features like null-safety from the start. That is more of a feature of Kotlin than its syntax.
Anonymous No.106254729 >>106254747
>>106254711
Doesn't change the fact that Kotlin's syntax/features are better.
Anonymous No.106254742 >>106254772
>>106254619
>>106254641
>>106254674
Is Go a tranny or jeet language?
Anonymous No.106254747 >>106254766
>>106254729
>noise keywords like val and fun
>semicolons removed just because
Anonymous No.106254766
>>106254747
You can still use semi-colons, autist.
val = final
var = not final

Comes naturally. L is a hard letter, R is soft. It's so good that Java literally copied var.
Anonymous No.106254772 >>106254781 >>106263864
>>106254742
Jeet.
Tranny languages are languages that are pointlessly obtuse and esoteric for the sake of academic circlejerking, whereas jeet languages are languages that strip away any feature that can introduce complexity to a program out of fear that jeets will abuse the features.
Case in point Go which removes classes, exceptions, and basically everything a sane person would want in a language to become another procedural sloplang, a slightly more modern C with gay syntax and no memory management.
Not to mention Rob Pike is on writing quoted saying that Go was essentially designed to be a language for Google to tard wrangle jeets with.
Anonymous No.106254781
>>106254772
People unironically use that?
Anonymous No.106254834 >>106254877 >>106254900
>>106254703
kotlin users will say oh we have just the operator for this you just go String()+&)Β£+Β£+Β£(_)/Β£+#===Color and it does it automatically
Anonymous No.106254877
>>106254834
thanks, i laughed anon
Anonymous No.106254900 >>106254909
>>106254834
Don't like it? Write your own with Kotlin extensions.
Anonymous No.106254909
>>106254900
how about i just write pseudocode and make an llm fill in the boilerplate :^)
Anonymous No.106254992 >>106255137
>>106239106 (OP)
In the recent month i'm become fully js pilled and everything else looks like clown in comparison
Anonymous No.106254996 >>106254999 >>106255352
>>106239106 (OP)
>it just works
that is php
Anonymous No.106254999 >>106255345
>>106254996
shut your whore mouth
Anonymous No.106255137
>>106254992
pajeet
Anonymous No.106255195 >>106257388
>>106247322
>>106247492
Generic lists are highly abstracted collections that are not fit for your use case.
You should use arrays and if you need new allocations use shared array allocations to reduce GC pressure.
For higher performance on hot paths like a math function you should use aggressive inlining and on tight loops consider pinning the memory using unsafe and pointers.
Compiled it with native aot enabled and you should get near c/c++ performance.
That is the way.
If you still have performance issues you got something fundamentally wrong in you logic / math.
Anonymous No.106255240
>>106239387
Your programming sucks go up to the knee or thighs
Anonymous No.106255345
>>106254999
shut up java cuck
Anonymous No.106255346
>>106247322
in the hands of an idiot every gun is a foot gun.
i guarantee you did something stupid, not related to C# performance at all.
Anonymous No.106255352
>>106254996
>look up php
>early life section
enough said
Anonymous No.106255463 >>106255652
>>106253395
>so the state (counter value) has to be juggled as a parameter for the constructor
>not only that, the logic for calculating the value is also outside of the object; it's not constrained to the specific operation which it was supposed to count for
i wasn't trying to say that you should make everything immutable when it makes your code worse, quite the contrary. for most applications, having a rich domain model like that doesn't work so well though. consider that you want to update the counter value in the database after it changes. do you add a database handle to every button so you can continue to keep the counter hidden?
class Button {
private int counter = 0;
private Repository repo;
public void special() {
// special logic
counter++;
repo.save(counter);
}
}

that's obviously terrible, now you have to carry around that reference for every button, cheat by making it global, make the caller pass it in for every operation that needs it etc. if you use jpa, your entity will have all its fields exposed so hibernate can grab their values (or break encapsulation with reflection so you can pretend they are encapsulated, but that's just lying to yourself). what you usually end up with is an anemic data model, where you just have the data, and move the modification logic outside, then as the last step, save everything to the database at once. oop proponents say that this breaks cohesion, but have no better alternative. cohesion works great if every object has enough context to act on its own, but that's usually only the case in toy examples or ui components maybe
Anonymous No.106255579
>>106254207
>Does it not just return char both times?
yes, it returns the char. for code points above what can fit into a single char, you'll get the individual code unit. is that good? depends on the application
var poop = "\uD83D\uDCA9"; // escaped for 4chan
System.out.println(poop); // prints the poop emoji
char hmm = poop.charAt(0);
System.out.println(hmm); // prints a question mark, probably
Anonymous No.106255645
>>106239106 (OP)
Java is literal hell after using something sane like c#. Yes it "works" but writing it is hell. Something a jeet would enjoy because they already live in hell (India).
Anonymous No.106255652 >>106255776
>>106255463
if a value has to be storable, then yes, it has to be exposed somehow
getters would work and the points about no extra parameters in methods and state not being modifiable from outside of the object would still hold

or, the entity could return an object/structure that's just a view of the entity's values, something like:
class Button implements Storable {
private int counter = 0;
public void special() { /* no repository logic inside here */ };

@Override
public Object[] getStoreArray() {
return new Object[]{ counter /* and whatever other values */ };
};
}

// ...

DataStore dataStore = new DataStore();
dataStore.store(button); // calls button.getStoreArray() and does an INSERT or UPDATE or whatever
Anonymous No.106255776 >>106255879
>>106255652
that would work for keeping the state somewhat hidden, yeah. but it's a losing battle in my experience. you'll have to write sql queries that relate the state of buttons with the state of widgets sooner or later, and then the state is exposed anyway. you could try very hard, but that's usually not how the tooling expects to work with data (and users don't, if they think about data, it's in excel tables, which maps well to relational databases). you can still make it fit the oop mindset though: widen the encapsulation boundary. instead of individual classes, which have too little context, draw the boundary around modules or whole subsystems. everything inside is fair game, you can enforce boundaries with APIs, over the neteork if you want to make sure
Anonymous No.106255879 >>106257608 >>106257618
>>106255776
>and then the state is exposed anyway
i would not equate making values viewable to exposing state

>widen the encapsulation boundary. instead of individual classes, which have too little context, draw the boundary around modules or whole subsystems.
that wouldn't be encapsulation anymore, just limiting scope
Anonymous No.106255919 >>106255932 >>106263414 >>106264292
>>106239106 (OP)
Java is niggerlicious because the whole point is to make programming retard-proof so the Indians can do the needful for pennies on the dollar while the glorious White Engineer from the North sends them the UML from his chaise lounge for the Indians to fling shit at each other over.

The only place where Java makes sense is Data, because a Data point is like an object, but then the gay and retarded class hierarchy and inheritance idea comes in and it all just goes to shit because then the whole game becomes more of a "who can overengineer this class to suck off Mr. Shekelstein the Hardest", and then it stops being fun. In the end, even for data, structs are just better.

"Gee I gotta create the RequestHandler so it handles my request", statements made by the utterly deranged. You are delusional if you think programming is about "defining the correct hierarchy of classes" instead of about simply solving problems.
Anonymous No.106255932 >>106255939
>>106255919
t. filtered by OOP
Anonymous No.106255939
>>106255932
Sneed
Anonymous No.106255978
>>106250518
LWJGL and LibGDX although more of a framework than a engine.

Slay the Spire is built with it, and the best Blood source port BloodGDX.

Minecraft uses LWJGL.
Anonymous No.106256133
>>106239387
Anonymous No.106257388 >>106257773
>>106255195
Generics are compile time feature with no impact on performance and lists are wrappers over arrays and have the same characteristics. Unless you don't preallocate for your target size and add elements so it has to reallocate.
Anonymous No.106257451 >>106257478 >>106263137
>>106239404
>I sure do love search-replacing javax with jakarta.
hahaha
I was wondering when more people were going to be bit by this. I was surprised I don't even see regular posts on HN or 4chan about this. For code bases you totally control, it's not a huge lift and ship, but going from Tomcat 9 to 10 (or insert your faggy meme nonfree or shittier servlet container here) has been a giga nightmare and it makes me question life.

this feels like EJB bullshit all over again, but newer and fresher.
anyone who says the Java ecosystem is "stable" is a delusional tranny and isn't really employed.
Anonymous No.106257466
>>106239220
I personally love seeing one concrete impl interfaces so you always have
SomeInterface.java
SomeInterfaceImpl.java every fucking where.

tests? lol, lmao.
Anonymous No.106257478
>>106257451
one stinker per decade or two is still pretty stable
Anonymous No.106257482
>>106239898
>muh small perl script
lmao, unemployed or not a java jeet.
jakarta bullshit will shit up every aspect of your tooling. build systems, artifact repos, search/replace in your own codebase, nonfree shitware, etc.
Anonymous No.106257608 >>106257798
>>106255879
>would not equate making values viewable to exposing state
if the internal state changes, some other part of the system (the query) breaks, that's what counts imo. you can try to keep the external state stable, but over time that just leads to a confusing mess of mappings and renamings to keep track of. a single class has too little context. also, you usually want to break up your application into related features. if you implement everything inside the customer class, you'll have writing emails, account cancellation, billing etc. all duking it out in the same file. rich domain models have their place, but if allow yourself to take a wholistic view over all the data, you can build much more powerful features
Anonymous No.106257618
>>106255879
>that wouldn't be encapsulation anymore, just limiting scope
encapsulation is limiting scope, to a single class
Anonymous No.106257773
>>106257388
You're right about generics and the pre allocations but wrong on underestimating its abstractions performance impacts.
Anonymous No.106257798 >>106261346
>>106257608
>if the internal state changes, some other part of the system (the query) breaks, that's what counts imo
if the state is actually internal, other parts of the system are inherently not only independent of it, but also not even aware of it

>you can try to keep the external state stable, but over time that just leads to a confusing mess of mappings and renamings to keep track of
that's why it's better to just keep state internally, even if it requires more discipline to keep it that way
Anonymous No.106257878 >>106259560
>>106239868
Man, you just need to code something that you actually use often. No way you'll enjoy it otherwise. Make a game or some shit.
Anonymous No.106258000 >>106259764 >>106279782
>>106239387
Do you need an ultrawide because of java?
Anonymous No.106258032
>>106239618
NTA but I used an arduino board, an LDR and an IR detector to light up LEDs down the stairs when my old dog started to lose her eyesight and was finding it hard getting down the stairs at night.
It was pretty ugly, but it worked and she would stick close to the lights when going down the stairs to go outside to pee or poop.
I miss her so much, but that warmed my heart seeing something I made help someone I love.
Miss you Poppy.
Anonymous No.106259560 >>106274868
>>106257878
>Make a game or some shit.
games are useless
something actually useful would be automating or improving something you do manually and daily
maybe a feed reader or some file organizer
Anonymous No.106259730 >>106260143 >>106260270 >>106260335
What does Java do better than C++? I'm not very familiar with Java.
Anonymous No.106259764
>>106258000
No.
Anonymous No.106260143
>>106259730
Better standard library and build systems actually work
Anonymous No.106260270 >>106260441
>>106259730
Java doesn't mix program-specific code like memory management into business logic
Anonymous No.106260335
>>106259730
Be a managed language that's easier to use.
Anonymous No.106260364 >>106265604 >>106272835
>>106239106 (OP)
yeah this is true now that I think about it. i used to be an elitist java hater when I was a 1337 h4ck3r (unemployed poor). finally got a job that has some java stuff and realized i was wrong. but i wonder how much being paid 6 figures is part of the bias
Anonymous No.106260435 >>106268086
https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/javax/sound/midi/package-summary.html
Thoughts on javax.sound?
Anonymous No.106260441
>>106260270
Just use smart pointers and never manually manage memory again.
Anonymous No.106261346 >>106264187
>>106257798
>if the state is actually internal, other parts of the system are inherently not only independent of it, but also not even aware of it
sure, looking at a regular web application, that's basically ephemeral utility classes and that's it. all other state lives unencapsulated in the database, getting filtered, quried, joined, analyzed, all relying on the exact type, name and relationship to all other state, zero encapsulation. and it's glorious. what's the best selling product last quarter with customers living in this city who also subscribed to the newsletter? cutting across all concerns, no "objects sending messages to each other", a single query that provides massive business value
Anonymous No.106262446 >>106262786 >>106263195
>>106239106 (OP)
I wouldn't really consider myself a real programmer but I'm helping maintain some Java backend and I have no idea how this piece of shit jakarta framework we're using works as fast as it does. Every exception I see has a stack trace as long as 2 A4 pages. Again I'm not a real programmer but it seems like an overwrought overdesigned fucking mess. I'm pretty sure this fucker weaves bytecode with reflection bullshit at runtime too.
Anonymous No.106262786 >>106263146
>>106262446
jboss or weblogic?
Anonymous No.106263137
>>106257451
>I was surprised I don't even see regular posts on HN or 4chan about this.
It doesn't take that long to fix. A literal search-replace does it, and the IDE points to all the places that need attention. Even on a fairly large codebase, it's not much effort.
Reimagining how you should go about using things now that you have access to a lot more modern language features, that takes longer.
Anonymous No.106263146 >>106264132
>>106262786
payara/eclipselink (so really it's some version of glassfish)
Anonymous No.106263195
>>106262446
>I'm pretty sure this fucker weaves bytecode with reflection bullshit at runtime too.
That's the clever bit. The weaver stuff does all its magic during load time. The rest of runtime, it's actually static code (at least from the perspective of the JIT).
You could probably shorten the stack trace a lot 99% of the time, maybe more, but for the rest of the time, shortening makes debugging the problem impossible; leaving the whole thing in keeps it all much simpler. (Learnt that that the hard way.)
Anonymous No.106263385
>>106239106 (OP)
C++ is history repeated as tragedy. Java is history repeated as farce.
Anonymous No.106263400
>>106250550
If Java had true garbage collection, most programs would delete themselves upon execution
Anonymous No.106263414 >>106264376
>>106255919
Like the creators of sitcoms or junk food or package tours, Java’s designers were consciously designing a product for people not as smart as them.
Anonymous No.106263429 >>106268939
>>106239467
Sufficiently advanced Java is indistinguishable from satire.
Anonymous No.106263864 >>106264210 >>106264279
>>106254772
>Classes
>Exceptions
>Garbage collection
>Functional paradigm
If you willingly use a language that has any of listed above it's a massive red flag as they are the tools of someone with next to no programming ability and you're basically relying on the skill of the language creator to solve the problem for you. Even the kid who has been programming for a couple of months in C has moved beyond the skill level of a person who uses above day to day.
>inb4 cope
All the greatest programmers alive use C, even today, for a reason. You have no excuse except your own laziness.
Anonymous No.106264132
>>106263146
does it come with random xml files you have to paste everywhere? we do that on jboss. because editing files did not sufficiently lock their customers in, they also invented their own custom language to manipulate their xml files which you have to use. it sucks, if you were wondering. also, custom module system that's like osgi, but without the benefits because jboss deps just take precedence over your own so you get to work around stale jackson and whatever. still, liferay was worse, i would probably live on the street rather than going back to deploying portlets and trying to wring any amount of user experience from that stone
Anonymous No.106264187
>>106261346
you're conflating state as business data with state as an implementation detail in a program
Anonymous No.106264210 >>106264239
>>106263864
t. filtered by OOP
Anonymous No.106264239 >>106264259
>>106264210
oop is an 90's-00's craze pushed by grifters of that era as a solution to a problem that doesn't exist and has 0 technical merit. It is less performant, uses more memory and creates more obfuscated, messier code than just plain old imperative programming. It is the tool of a jeet with no programing ability who is unwilling or unable to think like a computer. Way to out yourself.
Anonymous No.106264259 >>106264289
>>106264239
that's a lotta words to say "i got filtered by OOP"
hope you don't write your code like you write your posts
Anonymous No.106264279 >>106264289
>>106263864
>classes, exceptions, functional programming, le bad!
Street shitting gojeet detected
Though you pretend to be some embedded programmer with manual memory management so maybe this is a cnile larper
Anonymous No.106264289
>>106264279
>>106264259
I accept both of your concessions. As a superior programmer it is my duty to offer you a way to repent for you sins. Start here:
https://archive.org/details/c-programming-language-2nd-edition
Anonymous No.106264292 >>106264300 >>106264376
>>106255919
>abstraction bad, you have to rewrite everything and have no reusable code, nothing should be reusable, saar, programming is when i write thousands of lines of code to do one task and when i have a new problem i dont reuse any of it
Anonymous No.106264300 >>106264981 >>106265555
>>106264292
You can predict the future? Fucking amazing. Please can you tell me the lottery numbers for tomorrow please.
Anonymous No.106264317 >>106264359
>it's the "predict the future" dumbass again
you have already proven you're incapable of abstract thought in the last couple of threads
why do you even enter a thread about a language you you don't like, use or understand?
Anonymous No.106264359 >>106264730 >>106265555
>>106264317
Ok but if you can't predict the future why are you making code for the future? That's a lot of work for no benefit. Some would call it busy work. If you're scamming a FAANG company for hundreds of thousands a year go for it but it's an insane thing to do for your own projects.
Anonymous No.106264376 >>106264432 >>106286576
>>106264292
I never said any of that; in fact, Java tends to attract the Pharisee type more often. I actually hate that the golang std library omits a lot of conventional functions in the name of being a language for Pharisees: golang is Java for people in denial that they're not Java programmers.

I simply said that object orientation is crap and the imperative paradigm is just best. Functional languages also sit well with me, but they really are not necessary, and attract their fair share of Pharisees as well.

Object Orientation is simply a crap paradigm invented by people who want third worlder slaves and to give them "something to do", such as >>106263414 said.
Anonymous No.106264397
The Java Runtime is absolute trash.
Anonymous No.106264432 >>106264529 >>106264623 >>106286194
>>106264376
>Object Orientation is simply a crap paradigm invented by people who want third worlder slaves and to give them "something to do"
Go ahead and elaborate on this. Do you really think
Elephant horton{};
horton.eat(Peanut());

is some grave sin, and we have to write code like
struct Elephant* horton = malloc(sizeof(struct Elephant));
init_new_elephant(&horton);
struct Peanut* p = malloc(sizeof(struct Peanut));
elephant_eat(&horton, &p);

to satisfy your procedural delusions?
Anonymous No.106264529 >>106264730 >>106286199 >>106286592 >>106286626
>>106264432
But you fail to specify the compromises in the former case, where there's stupid amounts of ceremony behind and you need to fucking do Elephant extends Animal implements Herbivore, and that there's a plethora more bullshit. For example, I also don't want any public/private/static bullshit. I want to manipulate everything, even if I am doing something dangerous in memory. That's why I like Commodore 64 and Pico-8: it respects my intelligence and my decision to shoot myself in the foot if I want to, which Java will never.
Anonymous No.106264623 >>106266135
>>106264432
The first hides the hundreds to thousands of allocations + associated code java is doing in the background to manage your objects for you. The second is everything related to the creation of that data front and center with nothing hidden and gives complete control to the person writing the code. Hiding shit from the programmer is only good when said programmer is a webdev aka the NPC's of programming. Have higher standards for yourself. Funny thing is if you use arena's, which you can implement in like 200 lines of code and then use in every single project forever, you can simply just call 1 function and have similar levels of abstraction to java without all the associated baggage.
Anonymous No.106264628 >>106264694 >>106264738
or their ego is so script kiddified that they think Java isn't a real language and it's for high schoolers
Anonymous No.106264694 >>106265615
>>106264628
The irony of calling others script kiddies when Java is technically an interpreted language (aka scripting toy lang).
Anonymous No.106264730 >>106264751 >>106264754
>>106264359
you have been told and shown many times: there is no predicting of future
you keep repeating strawman points

>>106264529
>where there's stupid amounts of ceremony
and manual memory allocation is not ceremony?

>it respects my intelligence
funny how only extremely primitive environments devoid of abstractions are able to respect your "intelligence"
Anonymous No.106264738
>>106264628
>I can't get hard unless it's statically typed with GoF with an IDE saar
Anonymous No.106264751
>>106264730
Java itself is not inherently bad, it's just that once you learn to ride the bike without training wheels it feels clunky to have to ride with them on again you know what I mean.
Anonymous No.106264754 >>106264912
>>106264730
Strawman points. Please elaborate. So what are you trying to achieve when you make code reusable and for future use cases? just wasting time to appease your own ego?
Anonymous No.106264912 >>106264981 >>106265555
>>106264754
>Strawman points. Please elaborate.
you keep making arguments against points made by no one but yourself

>So what are you trying to achieve when you make code reusable and for future use cases?
I don't set "future use cases" or "make it reusable" as goals when writing code

my usual goals are clean abstractions, low coupling/high cohesion, and not breaking previous implementations if not necessary
Anonymous No.106264981
>>106264912
No I do not. You have imagined I'm someone else because you're insane. I joined the thread >>106264300. Your head cannon makes me think I'm some boogey man from your past or some shit. Pure insanity.
Anonymous No.106265555
>>106264912
no one ITT has made a point that OOP code is supposed to "predict the future" but argument against this point has been made anyway, eg. >>106264300 >>106264359

>joined the thread >>
it is an anonymous imageboard. if you repeat/emulate someone else's idea/stance, tone and wording in a discussion, you essentially become that previous poster
you as a person don't matter in the discussion anyway. ideally everyone would only refer to the posts and not the posters; responding to posts with "you" is just simpler language-wise

also the exact same argument with same/extremely close tone and wording has been made in some previous very recent threads about Java
Anonymous No.106265604
>>106260364
Java isn't that bad, when you see what you see the average Python project maintained by some retard that believed to be a rockstar then hired jeets to somewhat fix it.
Anonymous No.106265615 >>106265873
>>106264694
>is technically an interpreted language

First, this is an implementation consideration, not an inherent property of a language.
Second, the main implementation of Java (OpenJDK) has been based on just-in-time compilation for decades at this point.
Third, the Java compiler (HotSpot) is probably one of the most advanced there is in terms of runtime optimization.
Finally, AOT compilation has also been supported for many years now.

You have no idea what you are talking about.
Anonymous No.106265664
>>106244010
but you just said it isn't?
Anonymous No.106265782
>>106239959
>Using a VM for a small or restricted device is one of the most retarded things ever.

You don't know (computer) history or computer science very well.

Bytecode can be more compact that native code, in which case the use of a VM can make sense on a small device, especially if the VM implementation is itself compact.

That's one of the principles behind Forth, which is typically implemented as a small stack-based virtual machine executing threaded code.

Also look into UCSD Pascal. They wanted to make Pascal run on very small personal micro-computers (including 8-bit ones, with not much RAM), and part of the solution was to use a virtual machine with a very compact bytecode.

Parallax microcontrollers are natively designed to run bytecode.
Anonymous No.106265873 >>106274552 >>106283102
>>106265615
The JIT doesn't run until it detects around 4k iterations of the same thing and even then the JIT has to be able to figure out if it can be compiled or not given its constraints. Until the JIT kicks in it's just interpreting bytecode => machine instructions, just like Python and Ruby. Also that sort of runtime reflection isn't cheap. VM JIT langs only match langs like C in meme-marks doing trivial shit (like counting to a billion) where the JIT can cheat and just exit without executing anything. Not only is this slower in real world applications, it requires a fuck load more memory for the same tasks. The user essentially pays for you inability to do basic shit, like manage memory, with a shittier experience. Also in regards to your Graal VM copium. It just packages a large chunk of the JVM into a binary lol. Not only does it take 1-2mins to compile down to a binary for trival shit like hello world, that hello world is sized in megabytes when it should be bytes/kilobytes.
VM langs are for jeets who refuse to learn to code and I stand by my point that someone with 1-2 months of experience in C, even if that's all the programming experience they have, is a far better programmer than any pure Java programmer on the planet (and it's not even close) because at least they are able to discern what allocations their programs will need without some dogshit 3rd party doing it for them.
Awaiting your seething response with glee.
Anonymous No.106266135 >>106266179 >>106268233
>>106264623
>if you dont want to write five lines of boilerplate nonsense by calling malloc and initializer functions you are a webshitter
Are you retarded? Invoking operator new automatically gives me a pointer to exactly enough memory to store the object. No need to write malloc(sizeof(struct MyPenis)) or bullshit like that.
Organizing code according to related behavior and properties is intuitive and simple. A genius admires simplicity, an idiot admires complexity. No one thinks you are a genius for writing malloc boilerplate nonsense when a constructor literally handles all the allocation and initialization logic with no overhead, quit being delusional.
Anonymous No.106266179 >>106268759 >>106274805
>>106266135
>Complains about writing malloc(x) because muh loc bullshit arg
>Thinks writing public stat void main(string[args]) {} is fine.
>Thinks writing public x, private y in front of very variable is fine.
>Thinks wrapping a bunch of code in bullshit try { } catch (x) {} is fine.
> Unable to build his own simple 2-3 line macro that can allocate enough memory for what xir wants in a single line because xir is a victim of java brainrot.
I like your picture though. I'm stealing it.
Anonymous No.106266186
>>106239106 (OP)
I just find it to be ugly
Anonymous No.106266740 >>106269176
>uhh jeetva can actually be a decent language!!
99% of cuckva projects are 30 jeets struggling to build a web app with spring, building a StruggleTemplateAbstractionFactory above all else
Anonymous No.106267023 >>106268191 >>106283113
>>106239106 (OP)
I hate it as everyone seemed to move to Kotlin once I started learning Java.
Anonymous No.106268086
>>106260435
It gets the job done.
Anonymous No.106268191
>>106267023
Kotlin is very niche
Anonymous No.106268233
>>106266135
So the complete moron thought underdeveloped country customs are race-specific? Racism is the leading ape-like behavior, more close minded that shitting up the street.
Anonymous No.106268759
>>106266179
>>Thinks writing public stat void main(string[args]) {} is fine.
at least the args array (and literally every other array) doesn't need to carry the length as a separate parameter
and the String type supports UTF-8
also for one basic line of code you made at least 3 errors
>>Thinks writing public x, private y in front of very variable is fine.
only fields, methods and classes have access modifiers, variables don't
also by using fields you save on declaring and passing a lot of variables in the first place
>>Thinks wrapping a bunch of code in bullshit try { } catch (x) {} is fine.
significantly better than returning error codes
>>muh memory allocation
don't care, the JVM does it for me
Anonymous No.106268939
>>106263429
going low level C for high-level problems is as satirical as over engineered abstraction
Anonymous No.106269176 >>106270033
>>106266740
>gojeet kvetching
saaaaaaar
Anonymous No.106269331 >>106269364 >>106272835
>>106239106 (OP)
You can actually earn money with Java. Of course this board hates it more than anything else in the Universe.
Anonymous No.106269364 >>106279200
>>106269331
Java is still used ubiquitously and makes billions of dollars, while Gojeets get paid five rupees per line of code.
>muh java boilerplate
try catch is infinitely easier to read than if err != nil
Anonymous No.106270033 >>106270762
>>106269176
spring agjually gud saaaar
JAVA 2030 SUPERLANG
Valhalla shri ram
Anonymous No.106270762
>>106270033
if err != nil SAAAAAAR IS SUPER REDEEMABLE
DONT FUCKIN REDEEM IT
COMPOSITION OVER INHERITANCE GOOD BECAUSE CLASSES NEED TO HAVE MULTIPLE POINTERS TO BASE CLASSES SAAAAAAAAAR
ROB KIKE SRI RAM, BENCHOD
I REDEEEM THE UPPERCASE PUBLIC BASTAR BICH
GO WILL OVERTAKE JAVA IN 2030 SAAR, WE GONNA BE GREatest LANGUAGE
Anonymous No.106271314
>i am silly!
Anonymous No.106271342 >>106271530
Which one shits the street more,
Jeetva oder JeetvaSkrit?
Anonymous No.106271530
>>106271342
Go
Anonymous No.106272051
>>106239957
just use Scala
Anonymous No.106272697 >>106274078
>>106239106 (OP)
Is it easy to learn Java as a JS/TS dev?
Anonymous No.106272835 >>106274187
>>106239106 (OP)
>>106239126
>>106254218
>>106260364
>>106269331
I'm not sure why /g/tards think it's impossible to hate something but also get paid from using it
Anonymous No.106274078
>>106272697
>Is it easy to learn Java as a JS/TS dev?
yeah, you can define data types, have the usual control structures like if, else, for, foreach, while, do-while, switch, pattern matching / deconstruction, exceptions work about the same (modulo checked exceptions, but you can wrap them to work the same), some additional goodies like try-with-resources to make resource cleanup failsafe, etc. there are even libraries to run javascript inside your java program. the language is great, what's hit or miss are the frameworks. everything jakarta or spring is not hard per se, but they have their own way of doing things which requires a bit of getting used to. the java ecosystem has a rich history of overengineered solutions looking for problems, but you don't have to write programs like that and the sentiment is changing
Anonymous No.106274187 >>106274569 >>106283156
>>106272835
if you are trying to do a good job, sooner or later you'll write a piece of code that you are proud of. you might say it was despite java, but writing down the smallest, simplest, direct representation of the requirements transcends the programming language, you can do it everywhere. i just don't believe you can hate the tool for long after having done that a couple times. might be stockholm syndrome, but java grows on you, it's a little-nonsense language with an oop history, but it's multi paradigm like all modern languages. you can hate the code written in it though, having to maintain complicated, slow, buggy beasts is not fun, but that's not unique to java, it's just more prevalent there because it's used so much for large systems
Anonymous No.106274245
>>106239106 (OP)
Java is so comfy. Any Angloid who sucks at Java or dislikes it is a midwit.
Anonymous No.106274552
>>106265873
>just like Python and Ruby
except with a bytecode set designed for working fast
not all bytecode systems are made equal (and many are intended to make implementing a particular language easy rather than going especially fast)
Anonymous No.106274569
>>106274187
you wait until you see complex enterprise software written in goddamn python; brr!
Anonymous No.106274805
>>106266179
>Complains about writing malloc(x) because muh loc bullshit arg
Not about lines of code, there is just no reason to when constructors do precisely that and are no more complex than they need to be. It just allocates memory, calls ancestor class constructors then your own constructor.
>Thinks writing public stat void main(string[args]) {} is fine.
Oh no, explicit self-documentation of the main function that highlights the fact that the main function is static, oh no, main returns void, not the String[] args (but int argc, char* argv[] is totally cool though)
>Thinks writing public x, private y in front of very variable is fine.
Access specifiers? The horror! Oh, the humanity!
>Thinks wrapping a bunch of code in bullshit try { } catch (x) {} is fine.
How DARE you pass control flow to a dedicated cleanup/error handling block when a function experiences an abnormal occurrence! How DARE you have dedicated blocks to call destructors and cleanup code inside of!
>Unable to build his own simple 2-3 line macro that can allocate enough memory for what xir wants in a single line because xir is a victim of java brainrot.
Saar, preprocessor good saar. Use preprocessor as much as possible saar. Obfuscate as much code as you can behind preprocessor saar. What is compile time expressions and modules saar. What is type safety saar. I only use headers benchod. Never redeem any code that is not mangled by the preprocessor, saar.
Anonymous No.106274868 >>106276118
>>106259560
Sure, this was an idea for someone who rather plays the games than organizes their stuff. Even if it's useful in the grand scheme of things but not for you, you're setting up yourself to be a miserable fuck.
Anonymous No.106276118
>>106274868
>idea for someone who rather plays the games than organizes their stuff
all the more reason to write something useful instead of a game or other timewaster
Anonymous No.106276360
java was fine for what it was.
enterprise in any language adds needless complexity for job security
but like a decade ago the best xmpp opensource client was in java so I used it to write my code
but still was a bad language supported by the jvm
Anonymous No.106276710 >>106277174
How do you like your beef, OPoo ?
Anonymous No.106277174
>>106276710
LGBTshit is illegal in India
pajeet voice >>> tranny voice
javachads won
Anonymous No.106277312
it's pretty bad but it's fine
Anonymous No.106279200 >>106279687 >>106279930 >>106283719 >>106284067
>>106269364
>try catch is infinitely easier to read than if err != nil

This is such a retarded talking point. Even the Golang designers finally decided to completely abandon the project to add syntactic sugar around the standard error handling. That's how much a non-issue it is.

You would know why if you've ever programmed anything serious, but I'm happy to explain.
First, why do you think Golang is used a lot on the backend, in cloud environments, for networking, distributed systems, etc. In other words, in environments where you CONSTANTLY have errors of various kind: network, timeouts, DNS, file system, etc.

Isn't that an apparent contradiction? Why would you use the language with supposedly the "worst" error handling, in environments where you have the most errors?

The obvious answer is that in such environments you actually have to handle errors anyway, you can't just catch at the top level and log it, like a Pajeet would do. In which case, most of the time is spent writing the actual error-handling logic, and the syntactic details of explicit vs. exception-handling are essentially irrelevant.

I write Golang for a living, writing large-scale distributed systems. My error handlers retry SQL queries with extra diagnostics, record various statistics and metrics, upload various diagnostic files to S3 buckets for further investigation, and so on. So the distinction of
>if err != nil {
vs.
>try { } ... catch {}

is completely irrelevant.
Anonymous No.106279687 >>106285567
>>106279200
>Even the Golang designers finally decided to completely abandon the project to add syntactic sugar around the standard error handling
because golang is designed specifically for the dumbest retards, ones that get confused and overwhelmed by try-catch blocks

>i'm so smrt because in my use cases don't need to throw errors above the place they happen
good for you
meanwhile i will keep using Java's throw and try-catch mechanic to keep most of my business logic clean of error handling code, along with the underlying mechanic of providing me with a stacktrace telling exactly what and where caused the error; try-catch-finally and try-with-resources also being appreciated
Anonymous No.106279782
>>106258000
kek
Anonymous No.106279930 >>106280112
>>106279200
>You would know why if you've ever programmed anything serious,
Says the jeet talking about using the new flavor of the month slop language while shitting on the language that's been used as an industry standard for decades
Anonymous No.106280112 >>106280152
>>106279930
>t.
Anonymous No.106280152
>>106280112
Anonymous No.106282401
>>106239106 (OP)
i always figured the main reason people end up hating Java is they worked on a big enterprise Java codebase maintained by a bunch of contractors and got disgusted by it
Anonymous No.106283102 >>106283219
>>106265873
>VM JIT langs only match langs like C in meme-marks doing trivial shit

I hate Java with a passion, but you're wrong.

https://www.techempower.com/benchmarks/#section=data-r23

the JIT in the JVM is truly a modern wonder of software. Too bad they bundle it with a shitty pajeet-oriented programming language.
Anonymous No.106283113
>>106267023
>I hate it as everyone seemed to move to Kotlin once I started learning Java.

Lol, not using Scala3
Anonymous No.106283156
>>106274187
>writing down the smallest, simplest, direct representation of the requirements transcends the programming language, you can do it everywhere.

Yes? Do everything in assembly language from now on, then.

> might be stockholm syndrome, but java grows on you,

mold and infections also grow on you

> it's a little-nonsense language

examples of nonsense:
- not everything is an object (see int vs Integer)

- not able to switch on strings for the first decade Java existed

etc.

>it's multi paradigm like all modern languages.

java is not multi-paradigm

be sincere, you're a junior developer.
Anonymous No.106283219
>>106283102
This is one of the painful truths of software.
Pajeetlangs like Java get so much engineering investment in tooling and runtime that humanity could've cured cancer twice over by now. Instead we get to chose between having a shit language + world-class tooling, or good languages and glhf-tooling.
It's the same thing with Javascript. Disgusting language but V8 is shockingly good.
Anonymous No.106283719
>>106279200
your "error handling" feels like stone age technology

this is what real software engineers are using
https://github.com/App-vNext/Polly
Anonymous No.106284067
>>106279200
>such environments you actually have to handle errors anyway, you can't just catch at the top level and log it, like a Pajeet would do

You're based. However, Golang sucks too. But you're right.
Anonymous No.106284636 >>106285315
Give one (1) valid reason why Java is a pajeet language.
Do not mention Durgasoft, or >java second most popular language in India. Give one fundamental flaw of Java that can only be categorised as pajeet.
Anonymous No.106285315 >>106285686 >>106286072 >>106286182
>>106284636
>Give one fundamental flaw of Java that can only be categorised as pajeet.

Just one? You make it easy.

No true closures (lambdas can't capture the surrounding environment).

Ironically, other JVM-based languages can do it.
Anonymous No.106285567 >>106285701 >>106285785
>>106279687
>with a stacktrace telling exactly what and where caused the error

It never does because all you have is a stack trace.
It tells you something about the location in your code, never the state of your program. So it tells you *where* the error is, never what.

With Golang error handling, you effectively build up the stack trace manually as you go, which allows you to do two things:
- remove a ton of the noise you typically see in Java stack traces (not every frame is useful)
- add information about the *state* of your program (variables)

So you build up an error that looks like this:

failed to retrieve calendar '2025': failed to GET 'https://somewebsite.com/calendar/2025': failed to resolve 'somewebsite.com': timeout (after 5s)

As opposed to an enormous Java stack trace that doesn't tell you much.
Anonymous No.106285569 >>106285606
luv me java
luv me intellij
'ate segfaults
simple as
Anonymous No.106285606 >>106285651 >>106285676
>>106285569
Why should I use IntelliJ instead of Eclipse or NetBeans.
Everybody says refactoring but all of those IDEs can refactor methods and call Maven.
Anonymous No.106285651 >>106285676
>>106285606
>Why should I use IntelliJ instead of Eclipse or NetBeans.
Because you love giving money to Goybrains.
Anonymous No.106285676 >>106285724
>>106285606
I just feel comfortable in it. If your tools work, don't change them.

>>106285651
It's free.
Anonymous No.106285683 >>106285697
Why does running java software need to be such a nightmare? Every single other language has a convention of supplying a make/cmake macro and you just go. With java i need to import some kind of spring profile or some other crap and I end up having to install intellij/eclipse to run the program and immediately minimize it
Anonymous No.106285686 >>106286080
>>106285315
>No true closures (lambdas can't capture the surrounding environment).
Capturing by reference or by copy? Currently, capturing is by reference (cheaper than full copies), but only of non-mutated variables (which hides what's going on). True mutable captures require actually hoisting the stack frame at least partially onto the heap, and that's a more extensive rewrite than Java's typically liked doing.
IOW, we know how but it would come with downsides. Pretending it doesn't is either stupid or disingenuous.
Anonymous No.106285697 >>106285719
>>106285683
>Every single other language has a convention of supplying a make/cmake macro and you just go.
And then I have to spend a day or two working out how to tweak the damn cmake macro to work on my machine because the stupid thing refuses to do it out of the box? BTDT
Anonymous No.106285701
>>106285567
i don't even bother to write exceptions messages, because the location is more than enough.

>failed to retrieve calendar '2025': failed to GET 'https://somewebsite.com/calendar/2025'
that's a trace log, not errors. different use case.
Anonymous No.106285719
>>106285697
cmake that doesn't work out of the box should never have been committed in the first place unless your ci just yolos everything
Anonymous No.106285724
>>106285676
Boss wants to use AI agents to generate untold amounts of slop and the choices are:
- Cursor (VSCode fork)
- Windsurf (VSCode fork and IntelliJ plugin)
- Cline (VSCode plugin)
And we're debating swapping IDEs. I told him to go copypaste from chat gippity and to stop bothering us.
We use NetBeans because he really likes pressing the arrow and seeing the thing deploy and in VSCode you have to use the terminal and setup stuff, too much work.
Anonymous No.106285785
>>106285567
>So it tells you *where* the error is, never what.
the exception itself says what is the error

>With Golang error handling, you effectively build up the stack trace manually as you go:
"do thing manually" is already a huge minus
>- remove a ton of the noise you typically see in Java stack traces (not every frame is useful)
you can edit stacktraces in Java
>- add information about the *state* of your program (variables)
you can make your own exceptions with fields and methods in Java

>So you build up an error that looks like this:
>failed to retrieve calendar '2025': failed to GET 'https://somewebsite.com/calendar/2025': failed to resolve 'somewebsite.com': timeout (after 5s)
you can get the same result just by gluing messages and rethrowing, and printing just the exception message instead of doing e.printStackTrace()

>As opposed to an enormous Java stack trace that doesn't tell you much.
maybe you just don't know how to read them effectively
Anonymous No.106286072 >>106286086
>>106285315
Use case?
Anonymous No.106286080
>>106285686
>we know how but it would come with downsides.

In short, java doesn't have true closures, while Clojure and Scala, who also run on the JVM, have them.

Should I continue?

2. Where is my pattern matching? Or do we need to wait 10 years more? Like we waited 10 years to have fucking "lambdas", which aren't really lambdas but syntactical sugar to underneath it all create a class, an object, and a method.
Anonymous No.106286086 >>106286136
>>106286072
>Use case?

If you had gone through computer science 101 or programming 101 you wouldn't be asking such a silly thing.

Wanna ask what's the use case for screwdrivers too?
Anonymous No.106286136
>>106286086
>dodging the question
Anonymous No.106286182 >>106286737
>>106285315
>No true closures
Hey guys look at me, I know how to use google to find "flaws" of java against other languages even though I don't fucking have a clue what I'm talking about nor have I ever actually used OOP the right way in a business context
Anonymous No.106286194
>>106264432
>Go ahead and elaborate on this. Do you really think
tell him
Anonymous No.106286199
>>106264529
that's how the motherfucking reality is designed you delusional ignorant slub
Anonymous No.106286576 >>106290809
>>106264376
Object oriented programming was invented in the 1970s when programming was almost exclusively white males which advanced education. Tell us again how it was made for retards

Functional programming where nothing is mutable and thus has no side effects is better suited for retards
Anonymous No.106286592
>>106264529
I love when retards argue against oop when their "non-oop" language/code utilizes OOP concepts anyway
Anonymous No.106286626
>>106264529
>I also don't want any public/private/static
that's because you never worked on a big project, where you forget how different systems work and interact with each other just after few days.
private exists to protect your sanity, by keeping references between different systems at minimum, so the change in one system don't break other systems.
Anonymous No.106286737
>>106286182
Java always had issues. Microsoft wanted to fix them but Sun wouldn't let them. Thus c#/.net was made and it was superior in every way
>but muh GC pauses
Yes, .net has longer max GC pauses, but object allocation throughput is much, much higher. There are tradeoffs and .net wasn't designed for real-time applications (it was named .NET after all).

For a laugh, compare regex performance b/t Java and .NET
Anonymous No.106287451 >>106287828 >>106287850
>OOP le bad, just use C hurr durr
kys
Anonymous No.106287828
>>106287451
why do cniles do this instead of just using c++
Anonymous No.106287850
>>106287451
Why would you write this rather than use m4 or something?
Anonymous No.106289117 >>106289545 >>106290542
my creepy neighbor wanted to teach me java when I was in my early twenties
Anonymous No.106289545
>>106289117
are you sure he didn't want to show you python?
Anonymous No.106290542
>>106289117
i would take his offer
Anonymous No.106290809
>>106286576
are you speaking from experience? you seem pretty retarded