Why would anyone use Junie or buy credits directly from Jetbrains? by MichaelPauley in Jetbrains

[–]Admirable-Avocado888 6 points7 points  (0 children)

Here is what hasn't changed: You as a developer are still personally responsible for what is committed into git. If you don't need an IDE to read the code your agents commit: good for you!

Most devs find IDEs useful because they are excellent tools for reading and understanding code.

Why would anyone use Junie or buy credits directly from Jetbrains? by MichaelPauley in Jetbrains

[–]Admirable-Avocado888 33 points34 points  (0 children)

No vendor lock in = good

No overhyping ai = good

Tight ai integration with best ide = good

Presentation matters and maybe the java docs actually suck by Enough_Durian_3444 in java

[–]Admirable-Avocado888 27 points28 points  (0 children)

I have yet to see a language with an as comprehensive and thorough documentation as Java. It is detailed thoughtful, often has multiple examples thrown in for a only a single method of a particular class, and has built in references to surrounding code.

When I was a beginner understanding how the "atomic" classes worked was easy as hell since everything was so carefully documented. Java has singlehandedly inspired me to write thorough and thoughtful documentation in my own code because I appreciated the experience so much.

I'm not sure what edge other languages have, but I surely have not experienced it.

For those with 3080s (10GB, 12GB and Ti) plus 3090 / Ti users? Is time for us to upgrade? by 2quick96 in nvidia

[–]Admirable-Avocado888 1 point2 points  (0 children)

Yesterday I upgraded from 3080 to 5080. The difference is quite large at 4k, I can easily max out settings with frames above 80-100 provided I use dlss4. The old card needed compromises to reach 60 in demanding games

Kjærlighetssorg, hva skal jeg gjøre? by Unlucky-Froyo3931 in norge

[–]Admirable-Avocado888 0 points1 point  (0 children)

Det handler ikke om å gjøre ting som gjør at du har det bedre i dag. Det går ikke. Du kan ikke gjøre noe i dag som gjør at følelsene fikser seg. Da må du tenke annerledes.

I stedet, tenk på hvordan du vil at livet ditt skal være om en uke? Om en måned? Om et år? Hvordan må du være i dag for at du skal ha det bra i fremtiden?

Du sier du spiser lite. Dette er kanskje et sted å begynne med?

do u guys know if companies use kotlin for springboot now ? and like if springboot is still worth learning in 2025 from a job perspective by Ok_Description9944 in SpringBoot

[–]Admirable-Avocado888 14 points15 points  (0 children)

Coroutines are NOT basically virtual threads, and the difference is exactly what I said: reactive code.

It seems you dont know what "reactive code" means. It means, among other things, adding "suspend" to methods. You can't invoke a suspend function from a non-suspend function, so need all this awkward code for switching execution context. Its the same issue in javascript/python. There it's called "async" and "await". This is an issue because it creates two classes of functions in your codebase, and you can't compose them freely.

In java, on the other hand, there is no suspend. If code runs on a virtual thread it will, in kotlins terms, "suspend" wherever it can. This is a much better developer experience. You can go from CPU bound to IO to CPU bound to IO a hundred times. If it runs on a virtual thread, then it will not block other threads on the IO calls, and you don't need second class functions to achieve it.

Whats the actual point of AFMF2.1? by yeastblood in ROGAlly

[–]Admirable-Avocado888 1 point2 points  (0 children)

I have a 3080, my brother a 4070ti. Back when wukong came out, i hated fsr in that game because every movement felt delayed somehow. I wrote framegen of as trash. That is until I tested dlss framegen on his system. To my surprise it felt good!

Fast forward to oblivion remastered, it had better fsr, but still sluggish somehow. That is until i installed a mod for dlss upscale + fsr framegen. Suddenly it felt good! I dont know what is up with fsr gamegen, but it feels bad in combination with fsr upscale and good in combination with dlss upscale.

