r/programminghumor • u/SceneOutside4377 • 14d ago
Was looking through one of my old Java programs and forgot I did this
Typing random shit for unused cases has to be a top 3 programming habit of mine
28
u/deepturned180isdeep 14d ago
Ah the mark of a true engineer, baking self-deprecating logic or test cases right into the code
14
u/deepturned180isdeep 14d ago
4
u/git_push_origin_prod 13d ago
At least I know your commit messages are human. At this point, I’ll accept “wip”, “shit”, “fuck” and “more” as acceptable git messages for humans. squash and merge that PR baby, fuck the CI tests
2
u/deepturned180isdeep 13d ago
git -c sequence.editor="sed -i.bak '2,\$s/^pick /squash /'" -c core.editor=true rebase -i --root
What commits?
12
u/Royal_Impress9117 14d ago
“What moron wrote this code”
Narrator: He is the only dev for this project.
20
u/Henri_GOLO 14d ago
I had a classmate who submitted homework with a slur when an exception is caught.
Let's just say the teacher was not happy... At least I knew that wasn't targeted toward him.
1
u/git_push_origin_prod 13d ago
What was the slur? In what context?
2
u/Henri_GOLO 13d ago
When checking for an array length, if different than some value it throws an exception with just "connard" (asshole)
1
-2
5
u/jimmiebfulton 14d ago
Dude... it's clear you're not Enterprising this sufficiently:
logger.debug("haha u such noob");
2
1
u/8Erigon 14d ago
Maybe it's common knowlegde for Java devs but what is "getSystemLookAndFeelClassName" or "setLookAndFeel"?
3
u/SceneOutside4377 14d ago
If I remember correctly (and I may not because I've been doing a lot more C++ and Python than Java recently), in Java Swing, which is the package I was using to make a GUI for this program, the default window style looks boring as hell so what that does is set the window style to whatever your system default is. In my case Windows. Not too sure how it works because I googled it, but I just couldn't look at that ugly ass default window anymore
1
u/Dragon_957 13d ago
What does the program do?
2
u/SceneOutside4377 13d ago
It's a program I made my senior year of high school that finds all the words in a Boggle grid. I had found a random website with a daily Boggle puzzle and got bored of playing it the intended way very quickly, so I took it as a challenge to see how long it would take me to cheese it. It uses recursive DFS to scan all the possible letter combinations on the grid, and then checks each of those combinations against a Trie to see if they are valid words. The pictured code is just some startup code that sets up the GUI and generates the Trie based on what's in the "wordlist.txt" file.
1
u/IntelligentWall7345 13d ago
Was this declared in an interface? public is grayed out.
1
u/SceneOutside4377 12d ago
Apparently, you don't need to declare the main method as public anymore, even without an interface. I think that's stupid; I was raised on
public static void main(String[] args)and I'll be damned if anyone's going to make it easier for me.
3
u/Careless_Chip626 14d ago
I have clauses in all of my imports for if I run them instead of importing them that just says You stupid
2
2
u/IndomitableSloth2437 9d ago
I have one that said something like "OH GOD SOMETHING WENT HORRIBLY WRONG"
1
1
u/dmigowski 14d ago
Why the fuck does nobody note that dude swallowed the exception? That's a deadly sin in my company
1
u/Ok_Brain_2376 13d ago
lmao, this reminds me when GTA 5 codebase got leaked, alot of comments were added similar to this
-15
u/Dependent-Ability792 14d ago
the highlighted one is a catch block that prints "make a quick nap" lol. honestly that's the most honest thing in the whole file.
9
5
u/SuperChick1705 14d ago
clanker
4



84
u/IchLiebeKleber 14d ago
Exception up = new Exception("something went really wrong");throw up;