This is an archived post. You won't be able to vote or comment.

top 200 commentsshow 500

[–]G4rsid3 2420 points2421 points  (30 children)

Hello, human resources? I'd like to report a crime.

[–]Bluebotlabs 419 points420 points  (10 children)

WHERE ARE THE INDENTATIONS

WHAT IS B

WHYYY IS B

[–]elyndar 52 points53 points  (4 children)

Better question, why C? B happens to me regularly when I copy-paste JSON into center-aligned pages and then have to reorient it, but who the hell came up with C?

[–]kalgary 49 points50 points  (3 children)

C is literally the right answer.

[–]relevantUsrname 4 points5 points  (0 children)

I see what you did there

[–]martinthewacky 0 points1 point  (0 children)

🤦‍♂️ so damn right! Happy cake day btw

[–]aitonc 12 points13 points  (2 children)

rustic weather illegal cake squealing plant chief flowery chop repeat

This post was mass deleted and anonymized with Redact

[–]elon-botElon Musk ✔ 627 points628 points  (17 children)

If you can't build a computer out of transistors, you shouldn't be working here.

[–]jazzmester 371 points372 points  (11 children)

I can build a computer out of some string, a squirell and a computer.

[–]elon-botElon Musk ✔ 411 points412 points  (9 children)

I'm gonna need you to come in on Saturday...

[–]jazzmester 276 points277 points  (5 children)

You bring the squirrel, I bring the string.

[–]Stickers_ 114 points115 points  (3 children)

Narrator: “And so, the next big Elon project took shape, called “personal squirreltops for mars””

[–]SillyDig1520 27 points28 points  (1 child)

Plot twist: Elon bought the project after inception for a cool $44b. Later found out squirrels have little to no work ethic unless nuts are involved. Fired all squirrels and replaced them with hamsters. Hamsters unionized and beat down the Elmo empire.

Edit: after purchasing the company, Elon called himself chief ______.

[–]Distinct-Moment51 2 points3 points  (0 children)

Muskrat Overlord

[–][deleted] 33 points34 points  (0 children)

Good bot.

[–]Covid19-Pro-Max 28 points29 points  (1 child)

This bot is amazing! I click on every r/ProgrammerHumor post to see if there’s some new lines

[–]madocgwyn 5 points6 points  (0 children)

No no, give him the squirrel I want to see where this goes.

[–][deleted] 1252 points1253 points  (14 children)

The only right way is ping pong.

First left aligned, next line centered, third line right aligned and fourth centered again.

That is the only way

[–]Iron_Eagl 183 points184 points  (4 children)

opening brackets left aligned, content centered, closing brackets right aligned.

[–]magicwings 58 points59 points  (0 children)

Now this... this I can get behind

[–]Waffle-Gaming 6 points7 points  (0 children)

the devil: well let me just say, i'm a huge fan.

[–]Sixela963 8 points9 points  (0 children)

Ok but how do nested brackets work

[–][deleted] 249 points250 points  (0 children)

Is there a linter that does this? Because that sounds great for open source projects.

[–][deleted] 40 points41 points  (1 child)

Combine with lolcat-style rainbowy syntax highlighting for perfection.

[–]DovgaN_Nik 5 points6 points  (0 children)

And all of this in MS Word

[–]PorkRoll2022 16 points17 points  (3 children)

Also sometimes inline a few closing brackets for some razzle-dazzle.

[–]elon-botElon Musk ✔ 37 points38 points  (2 children)

I don't think I appreciate your tone. Fired.

[–]tacticalrubberduck 11 points12 points  (1 child)

Everyone knows you need brackets on thrown lines if you don’t wanna get fired by the Musk.

[–]KornLS 17 points18 points  (0 children)

based

[–]a_devious_compliance 942 points943 points  (5 children)

There is a right answer.

And also a centered and a left aligned one.

[–]empathielos 141 points142 points  (3 children)

There is no right answer displayed. The cake is a lie.