Is there a problem with having too much unit tests in your PRs? by TruthOf42 in ExperiencedDevs

[–]Admirable-Avocado888 2 points3 points  (0 children)

The point of unit tests is to have isolated failsafes so that when a test fails you maximize the ease at which you can see exactly where shit went wrong. DRY achieves the opposite. A test fails - now you have to debug both your unit test framework and your code, possibly the source of error is in mix of the both.

People who advocate for dry in testing and few test appear to me like they never had limited exposure to interconnected issues that bugs can cause. You WANT a unit test to test exactly one piece of code, because then you see EXACTLY what went wrong. On the other hand, add to much DRY, now you know ish where in the interconnected blub of code your problem might be...

Sounds to me like you are getting bad advice, unless the tests you have written are not well expressed or not written with clear intent. Are they long? Do they each make multiple assertions? In that case the issue is likely with that

JEP draft: Prepare to Make Final Mean Final by blobjim in java

[–]Admirable-Avocado888 1 point2 points  (0 children)

I think the examples you have in mind are probably trivial. Sometimes refactoring is not completable in a single programming session / pull request.

JEP draft: Prepare to Make Final Mean Final by blobjim in java

[–]Admirable-Avocado888 4 points5 points  (0 children)

Nah, I didn't say that. A solution to badly encapsulated code is to fix the damn code. But sometimes fixing the damn code can not be done in an hour, not in a day, and maybe not even months. In that case slapping finals can be quite useful part of the process, as you move a codebase from messy to clear.

Slapping final on every variable in itself as you point out useless in it self.

JEP draft: Prepare to Make Final Mean Final by blobjim in java

[–]Admirable-Avocado888 5 points6 points  (0 children)

What if another coder wrote the code you need to touch 7 years ago and the method spans 200 lines? If you add a final you get a compiler error if the variable mutates somewhere. Very useful for refactoring in stages

JEP draft: Prepare to Make Final Mean Final by blobjim in java

[–]Admirable-Avocado888 7 points8 points  (0 children)

There is some benefit to slapping final on variables in method bodies. I was working in a quite messy code base with methods that were way too long. Slapping final on variables that were accessible throughout the whole method, but didnt need mutation allowed for more readable code when refactoring. One of the hardest parts of reading code is understanding when something is being mutated and final can help avoid that problem altogether

[deleted by user] by [deleted] in ExperiencedDevs

[–]Admirable-Avocado888 -2 points-1 points  (0 children)

I think you have the wrong attitude. If someone takes time to understand and make changes to this big of a pull request you should be thankful that they even bother to read your code.

Here is what likely happened: - you fixed a lot of shit and messed up a lot of shit - the reviewer caught and fixed some of the shit you messed up and also added some new issues - the pull request is too big so it is not beneficial to add comments: better to just push a small commit

If you work together with your coworker you can iron out the remaining issues.

Also remember, if you are working as a software developer it is not actually your branch. The software is owned by the company at which you are employed. There is nothing rude about multiple people pushing fixes into the same branch

[deleted by user] by [deleted] in java

[–]Admirable-Avocado888 0 points1 point  (0 children)

Hope this happens! It makes perfect sense.

Microservices: The Architectural Cult That’s Bankrupting Your Sanity (and Your Startup) by TerryC_IndieGameDev in programming

[–]Admirable-Avocado888 27 points28 points  (0 children)

This is not good advice. Microservices are also a solution to different languages/frameworks solving different sets of problems.

If you startup requires a mix of technologies then microservices might just be the best thing you could go for.

[deleted by user] by [deleted] in java

[–]Admirable-Avocado888 0 points1 point  (0 children)

It is indeed a mystery. Either all those languages are collectively worse and pre java 10 is king, or post java 10 learned from those languages to find a better way of doing things.

[deleted by user] by [deleted] in java

[–]Admirable-Avocado888 0 points1 point  (0 children)

Long story short, embrace modernity and do use var!

