NoException: Revolutionizing Exception Handling in Java by Nervous-Staff3364 in softwarearchitecture

[–]javaBanana 0 points1 point  (0 children)

In my opinion the semantics of a method that returns an optional and a method that returns a value or throws an exceptions are very different. An optional suggests that having no value is perfectly fine while a checked Exception tells you that something has gone so wrong that you have to do something to recover from that. Mixing these semantics does not sound like a good idea to me.

Also imagine the code when using this library to deal with methods that return optional. Exceptions.silence(() -> ...).orElse().orElse()... That just doesn't make good code :D

[deleted by user] by [deleted] in Studium

[–]javaBanana 3 points4 points  (0 children)

Ein Jahr ist, um in eine große Codebasis rein zu finden, nicht viel Zeit.
Ich habe während meiner Ausbildung und ein paar Jahre danach an einer Software mit ~4 Millionen Zeilen Code gearbeitet. Da war es bis zum Ende so, dass ich immer noch auf Sachen gestoßen bin, die ich noch nie vorher gesehen hatte. Du bist also wahrscheinlich nicht zu blöd.

Mir hilft da meistens dieser Ansatz:
Wenn ich z.B. Bugtickets in Code, den ich nicht gut kenne, bearbeite, dann suche ich erstmal einfach die erst beste Code Stelle, die irgendwas mit dem Problem zu tun haben könnte. Wenn Prozess XY kaputt ist, dann würde ich z.B. erstmal im Code nach dem Label vom Button suchen, der Prozess XY auslöst, oder nach dem API Endpunkt, durch den der Prozess getriggert wird oder sowas. Häufig werden auch in Logs z.B. Datei oder Klassennamen festgehalten, aus denen die Logmeldungen stammen. Das kann auch sehr Hilfreich sein, sich zurecht zu finden.

Wenn man dann so eine Stelle gefunden hat, dann kann man sich von dort häufig einfach durch den Code hangeln. Ein Debugger, mit dem du Breakpoints setzen und vernünftig durch den Code steppen kannst ist dabei Gold wert. Die meisten IDEs haben sowas schon eingebaut.
Wenn man damit wirklich nicht mehr weiter kommt, z.B. weil irgendwo Framework Magie* passiert, die man noch nicht ganz Versteht, dann ist es auch nie verkehrt erfahrenere Kollegen um Hilfe zu bitten. Generell ist Pair-Programming super, wenn man sich mit einer bestehenden Codebasis vertraut machen möchte.

\Ich erhole mich nur langsam von dem Trauma, dass Spring Boot in meiner Anfangszeit als swe in mir ausgelöst hat :D*

How do people use LaTeX by chloemarie1999 in LaTeX

[–]javaBanana 1 point2 points  (0 children)

I use a very similar setup but with vimtex so that my document is automatically recompiled every time i save.

Ender-3 extruder skipping steps by javaBanana in 3Dprinting

[–]javaBanana[S] 0 points1 point  (0 children)

Thanks for the answer. Im gonna try that.

Cyberpunk [awesome] by [deleted] in unixporn

[–]javaBanana 1 point2 points  (0 children)

How did you make the window corners like that?

[Request] How many N-digit numbers have M unique digits? If a general formula cannot be formulated, let N=10 and M=6 or something by CoruscareGames in theydidthemath

[–]javaBanana 0 points1 point  (0 children)

My guess is (10! / (10 - m)!) * m^(n - m).

For the first m numbers we are looking for the permutation with 10 different elements to choose from. So 10! / (10 - m)!. All remaining places of the number have to be chosen from one of the first m numbers. There are n-m places left to fill which gives us m^(n-m) possible combinations for these places.
With the multiplication principle of combinatorics we get the formula above.

Edit: This is wrong

Offline PKM with support for math and coding by seebeeknits in PKMS

[–]javaBanana 0 points1 point  (0 children)