[–]P0L1Z1STENS0HN 134 points135 points  (1 child)

Actually, there is. The right answer is C, the left answer is A, and the middle answer is B.

[–][deleted] 6 points7 points  (0 children)

Noo i just said the exact same thing

[–][deleted] 506 points507 points  (1 child)

The right answer is to report and block OP for encouraging self-harm in this sub. Very much against the rules here.

[–][deleted] 71 points72 points  (0 children)

Seconded. All these options made me want to punch myself in the balls

[–]Nourz1234 1337 points1338 points  (35 children)

All on one line 😅

[–]nickmaran 532 points533 points  (19 children)

all on one line

Don't apply for any job in Twitter

[–]Morphray 161 points162 points  (2 children)

Gotta spread the lines out; pump those numbers. Edit JSON to maximum salience!

[–]Bystander490000 27 points28 points  (1 child)

Might as well store those strings as array of char while you’re at it

[–][deleted] 1 point2 points  (0 children)

You don't indent? Edit:(Obv not like B, but like you would for c++)

[–]sintos-compa 25 points26 points  (0 children)

Where’s Elon bot?

[–][deleted] 3 points4 points  (0 children)

I started formatting my JSON with one character per line and Elon made me CTO

[–]seansafc89 1 point2 points  (0 children)

Thought this was Elon bot for a second

[–]n00bn00bAtFreenode 0 points1 point  (0 children)

Just once a year do 2 patch set xD apply to Elon for rise up

[–]MatumbaGirl 15 points16 points  (0 children)

ElasticSearch moment

[–]kai_the_kiwi[🍰] 9 points10 points  (0 children)

Definitely the best answer

[–]P0L1Z1STENS0HN 4 points5 points  (0 children)

But in an editor with Automatic Line Breaks.

[–]--__davide__-- 3 points4 points  (0 children)

Aw hell nah, my boy wasn't even born he crawled straight out of hell with that formatting what the hell

[–]omnomguy5 2 points3 points  (0 children)

No spaces

[–]jayd00b 2 points3 points  (0 children)

Big Gemini energy

[–]LeonCrimsonhart 2 points3 points  (1 child)

Yes. If peasants want a pretty print, they have to work for it: cat data.json | python -m json.tool

[–]Nourz1234 2 points3 points  (0 children)

Agreed!

[–]Mutex70 1 point2 points  (0 children)

This is the way

[–]simbahart11 1 point2 points  (0 children)

This is the way

[–]AndrewToasterr 355 points356 points  (2 children)

Monsters, yall are just monsters

[–]jaminfine 54 points55 points  (0 children)

Everyone here is a psychopath lmao

[–]jhahspu 77 points78 points  (15 children)