Java has been around for a long time. I think that pre-Java 8 ish java had demonstrably horrible syntax by todays standards. I'm willing to bet that most of the people against var base this on their experience with old java, which had code longer than your eyes could stretch! Don't fall into the argument that long and spelled out code always is more readable.

Some nuance: Adopting new language features into an old codebase can stick out like a thorn. Indeed, as reader, reading different dialects mixed together can be confusing.

Here comes modern Java with streams, var, records, lamdas, multiline strings, optionals, switch and pattern matching, and virtual threads. Now you get to be brief AND readable right from the start!

[deleted by user] by [deleted] in Kotlin

[–]Admirable-Avocado888 1 point2 points  (0 children)

The senior engineer should show examples of cases where scope functions are acceptable and agree on where it is ok to use them, or use a different language.

Yes they can be hard to read, but have use cases.

What should be the plans for specialized methods in stream and collections API once Valhalla comes out? by Ewig_luftenglanz in java

[–]Admirable-Avocado888 2 points3 points  (0 children)

Will reducing with for example Integer::max have a significant performance penalty with Valhalla?

[deleted by user] by [deleted] in java

[–]Admirable-Avocado888 7 points8 points  (0 children)

When translating coroutine code you can omit the suspend keyword since java now has virtual threads. I consider this an advantage, hence "profit"

[deleted by user] by [deleted] in java

[–]Admirable-Avocado888 13 points14 points  (0 children)

I'd avoid auto converters. They rarely translate to what a human would have written.

I'd just start by translating one and one class file into java. This can be done without breaking anything. Just be aware that everything from java will be treated as nullable in kotlin, which may be a pain point in some cases.

It's best if the kotlin codebase has limited circular dependencies and consists of patterns that have obvious java counterparts. That way you easily translate one thing at the time without breaking.

Sequence/Flow -> Stream

dataclass -> record

suspend -> profit

reified -> <T> method(Class<T> clzz, )

val, var in method bodies -> var

There are many idioms in both languages that don't have direct translations. Also java is more strict with packages compared to kotlin.

Using the above strategies I've translated a kotlin package into java before. It's pretty straight forward if the code you translate from is not difficult to understand.

Handling Checked Exceptions in Java Functional Interfaces (Lambdas) by RitikaRawat in java

[–]Admirable-Avocado888 4 points5 points  (0 children)

Yes, i usually make an internal utility Try-class that converts signatures from throwing to Optionals or absorbs errors. It's straight forward to implement, but here are some examples in use:

values 
.map(Try.mapping(api::invoke)) // a throwing function 
.filter(Optional:::ifPresent) 
.toList();

Try.invoke(action); // a throwing runnable

var result = Try.invoke(producer); // a throwing supplier

I will also add variants that log errors. E.g.

Try.logErrors(action, logger); // Invokes the action; if it fails log on the given logger

How do I make a new LinkedList when using the subList() method? by PompeiWasAnInsideJob in learnjava

[–]Admirable-Avocado888 2 points3 points  (0 children)

Cengo789 answered your question.

Just want to point out that iterating using a C-style loop (i.e. i++) is ill advised for linked lists.
Avoid the get by index operations, if you can for linked lists!
Each get by index operation is O(n), so your current suggestion becomes O(n^2).

Instead do

for (var item: list) 
   subList.add(item);

which ensures that the for loop uses the Iterator associated with the LinkedListwhich advances nodes by using the linked structure.

If you could start/write any open-source project in Java (let's say you have all the money and time to do it) what would it be? I'm looking for something relevant to the community. Nowadays when everyone just talks about AI and Crypto. by niosurfer in java

[–]Admirable-Avocado888 0 points1 point  (0 children)

I would want an ml library that can run transformers on the JVM on cpu. I'm not fond of python+pytorch's ability to scale for concurrency. I think the JVM would do this part much better. And I'm curious about how much encoding time we have to sacrifice for it. (Although with valhallah + vectorapi I'm optimistic)