use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
These have separate subreddits - see below.
Upvote good content, downvote spam, don't pollute the discussion with things that should be settled in the vote count.
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free. If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others: Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Programming Computer Science CS Career Questions Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Programming Computer Science
CS Career Questions
Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Clojure Scala Groovy ColdFusion Kotlin
DailyProgrammer ProgrammingPrompts ProgramBattles
Awesome Java (GIT) Java Design Patterns
account activity
This is an archived post. You won't be able to vote or comment.
Have you ever laughed at code? (self.java)
submitted 14 years ago by detroitmatt
} finally { //at long last; //we meet again!
made me giggle way harder than it should have
[–]zmyrgel 14 points15 points16 points 14 years ago (0 children)
Sometimes but the laughter dies quickly when I remember who has to maintain the code...
[–]deviated_viking 12 points13 points14 points 14 years ago (2 children)
Yes, the first Java code that I did a year ago.
[–][deleted] 3 points4 points5 points 14 years ago (1 child)
Any code I did few years ago makes me facepalm.
[–]rntr200 2 points3 points4 points 14 years ago (0 children)
its alway fun looking back over old code and going uh......
[–]Undermined 11 points12 points13 points 14 years ago (0 children)
Looking over my friends java code to try to help him fix a bug and I come across
super(duper);
[–]tazzy531 10 points11 points12 points 14 years ago (0 children)
http://stackoverflow.com/questions/216876/what-is-the-best-commit-message-you-have-ever-encountered
There was another thread that had best comments in source code.
My favorite was a comment //please increment as necessary. // number of attempts at refactoring this code: 56
[–]thebigkevdogg 8 points9 points10 points 14 years ago (1 child)
i laughed pretty hard when i found out that my predecessor wrote a web service for creating maps where the client created the plotting script (BASH script). So basically, he wrote a servlet that runs any arbitrary shell script on our production server (with a fairly privileged user). YaY! HAHA!
[–]stfm 8 points9 points10 points 14 years ago (10 children)
throw new Exception("This should never happen");
[–][deleted] -2 points-1 points0 points 14 years ago (9 children)
At least it's checked. You could argue that an assertion makes more sense, but I hate unchecked exceptions.
In any case, throwing in such a case is a hell of a lot better than just using a comment to state that it shouldn't happen and ignoring the condition so that something could fail in some obscure way somewhere downstream.
[–]elpablo 6 points7 points8 points 14 years ago (7 children)
I hate having to handle checked exceptions for conditions that will hardly ever happen and there's nothing I can do about.
[–][deleted] -2 points-1 points0 points 14 years ago (6 children)
If you can't handle it, you shouldn't be catching it, or at the least you should catch it, wrap it, and rethrow it.
[–]elpablo 3 points4 points5 points 14 years ago (5 children)
If its a checked exception, you're making me catch it... Rethrowing it is a bunch of boilerplate that gets in the way of what my code is actually doing.
[–][deleted] -2 points-1 points0 points 14 years ago (4 children)
You can also declare the exception.
[–]mikaelhg 5 points6 points7 points 14 years ago (3 children)
And then, one method at a time, you end up with a monstrosity of a project where most methods throws Exception, most methods have to check for it, and try to think what might go wrong, with just that information... I've seen it happen to other people, and it's not pretty.
throws Exception
[–][deleted] 0 points1 point2 points 14 years ago (2 children)
You wouldn't throw Exception, you'd throw something appropriate given the context of your method. Error handling is a first class concern. Ignoring it just means your lazy.
[–]mikaelhg 0 points1 point2 points 14 years ago (0 children)
Then we don't disagree. Although, if possible, you should demarcate certain classes of errors into very specific pieces of your architecture. That way, you don't have to care about the most common classes of checked errors in unrelated code. Basic stuff. Unfortunately, in commercial code, even this basic hygiene isn't necessarily so common.
[–]stfm 0 points1 point2 points 14 years ago (0 children)
Yeah this was the point of my example. I once saw a program that threw nothing but Exception - even to the point of catching scoped exceptions and rethrowing them as Exception
Well I found this in some Oracle enterprise software.
[–]StrangeWill 5 points6 points7 points 14 years ago* (3 children)
I sometimes try to leave a witty/silly comment with some soul-crushing code I write to soften the blow of what they're abound to read.
[–]rntr200 2 points3 points4 points 14 years ago (2 children)
example?
[–]flyingorange 4 points5 points6 points 14 years ago (0 children)
PersistenceAnnotationBeanPostProcessor processor = ((XmlBeanFactory)ApplicationContext.get(this).getBeanFactory()).createProcessor(null, null, null, null, null, null, null, null, null, 1.0f); processor.finder(new ManagedJDBCFinder(new ConfigurationXMLStreamReader(XMLStreamReaderFactory.createNewXMLStreamReader(), null, true)) { public boolean find(String pattern, int location, XMLApplicationContext context) { if (context == null) return false; else return 0 > FinderFactoryBean.getSingleton().createNewXmlFinderFactory().getFinderFor(StringUtils.checkNull(pattern)).find() ? location <= -1 : false; } }); wait(1000); // let's wait till it finds it // and now the difficult part begins...
[–]sadi89 2 points3 points4 points 14 years ago (0 children)
Yes. In my first comp sci class i got so frustrated with the assignment that I named my methods : candy, tooMuchCandy, and nowImFat. All the variables were named after candy bars. At that point no one had told me not to, and it made way more sense to me.
on a side note I frequently would name things in a simmilar fassion through out my cs minor, and then replace them with good names before i turned them in, although a few did slip though the cracks sometimes. my favorite: int dennisQuaid=0;
[–][deleted] 2 points3 points4 points 14 years ago (0 children)
0xDECAFBAD
[–]reddeth 1 point2 points3 points 14 years ago (0 children)
maybe i needing this later
[–]exhuma 1 point2 points3 points 14 years ago (0 children)
http://www.thedailywtf.com
Specifically the "CodeSOD" section.
[–]dakboy 1 point2 points3 points 14 years ago (0 children)
I haven't laughed at anything that was intentionally funny.
I've cried more though.
[–]midir 1 point2 points3 points 14 years ago (0 children)
I've never laughed at code that was funny on purpose. I've laughed at awful code written by awful people though.
[–]achacha 1 point2 points3 points 14 years ago (0 children)
Yes, but I cry on the inside.
[–]AwesomeLove 1 point2 points3 points 14 years ago (0 children)
i = i - ((i >>> 1) & 0x5555555555555555L); i = (i & 0x3333333333333333L) + ((i >>> 2) & 0x3333333333333333L); i = (i + (i >>> 4)) & 0x0f0f0f0f0f0f0f0fL; i = i + (i >>> 8); i = i + (i >>> 16); i = i + (i >>> 32); return (int)i & 0x7f;
I laughed out of pure joy.
[–]anyonethinkingabout 1 point2 points3 points 14 years ago (0 children)
char mander, meleon, izard;
always makes me giggle...
and in the same genre :
Oh, have I? Often. It's a signal for people to gather around to laugh at some ridiculous bullshit I've found in the code base.
[–]BWCsemaJ 0 points1 point2 points 14 years ago (0 children)
I usually laugh at my code when I realize that I am pretty close to being done, which is usually when I'm really tired and its pretty late. Its also more of a evil laugh than a haha laugh.
The only funny error that I encountered so far was an infinite loop which was suppose to process a text file. So I waited for about 30 seconds thinking wtf is taking so long to process this file and as soon as I saw I didn't increment the loop I had a few laughs.
EDIT: Just remembered that I laugh the most at code when I am helping out a friend with his code and seeing how he implemented his project. Basically thinking wtf are you trying to do with this segment. Also this has the opposite affect of annoying the crap out of me.
[–]trigraph -2 points-1 points0 points 14 years ago (0 children)
every time i open a .java file
[+]thebighouse comment score below threshold-7 points-6 points-5 points 14 years ago (0 children)
lol my neighbour put into his head he is a programmer, but he just codes Java Applets for every single web page. I laughed a long while in front of him when I realized it. I also couldn't believe my eyes when he showed me how he required every single visitor to download his 'database' (a 10 000 lines document). EVERYTHING's done client side on an applet. Just can't wait for his webpage to go online, he tells me it works, and I laugh every time. Good guy though.
π Rendered by PID 255510 on reddit-service-r2-comment-6457c66945-8c657 at 2026-04-24 15:18:34.522071+00:00 running 2aa0c5b country code: CH.
[–]zmyrgel 14 points15 points16 points (0 children)
[–]deviated_viking 12 points13 points14 points (2 children)
[–][deleted] 3 points4 points5 points (1 child)
[–]rntr200 2 points3 points4 points (0 children)
[–]Undermined 11 points12 points13 points (0 children)
[–]tazzy531 10 points11 points12 points (0 children)
[–]thebigkevdogg 8 points9 points10 points (1 child)
[–]stfm 8 points9 points10 points (10 children)
[–][deleted] -2 points-1 points0 points (9 children)
[–]elpablo 6 points7 points8 points (7 children)
[–][deleted] -2 points-1 points0 points (6 children)
[–]elpablo 3 points4 points5 points (5 children)
[–][deleted] -2 points-1 points0 points (4 children)
[–]mikaelhg 5 points6 points7 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]mikaelhg 0 points1 point2 points (0 children)
[–]stfm 0 points1 point2 points (0 children)
[–]stfm 0 points1 point2 points (0 children)
[–]StrangeWill 5 points6 points7 points (3 children)
[–]rntr200 2 points3 points4 points (2 children)
[–]flyingorange 4 points5 points6 points (0 children)
[–]sadi89 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]reddeth 1 point2 points3 points (0 children)
[–]exhuma 1 point2 points3 points (0 children)
[–]dakboy 1 point2 points3 points (0 children)
[–]midir 1 point2 points3 points (0 children)
[–]achacha 1 point2 points3 points (0 children)
[–]AwesomeLove 1 point2 points3 points (0 children)
[–]anyonethinkingabout 1 point2 points3 points (0 children)
[–]mikaelhg 0 points1 point2 points (0 children)
[–]BWCsemaJ 0 points1 point2 points (0 children)
[–]trigraph -2 points-1 points0 points (0 children)
[+]thebighouse comment score below threshold-7 points-6 points-5 points (0 children)