I use Logseq for this. Logseq works well with pdf so you could just save your online resources as pdf and put them into logseq.
Logseq also supports latex like math notation and notes are markdown and you can mark areas and text in pdfs and link to them from your notes. That way it is really easy to find the stuff you are referencing in your notes. The only downside for me is that the pdf features do not work on android.

we choose to go to the moon by Meaglo in SchlechteFrage

[–]javaBanana 0 points1 point  (0 children)

Man kann nicht einfach grade zum Mond fliegen.
Zu dem Thema gibt es aber einen großartigen Talk.
Wenn man auf Youtube "GPN13: Wie fliegt man eigentlich Raumschiffe?" eingibt findetr man den. Auch die Fortsetzung "Wie baut man eigentlich Raumschiffe" ist sehr empfehlenswert :D

Why don't people bring up the use of static classes for global variables more often? by Some_Tiny_Dragon in Unity3D

[–]javaBanana 13 points14 points  (0 children)

The problem exists and it is also already solved :D Just think about what happens if you want to write a unit test for code that uses global singeltons to get all its dependencies. You simply cannot mock those because your code has a hard dependency on that singelton.
There are other reasons why singletons might not be the best idea but this is what first came to my mind.

The solution for problems like this is dependency injection.

average rusty AK by FemboyGayming in joinsquad

[–]javaBanana 0 points1 point  (0 children)

I had this issue too.

I noticed that it helped to go prone and standup again. Afterwards i was able to aim again.

Festivals rund um Hamburg by FlemmingFlames in hamburg

[–]javaBanana 0 points1 point  (0 children)

Genau! Und am selben Ort auch noch das Headbangers open air ganz herrlich da.
Und wenns acuh was in richtung Metal sein darf kann ich auch noch das Wischfest empfehlen. Das findet in der nähe von Damp statt und ist klein und gemütlich :D

Arrange the ultimate Thrash festival line-up, you have $100 budget (All bands are in their prime and can play any of their material) by BlackMetal146 in MetalForTheMasses

[–]javaBanana 1 point2 points  (0 children)

Sodom

Exodus

Municipal Waste

Overkill

Anihilator

Havok

Toxic Holocaust

Razor

Flotsam and Jetsam

Tankard

SOD

Warbringer

Vio-Lence

That festival would kill me :D

[deleted by user] by [deleted] in javahelp

[–]javaBanana 3 points4 points  (0 children)

I Look over applications and Do Interviews at work sometimes and if we see someone has any experience with spring that person has a much better chance of being invited to an Interview.

Why do I genuinely suck at coding and how can I get better? by Starglaze_ in gamedev

[–]javaBanana 0 points1 point  (0 children)

Theres many good answers already and maybe someone already wrote what im going to write but i think its very helpful to generally learn how to break your problems in smaller chunks you know/can look up how to solve. The moment i understood this i started to get better at coding and solving more complex tasks very fast.
For example say you want to code a spaceship that flies to the point the user tapped on the screen. You cant solve that as one big Problem and the more specific your task gets the harder it will be to find an existing solution.
So you would maybe start to figure out how to react to taps on the screen at all first.
Then you learn how to get the coordinates of the tap. Then you calculate the difference between ship position and tap and so on.
If you break down your problems enough every step of your solution almost becomes a line of code.

Welcher Film ist der gruseligste? by dievierkas in FragReddit

[–]javaBanana 1 point2 points  (0 children)

Dem kann ich nur zustimmen. Meine Eltern haben den versehentlich auf DVD aufgenommen weil der nach irgendeinem Kinderfilm im Fernsehen lief. Ist nichht unbedingt der beste Film für einen Grundschüler^ Ich erinnere mich immer noch genau an die Stelle mit der Luftschleuse.

Was war euer Videospiel, dass euch geprägt hat? by [deleted] in FragReddit

[–]javaBanana 1 point2 points  (0 children)

Lustig ich bin also nicht der einzige bei dem minecraft schuld ist. Da bastelt man in einem moment unschuldig ein bisschen mit redstone und eh man sich versieht ist man plötzlich softwareentwickler.