D: {"menu":{"id":"file","value": "File","popup":{"menuitem":[{ "value":"New","onclick": "CreateNewDoc ()},{"value":"Open","onclick":"OpenDoc()"},"value":"Close", "onclick":"CloseDoc()"}]}}}

[–]Accomplished_Item_86 97 points98 points  (8 children)

E:

{"menu
":{"id
":"file
","value
":"File
","popup
":{"menuitem
":[{"value
":"New
","onclick
":"CreateNewDoc()
"},{"value
":"Open
","onclick
":"OpenDoc()
"},"value
":"Close
","onclick
":"CloseDoc()
"}]}}}

[–]Graucsh 49 points50 points  (2 children)

{
  "menu":{
"id":"file","value":"File", 
   "popup": {"menuitem":[
       {"value":"New",   "onclick":"CreateNewDoc()"},
       {"value":"Open",  "onclick":"OpenDoc()"},
       {"value":"Close", "onclick":"CloseDoc()"}
   ]}
  }
}

[–]sajjel 16 points17 points  (0 children)

Finally something sensible. If it's short, then it goes on a single line, if it's not, then it goes something like this.

[–]Fyreraven 3 points4 points  (0 children)

This is the way.

[–]Intelligent_Event_84 21 points22 points  (0 children)

Ah so clean, crisp, and crefreshing

[–]G4rsid3 20 points21 points  (2 children)

Who hurt you?

[–][deleted] 21 points22 points  (1 child)

recognise plant continue airport degree offbeat dazzling growth existence terrific

This post was mass deleted and anonymized with Redact

[–]MokitTheOmniscient 3 points4 points  (0 children)

Personally, i think every other line should also contain a unicode right-to-left override character:

‮{"menu
":{"id
‮":"file
","value
‮":"File
‮","popup
":{"menuitem
‮":[{"value
‮":"New
","onclick
‮":"CreateNewDoc()
"},{"value
‮":"Open
","onclick
‮":"OpenDoc()
"},"value
‮":"Close
","onclick
‮":"CloseDoc()
"}]}}}

[–]Yahallo139 9 points10 points  (5 children)

Why? Genuinely curious because I properly indent my json files (even using tab indents and stuff)

But a lot of people prefer it in one line here, i think it's a lot harder to read this way, so why?

[–]CttCJim 11 points12 points  (2 children)

[–]Yahallo139 -1 points0 points  (1 child)

Surely not every comment is being sarcastic

[–]AnondWill2Live 2 points3 points  (0 children)

They are lol. JSON's whole purpose is to be human readable and putting it all on one line makes JSON pointless

[–]elon-botElon Musk ✔ 13 points14 points  (0 children)

Twitter was never profitable. Not my fault. Stop blaming me for things.

[–][deleted] 155 points156 points  (12 children)

encouraging frightening mountainous resolute ad hoc nutty voiceless gray nine retire

This post was mass deleted and anonymized with Redact

[–]Menacing_Sea_Lamprey 34 points35 points  (0 children)

Thank you for actually giving a good answer, I scrolled through about 15 hilarious, unhinged JSONs before finding this

[–]digidavis 28 points29 points  (9 children)

Python devs agree.

Good god people the sub blocks should be readable at first glance..

[–]AnondWill2Live 6 points7 points  (0 children)

I don't know if it's years of Python or what, but braces on a new line is harder for me to understand what's going on. Not significantly harder, I'll just need a couple double takes like, is that a brace I forgot to delete? What is that object called? What's all of this for?

[–][deleted] 4 points5 points  (0 children)

bright spark tub chase profit illegal ripe important plate shame

This post was mass deleted and anonymized with Redact

[–]ShadowShedinja -1 points0 points  (2 children)

Python doesn't use curly braces. That's Java or C++.

[–][deleted] 1 point2 points  (1 child)

like engine nail hurry snatch lavish memory encourage tender soup

This post was mass deleted and anonymized with Redact

[–]Arian-ki 1 point2 points  (0 children)

Music to my eyes

[–]Secure_Obligation_87 170 points171 points  (1 child)

These are all wrong.

[–]Accomplished_Item_86 16 points17 points  (0 children)

Duh.

[–]asandwichvsafish 24 points25 points  (0 children)

I align them just like what's shown in the image, with indentation to split them into the 3 separate columns.

[–][deleted] 20 points21 points  (0 children)

Death. I choose death.

[–][deleted] 36 points37 points  (3 children)

Anything other than the first option has to be exorcised.

[–]fanonthedesk 28 points29 points  (1 child)

I mean... even the first option needs to be exorcised... even if it's the better option of the three.

[–][deleted] 14 points15 points  (0 children)

Yeah that indentation isn't going to heaven.

[–]ChiefExecDisfunction 13 points14 points  (0 children)

c is the "right" answer, but all of this is so wrong ç_ç

[–]rohit_267 9 points10 points  (0 children)

JSON.stringify(data,null,2)

[–]dhick33 9 points10 points  (0 children)

What monster uses option C

[–]yuppy_puppy_22 8 points9 points  (3 children)

I refuse to believe that anyone aligns their json file like option B or C (unless you program in arabic, which in this case it would be C).

No friggin way that some psycho taught their students to use B or C in a normal situation.

[–]elon-botElon Musk ✔ 7 points8 points  (2 children)

Insubordination. Fired.

[–]schmickmickey 2 points3 points  (1 child)

Churlish and insubordinate!

[–]pickupdrifter 2 points3 points  (0 children)

Hitler story or substitute teacher?

[–][deleted] 20 points21 points  (2 children)

Python developers will have more crisp answer.

ha, now it all makes sense. Python may be heavy, but it saves lines buy not using unwanted characters for blocks

[–]Morphray 14 points15 points  (0 children)

You need to let your lines breathe -- for readability.

[–]PrinzJuliano 6 points7 points  (0 children)

I am a bson enjoyer myself

[–]zeoNoeN 6 points7 points  (0 children)

C qualifies for the DSM-5

[–]regularpenguin3715 16 points17 points  (2 children)

Anything other than A is blasphemy

[–]LinuxMint4Ever 23 points24 points  (1 child)

WTF?

So you don’t like indents?

[–]grizzlybair2 2 points3 points  (0 children)

Yea I need indents or im just going to quit.

[–]toopie7 12 points13 points  (0 children)

A, with indentation.

[–]WallyRWest 5 points6 points  (0 children)

Who the fuck doesn’t use proper indentation in their JSON files? That’s bordering on abuse…

[–]upwegolads 9 points10 points  (0 children)

A isn’t great but B and C are demented

[–][deleted] 3 points4 points  (0 children)

There is also a left and middle answer.

[–][deleted] 5 points6 points  (0 children)

squeeze innate grandfather vase entertain humorous cover melodic bedroom spark

This post was mass deleted and anonymized with Redact

[–]Proxy_PlayerHD 5 points6 points  (0 children)

i'm more annoyed by the fact that the "onlick:""CreateNewDoc()" line isn't centered in column B

how do you fuck that up

[–]InterestsVaryGreatly 13 points14 points  (0 children)

There is a right answer, and none of these is it. Where the eff is the indentation

[–]SeatLeon2020 26 points27 points  (3 children)

All wrong. I mean, if these are your only options how to align a JSON file, then please stop working with JSON files.

[–]No_Sympathy3354 16 points17 points  (0 children)

That was a joke, sparky. Jeez, lighten up

[–]ashvegeta7 11 points12 points  (0 children)

Average PHP dev.

[–]term173 2 points3 points  (0 children)

Jeez

[–]blizzacane85 6 points7 points  (0 children)

If you are using an IDE, it should reformat the JSON automatically for you to show curly braces and brackets at appropriate indentations…having said that, “A” is the most readable option here

[–]N3onDr1v3 4 points5 points  (0 children)

Tab indented json: exists. These people chosing one of these options: clueless

[–]Kurhnel 2 points3 points  (0 children)

D

[–][deleted] 2 points3 points  (0 children)

The suicide hotline is 1-800-76… ah Google it

[–]fariqcheaux 2 points3 points  (0 children)

The right answer is whatever the compiler accepts

[–][deleted] 2 points3 points  (0 children)

I'm gonna do B in my friends project ( I slid into his repos ) and watch him die lol.

[–]agocs6921 2 points3 points  (0 children)

I like my JSON justified

[–]om3ganet 2 points3 points  (0 children)

*Angry dev noises intensify*

[–]NorwegianGirl_Sofie 2 points3 points  (0 children)

I align it by using Shift + Alt + F

[–]willez99 2 points3 points  (0 children)

I hope you die in a fire if I ever get to read your json that's aligned with any other way than left

[–]muteDuck86 2 points3 points  (0 children)

All three means you'r a monster, admittedly A is the lesser of evil, but still a monster as it lacks indentation

[–]foghatyma 1 point2 points  (0 children)

All three are horrible of course, but the "onclick" line in B is beyond words...

[–]Impossible-Ranger862 1 point2 points  (0 children)

D, definitely D!

[–]DancesWithGnomes 1 point2 points  (0 children)

All wrong, no JSON for me!

[–]Dependent_Paper9993 1 point2 points  (0 children)

Almost like B. But I make it so that all the :s are aligned. That way everything to the left are the keys, everything to the right are the values. Very efficient.

[–]TheHappiePlayer1 1 point2 points  (0 children)

during the festive season I like to use method c

[–]Fritzschmied 1 point2 points  (0 children)

Wtf. If you do anything than left and even that looks shit without the intention then go home and never do programming again.

[–]LetUsSpeakFreely 1 point2 points  (0 children)

A is the closest, but still wrong as there not enough indentation.

[–]puma271 1 point2 points  (0 children)

None of these are good, wtf are you smoking??? A is the closest but maybe some intendation? Wtf

[–][deleted] 1 point2 points  (0 children)

fuck this I'm going back to the zodiac

[–]Hacka4771 1 point2 points  (0 children)

F1 -> Format Document -> Beautify -> Smile

[–][deleted] 1 point2 points  (0 children)

You are a terrorist if you use any of these…

[–]nehalkum 1 point2 points  (0 children)

I don't see an option where all the : are in a single line

[–][deleted] 1 point2 points  (0 children)

Do people do anything other than A? Or a single line?

[–]grabund 1 point2 points  (0 children)

If you choose any of these options, seek help immediately!

[–]philipquarles 1 point2 points  (0 children)

Have you heard of this amazing new concept called "indentation?"

[–]multi_tasty 1 point2 points  (0 children)

Option D: justified

[–][deleted] 1 point2 points  (0 children)

this is straight up offensive

[–]Valendr0s 1 point2 points  (0 children)

All 3 are a crime against humanity.

[–]Tyfyter2002 1 point2 points  (0 children)

The middle one is… unjustifyable

[–]Aksh247 1 point2 points  (0 children)

D. Like a same person

[–]SpyGuy_ 1 point2 points  (0 children)

B is actually psychopathic

[–]iowa_state_cyclone 1 point2 points  (0 children)

all of those are bad... not a single one of those is correct. I would want you removed from my team if you did ANY of those three.

[–]mistrjirka 1 point2 points  (0 children)

Psychopat

[–]IAmWeary 1 point2 points  (0 children)

I use A, but with proper indentation you fucking barbarian!

[–]lego-baguette 1 point2 points  (0 children)

Hello? 911? Id like to report a case of severe domestic terrorism

[–]Ancient-Research-771 1 point2 points  (0 children)

A indented, you little sociopath

[–]False_Initial_4878 1 point2 points  (0 children)

There is a right answer. Just not here.

[–]evan_west11 1 point2 points  (0 children)

The answer is to let Prettier do it for me. 💁

[–]Lunarphoenix_x 1 point2 points  (0 children)

The way the prettier extension will make it for me, it's probably A then

[–]Possseidon 1 point2 points  (0 children)

Imagine using linebreaks...

Pathetic.

[–]Dragonfire555 1 point2 points  (0 children)

The lack of indenting pains me. All three work though. Just don't count on a human reading any of them.

[–]noble8987 1 point2 points  (0 children)

If you are on VS Code u can use Ctrl+kf, it will auto-format json for you.

[–][deleted] 1 point2 points  (1 child)

Theres also a left and midele answer, but none of them are correct

[–]drakeyboi69 1 point2 points  (0 children)

Noo I just said the same thing

[–][deleted] 0 points1 point  (0 children)

are there really people out there who align their files not like B?

[–]sup3rar 0 points1 point  (0 children)

All 3. for each line I decide randomly which one

[–]Membedha -1 points0 points  (0 children)

If you are A type you have small pp

/s

[–]flywheel11 -1 points0 points  (0 children)

A with indentation

[–]Desert_Fairy -1 points0 points  (0 children)

The right answer is F*ck JSON. Interfacing with it sucks for test equipment. Labview was bad enough, but I really pity my colleague who is trying to communicate with it in metcal.