I forgot about the semicolons and just figured that the braces weren’t needed since if and else each contain a single line (but I thought that meant swap was going to run a single time at the end of permute, everytime.)
Eh, idk. Most text editors, even ones like Micro have smart tab (plugins) that figure out what you want your tabs to align to. If I pick an arbitrary spot for one indent, and then just hit tab on other lines, it almost always lines up to wherever that arbitrary column was on the first manual line.
Honestly makes me wonder if you could write a VS Code plug-in or something that just automatically takes care of formatting your code like this in real time as you write it. Would be cool as hell and extremely cursed at the same time.
It's certainly possible, if probably very difficult, with linting software. I know the Elm language reformats documents to move commas from the end of lines to the start of the next line, followed by a space, so everything is aligned and you can't miss a vital comma as easily. It must get harder with C-derived languages that have so many brackets.
I mean, I don’t even know how to feel with this one, if you ignore the bracket wall it definitely looks prettier than Java but then again, what doesn’t
As a shameless Python whore I like to think the person wrote it with a newline between the methods like you'd have in Python then realised it actually looked a bit too neat and readable and removed it
It's not actually bad code? I mean, I would never do this, but so long as you have a formatter automatically stick the braces and semicolons at the end, it's functional and readable and not at all misleading. It's just unconventional. And if you don't need to work with people who aren't used to this convention, then really, it's completely fine.
That said, who the fuck doesn't put empty vertical space between methods?
I think this title is the first one that gives me an acceptable explanation for this famous image. It finally makes sense why someone might’ve done this, and now I can die in peace.
480
u/NewPointOfView Jun 25 '21
It took me a second before I noticed the semicolons and brackets haha
209
u/part_time_ficus Jun 25 '21
lmao I actually love this
like, it's a horrible abomination, but it's also beautiful
93
u/[deleted] Jun 25 '21
r/TIHI
37
u/kalketr2 Jun 25 '21
That format is kind of giving me anxiety, not bad coding though.
18
u/pau1rw Jun 25 '21
It would be so annoying lining up those curly brackets.
72
u/acos12 Jun 25 '21
kinda genius
84
u/[deleted] Jun 25 '21
Gotta be honest, I kinda like it at first glance.
25
u/Willinton06 Jun 25 '21
I mean, I don’t even know how to feel with this one, if you ignore the bracket wall it definitely looks prettier than Java but then again, what doesn’t
7
u/Spikerazorshards Jun 25 '21
Indents are on point though.
7
u/somethingtc Jun 25 '21
As a shameless Python whore I like to think the person wrote it with a newline between the methods like you'd have in Python then realised it actually looked a bit too neat and readable and removed it
8
u/arzen221 Jun 25 '21
This individual is to smart to be kept around
4
u/Deadly_chef Jun 25 '21
Those brackets 🤢
4
u/Shower_Handel Jun 25 '21
Python accent
3
u/DoYouEverJustInvert Jun 26 '21
Java programmer's attempt at Python
3
u/Sorry-Chair depraved Jun 26 '21
Blursed jython
13
u/kellyjonbrazil Jun 25 '21
Looks beautiful to me (as a Python programmer). Someone should make an IDE that does that for you automatically. :D
2
u/ice_bunny28 Jun 26 '21
Why not just use groovy
(note: I hate that...thing??... Tool??)
2
u/[deleted] Jun 26 '21
Where is Main?
4
u/LivingInAnIdea Jun 25 '21
... woah
2
u/xiipaoc Jun 26 '21
It's not actually bad code? I mean, I would never do this, but so long as you have a formatter automatically stick the braces and semicolons at the end, it's functional and readable and not at all misleading. It's just unconventional. And if you don't need to work with people who aren't used to this convention, then really, it's completely fine.
That said, who the fuck doesn't put empty vertical space between methods?
1
u/djfreedom9505 Jun 25 '21
Kinda hate that tenary operator in the swap NGL.
1
u/Alvatrox4 Jun 26 '21
Other than the Singleton pattern what's the point of having private static functions? I saw this a few years ago but don't remember
1
u/joelhowell Jun 26 '21
I think I just vomited
1
u/Qildain Jun 26 '21
Tabs? What's that?
1
u/nathan_lesage Jun 26 '21
I think this title is the first one that gives me an acceptable explanation for this famous image. It finally makes sense why someone might’ve done this, and now I can die in peace.
1
u/wal_rider1 Jun 26 '21
Eww...
1
u/pschoeni0 Jun 26 '21
Somehow this smells like an of by 1 error but with the preconditions it might work?
1
u/aynril Jun 26 '21
Are there actually formatter which can do such a thing?
1
u/YoungHeartOldSoul Jun 26 '21
It gets worse the longer you look at it.
So many questionable choices made.
1
u/Knuffya Jun 26 '21
u/repostsleuthbot
1
u/desci1 Jun 28 '21
I need this pythonic plugin which automatically sends brackets and semicolons away from the screen ASAP. Could you share it?
1
u/L37_1t_b3_m3 Jun 30 '21
NEAT! I think I like this Java style better than the original
1
u/[deleted] Jan 12 '23
Oh god I hate it why would anyone do this why does Java even allow this I wish this failed to execute
-9
u/EitherJelly4138 Jun 25 '21
Wrong sub.
105
u/[deleted] Jun 25 '21
[removed] — view removed comment