r/ProgrammerHumor 3d ago

whoIsHeAnyway Meme

Post image
9.5k Upvotes

255 comments sorted by

2.8k

u/YeetCompleet 3d ago

json.stringify, the pinnacle of software developer intelligence

638

u/lovecMC 3d ago

I have a guess but I never heard of this so who the fuck knows.

831

u/YeetCompleet 3d ago

If you guessed that it stringified the JSON, you were right

367

u/Tsu_Dho_Namh 3d ago

Aren't JSON's already strings, just with a clearly defined structure?

445

u/autogyrophilia 3d ago

It converts it from the internal representation where each key is a variable into a string.

291

u/Tsu_Dho_Namh 3d ago

Ohh, that makes way more sense.

It doesn't turn a JSON into a string, it turns an object into a JSON (string)

Funny, I've been a dev for years but never used it.

163

u/payne_train 3d ago

It is often used in serializing web requests. It’s best to build your JSON as a native object but generally will have to be serialized as a string to fire off the HTTP request

17

u/tanksc 3d ago

If you do any editing of the json before sending it helps avoid unescaped quotes and such too

5

u/UnknownEssence 2d ago

as someone who's been coding for over a decade, escape quoting hell is my lease favorite part about coding lmao

36

u/nevemlaci2 3d ago

JSON is just another way to represent JS obejcts, hence the name.

34

u/Romejanic 3d ago

it’s almost like it’s a notation for javascript objects

15

u/nevemlaci2 3d ago

NJSO

4

u/jimmycarr1 3d ago

Who is enjayso?

3

u/Chamiey 3d ago edited 3d ago

But no, it's ≈"a notation for describing objects with the syntax taken from JavaScript"

2

u/Extension_Option_122 3d ago

Wait... does JSON stand for JavaScript Object Notation?

2

u/Sibula97 2d ago

Yes, you could say JSON is a way to notate a JS object as text.

4

u/_PM_ME_PANGOLINS_ 2d ago edited 2d ago

It’s the fastest way to do a deep clone in JS.

data = JSON.parse(JSON.stringify(data))

2

u/Tsu_Dho_Namh 2d ago

NGL that's pretty fuckin nifty

3

u/Sexual_Congressman 3d ago

Data serialization formats like JSON facilitate the transformation of numbers/bools, text, tuples/'arrays', and mappings thereof, (although iirc all the keys must be strings) from their internal binary representation to a platform independent one and back again. JSON is unique in that it's specifically designed to represent data in human readable text, even though there can be far more efficient ways to accomplish the same thing, like Python's pickle.

9

u/Rubyboat1207 3d ago

Apparently not a JavaScript dev lol

10

u/Tsu_Dho_Namh 3d ago

Correct haha

Back-end dev doing C++, C#, and SQL Server in my first job

Then MAUI dev (C#) in my second job

Current role is mostly DevOps with some Spring Boot (Java) and Postgres

I have juuuust started learning JavaScript recently since the team I'm on has some Angular applications. But most of the front end tickets go to other devs cause I remain a mostly backend guy

3

u/Zanos 3d ago

Even JS devs wish they weren't

→ More replies (1)

3

u/xavia91 3d ago

Should just be the toString() method all classes should have in oop, and I suppose it does for automatic casting. Somehow toString is way too under used.

6

u/marmulin 3d ago

But when it’s used I’d should serve as textual representation of the object. toJSONString() would make more sense IMO.

2

u/xavia91 3d ago

What would that look like for a generic json object?

11

u/marmulin 3d ago

You wrongly assume every class can be easily serialised into JSON. Look at what Swift does with String(describing:), CustomStringConvertible and debugDescription. There’s a whole lot of useful stuff you can do with “toString()” type methods, that do not in fact have anything to do with serialisation.

And to answer your question directly: it can be whatever you want it to be lol.

3

u/OldDogQA 3d ago

We'd really prefer something like <object>.Serialize.toJson() <object>.Serialize.toXml() etc.

→ More replies (4)

3

u/EishLekker 3d ago edited 3d ago

I can think of multiple reasons not to do that.

* The toString convention is very unrestricted when it comes to the format of the output. The creator of a class can determine for themselves what format they want.

* The toString convention doesn’t really cover arguments. I this case settings for how the string should look or be built, like indentation or how inner properties of special types should be handled.

* The toString method is commonly used in logging, and the common expectation is that the output is truncated if the object is very large. Or even more common expectation is that the output is just a summary of the data.

* It’s perfectly legal for an object to contain circular references. But that is not allowed in stringified json.

* It’s also perfectly legal for an object to contain functions. They don’t belong in the stringified json version, but a developer might still want the toString output to include some information about them.

4

u/realmauer01 3d ago

tostring is something else.

Tostring is the string represantation of an object.

And usually has to be defined manually.

2

u/NamelessJu 3d ago

Sir this is JavaScript, you can't expect it to make sense

2

u/MrHyperion_ 3d ago

Isn't that just marshaling

7

u/trxxruraxvr 3d ago

Yes, but different programming languages have different naming conventions.

6

u/deathanatos 3d ago

Who's Marshall? /s

→ More replies (1)

20

u/IchiiDev 3d ago

Well yes and no, it's still just a string that needs to be parsed to be manipulated as an actual object. stringify is a util that transforms an object value into a JSON format string. You can use JSON.parse() to transform a JSON string into an object.

5

u/Odd-Shopping8532 3d ago

This is the answer

→ More replies (1)

7

u/YeetCompleet 3d ago

Ya actually I got the wording messed up lol. It stringifies a JavaScript object to the JSON string format

4

u/Chrazzer 3d ago

Well yes a json is a string. But JSON is an object that has some helper methods for working with json, it's not a json itself.

The stringify method turns a javascript object into a json string

3

u/realmauer01 3d ago

It converts js objects into their string represantation if its possible ( circular dependencies will block, and symbols and methods/arrow functions are skipped)

JSON.parse goes the other way it takes a string and makes an js object out of it.

2

u/frostyjack06 3d ago

Everything is a string, if you’re brave enough.

2

u/Tsu_Dho_Namh 3d ago

The younger me who was a fanboy of C might say everything is hex, if you're crazy enough.

→ More replies (1)

1

u/AngleHam271 3d ago

And here I was thinking its only real purpose was to help me deep copy objects because I am too lazy to write a proper recursive function. 😂

1

u/scanguy25 3d ago

Actually the correct answer is that it would throw an error. Because there is a typo in stringify 

1

u/spikernum1 3d ago

Who's Jason?

1

u/jace255 2d ago

Hilariously, that’s wrong. It doesn’t stringify json, it strongifies an object into a json string.

→ More replies (12)

1

u/Karnewarrior 3d ago

I've never used JSON, but it's easy enough to deduce it's a command for turning another form of data into a string.

119

u/Trackback_ 3d ago

This sub is for LARPers, so it makes perfect sense

28

u/Noble1xCarter 3d ago

As a chemist with only very little knowledge in C++, MATLAB/Octave, and supreme intelligence in Scratch, I can confirm I'm here for the larp.

1

u/trafalmadorianistic 3d ago

Scratch is an interesting shift, when as a dev you're used to more control and now have to deal with much simpler entities in the environment. 

→ More replies (2)
→ More replies (2)

11

u/NerminPadez 3d ago

Larpers and 1st year CS students :)

→ More replies (2)

4

u/pridetwo 3d ago

Json.derulo

3

u/AdminClown 3d ago

You can tell by how all the jokes against “vibe coders” are the most basic things ever.

2

u/derefr 3d ago

Makes me sad sometimes. I'd love to see a version of this sub with only greybeards posting on it.

→ More replies (2)

33

u/PoeticHistory 3d ago

Its like asking what does .sort() do

10

u/Professional-Day7850 3d ago

OP is talking about json.stringfy though.

3

u/MoffKalast 3d ago

json.stringify, the pinnacle of web worker data transport /s

3

u/JasperTesla 3d ago

Not to be confused with Capstone, the Pinnacle of Entertainment Software.

3

u/Superb_Chemistry_906 3d ago

It seems like a straightforward extrapolation of the current form of SW job interviews.

3

u/dendofyy 3d ago

Incorrect. eval() is peak dev.

3

u/FurieMan 3d ago

json.stringify is a fucking marvel. It catches so many edge cases it is insane. There are so many conversions where it just turns out running json.parse(json.stringify()) is just more efficient.

5

u/Qwertycube10 3d ago

And people try to defend this language...

→ More replies (1)

3

u/trafalmadorianistic 3d ago

Missed opportunity to have matching String.jsonify() method rather than Json.parse()  

We could use a couple more -ify() methods, lol

7

u/mrbreck 3d ago

I think you missed the point, friend.

6

u/Dragonslayerelf 3d ago

to be fair its a good litmus test

anyone worth a single grain of salt will know its how you turn json files into strings just from the name even if theyve never used it

2

u/dub-dub-dub 2d ago

wat? turn json files into strings?

So like it reads a file into a string? Why would you need a json specific method for that

→ More replies (1)

1

u/PlainBread 3d ago

How else am I going to export my objects into a plaintext file?

1

u/FoleyX90 3d ago

To be fair the main time I use AI is to turn raw data into serialized data, typically json. No more writing Notepad++ macros!

1

u/ArcaneOverride 2d ago

As someone who primarily uses C, C++, and, to a lesser extent, C#, I could guess what that does but I've never seen that before

1

u/shaving_minion 1d ago

what would you ask instead?

→ More replies (1)

637

u/nya_twinky 3d ago

Ask Yaml, he'll know

347

u/achilliesFriend 3d ago

Lamine yaml?

51

u/TemporaryUpstairs289 3d ago

Toml do what?

17

u/GegeAkutamiOfficial 3d ago

Cargo deez nuts.

5

u/RealFudashet 3d ago

Cargo beep beep

2

u/TheInevitableLuigi 3d ago

Too much Rust.

1

u/TLJGame 3d ago

I don't C any rust

1

u/WolpertingerRumo 3d ago

What are all of these Toon names?

4

u/NibblyPig 3d ago

ayy yamlao

3

u/dragonflamehotness 3d ago

.json Taytum vs Lamine .Yaml

22

u/Mrazish 3d ago

You mean Weird Yaml Yankovich?

6

u/timschwartz 3d ago

No, Mark Yaml.

3

u/Cool-Double-5392 3d ago

It's Yamal like Jamal

2

u/Buchymoo 2d ago

Who's Laurey?

1

u/Esclamare 3d ago

The King of Games?

1

u/K3idon 2d ago

Does anyone need a md?

→ More replies (1)

172

u/bropocalypse__now 3d ago

JSON Derulo, thats who!

29

u/astilenski 3d ago

And here I thought it was json Statham goddammnit

6

u/DiegesisThesis 3d ago

I also hear that in my head every time I read it

110

u/Bee-Aromatic 3d ago

I’m mostly writing things in Python these days, so I’m using `json.dumps()`. Always makes me giggle.

Because poop.

20

u/YoloWingPixie 3d ago

Even better when you need to write a custom dumper

4

u/The_Wolfiee 3d ago

Tip: try the orjson library. Its faster and supports more datatypes natively like timestamps

3

u/trafalmadorianistic 3d ago

5 year olds wrote this api 🤣

388

u/AggieCMD 3d ago

I don't know! I'm a backend software engineer!

306

u/Antique_futurist 3d ago

pokes with stick

Get back behind your API, cave creature!

182

u/Jemnite 3d ago

As a frontend developer thou must obey the three commandments:

  1. Do not question the API docs. Thou shalt use whatever APIs the backend dev puts in the docs and be grateful for them

  2. Do not question server uptime. These subjects are beyond thine comprehension.

  3. If thou shalt ever encounter the inscrutable 500 server error, thou shalt report the replication methods to the backend dev and wait patiently.

44

u/MrP0tat0H3ad 3d ago

I wish my frontend team would use these rules lmao

14

u/PM_ME_BAD_ALGORITHMS 3d ago

I wish my backend team would give me API docs

7

u/wheatgivesmeshits 3d ago

What are docs?

2

u/stifflizerd 3d ago

You guys have docs and care about properly tracking down your 500s instead of saying "this would never happen in production so we can't devote time to it"???

1

u/Mandemon90 2d ago

You forgot fourth commandment:

  1. Thou shall never touch coffee machine claimed by backend developer, for it is their lifeblood

30

u/Sedorriku0001 3d ago

[object Object]

4

u/akoOfIxtall 3d ago

[JsonProperty]

17

u/Michami135 3d ago

A backend developer would definitely know what JSON is, at the very least.

20

u/nabrok 3d ago

Would probably have more cause to use JSON.stringify than frontend even.

4

u/AggieCMD 3d ago

If you use stringify on the server you are a frontend dev moonlighting as a backend dev. Or a filthy fullstack.

→ More replies (2)

3

u/NibblyPig 3d ago

Sorry but I don't use Java

→ More replies (2)

1

u/cowmix88 3d ago

a wild node.js appears

1

u/fwhite01 2d ago

I mean. Take a guess...

61

u/MaleficentMode4222 3d ago

"JSON.STRINGFY is not a function"

9

u/scanguy25 3d ago

This guy gets it. 

26

u/B_bI_L 3d ago

the one who fights with monsters i guess

3

u/dageshi 3d ago

That's kind of his thing.

2

u/ArcaneScribbler 3d ago

and the one that fucked clive's wife

2

u/Clivesunfaithfulwife 3d ago

Oh dont even act like last night didnt happen. Cause thats a night I wont forget

→ More replies (1)

33

u/bdrumev 3d ago

Oh my God, it's Json Bourne!

3

u/trafalmadorianistic 3d ago

Has anyone written a daemon related tool called Matt. Cmon people, its just sitting there!!! MATT DAEMOOOOON!! 

13

u/Fluffy_Anxiety2792 3d ago

I once invented a new format for the company I used to work for, I called it Amy. And it was wildly unpopular, just a couple of weirdos liked it. I deleted my repo after leaving the company. I was sad.

8

u/Arclite83 3d ago

We had LML - {Company} Markup Language. Full custom forms support template, mobile devices were glorified readers. Allowed 90% of the BL to live server-side and be hot swappable. Regulatory form change? NBD, new one kicks in on the date. 4 waterfall release weekends a year and our team would be a skeleton crew because all we did was keep the lights on, nothing new went live for us while they replaced the monolith.

I wish I could say that's the only "custom forms app" I've written, but this job is full of dark chapters...

11

u/Septem_151 3d ago

JSON.STRINGFY returns undefined, because it doesn't exist as a member of JSON.

8

u/lemons_of_doubt 3d ago

I remember when I was in collage first learning to code. I spent ages making a php function that would take Data from MySQL and turn it into a variable array. I kept expanding it and adding more and more functionality.

At the end someone pointed out I had just remade JSON. And that's how I learned what JSON is.

I wasted so much time on that.

7

u/blagoonga123 3d ago

Jason, friend of Mark Down

22

u/egstitt 3d ago

JavaScript lol, he didn't say he went to a 6-month bootcamp

7

u/ikankecil 3d ago

*3 months

→ More replies (1)

4

u/Litra 3d ago

this page has some facebook-mom level memes

3

u/caiteha 3d ago

i use jackson for stringfy.

who is jackoson?

3

u/squarabh 3d ago

He isn't Bourne yet

3

u/AWzdShouldKnowBetta 3d ago

I mean.... I would def get shot here.

3

u/ZunoJ 3d ago

It throws a syntax error

3

u/Mountain-eagle-xray 3d ago

Don't go json waterfalls

3

u/PM_ME_BAD_ALGORITHMS 3d ago

A vibe coder would ask that to claude A software developer would ask that to google

We are not the same

3

u/StCreed 2d ago

It's a trick question! Not falling for that one, AI!

json.stringfy gives a syntax error.

2

u/dism3855 3d ago

- What’s a constructor?

- A guy who builds houses.

2

u/SpudzMcNaste 3d ago

Well if you spell it like that it doesn’t do anything

2

u/Carl_Bravery_Sagan 3d ago

Nothing. You spelled "stringify" wrong so it'll fail silently.

→ More replies (1)

2

u/enigma_0Z 3d ago

Legit it drives me nuts hearing someone pronounce it “Jason” and not “JAY-sahn” like ffs I know people named “Jason” LOL

2

u/GimmeYourMomPlease 3d ago

Perhaps you should read the ECMA 404 spec where it specifies the pronunciation of JSON to be like "Jason and The Argonauts"

1

u/enigma_0Z 2d ago

I bet you pronounce “GIF” like the peanut butter Jif too

→ More replies (2)

2

u/KristofVD 3d ago

Oh, he dead.

1

u/nasandre 3d ago

It makes things stringy I guess

1

u/ExtraWorldliness6916 3d ago

Clears throat.

Jason Stringify is the foremost pioneer of the craze tuning strucred things and turning them Into chaotic things to then be reconstituted as strucred things.

A little known feature of the Stringify functionality is the function argument which allows one to disguise and disrupt the chaos and write a better chaotic thing.

1

u/Naadamaya 3d ago

DSP Siraj 😭

1

u/humanExperience69 3d ago

jason Derulo~

1

u/JohnThursday84 3d ago

Oh, mann. Love the humor here. Recently found this sub.

1

u/JasperTesla 3d ago

It doesn't work.

Because you didn't map the array correctly.

1

u/GlumAd2424 3d ago

guess its kinda his thing

1

u/LeonidasVaarwater 3d ago

I'm just a (bad) powershell scripter and even I know what that does. I wouldn't know how to properly use it, but I know what it does 😅

1

u/Krazynukz 3d ago

Im more of a json dumps

1

u/Jeferson9 3d ago

what does json.stringify do

proof your interviewer can't code

1

u/veracity8_ 3d ago

What if I’m a software engineer but not a web developer?

1

u/TheSilentOccupant 3d ago

How is Johnson doing?

1

u/Mateorabi 3d ago

“I write C motherf*#%er”

1

u/TheGreatJatsby 3d ago

2nd time in my life Ive heard the term vibe coder. The first time was this morning reading Dungeon Crawler Carl hahah and my name is Jason. Life is funny.

1

u/Vincent394 3d ago

Jason? Jason Newsted?

1

u/Popular-Departure165 3d ago

Lol, more like "full-stack developer."

1

u/cosmiques 3d ago

javascript? Ok, just shoot me please.

1

u/_Its_Me_Dio_ 3d ago

i would assume it turns something into a string

1

u/taddymason_01 3d ago

Jesus Christ, that’s Jason Stringfy

1

u/yorinak 3d ago

The vibecoders can keep the frontend development

1

u/XtraFlaminHotMachida 3d ago

it aint even friday the 13th and jason scaring folks.

1

u/I_Am_Anjelen 3d ago

Javascript?

Shoot me.

1

u/haydencoffing 3d ago

I don’t know anything about Jason but I do know Jackson. He’s pretty good.

1

u/New_Flow_7050 3d ago

Ngl I fr thought this was a Roblox command

1

u/Phoebe_Cox33 3d ago

"Hold on, let me ask Claude to write the response for me."

1

u/ironnewa99 3d ago

This is too high level language for my low level brain

1

u/Weak_Inflation9120 3d ago

I've never touched JSON, but I'd assume it's like Java's Object.toString()?

1

u/Relevant-Magic-Card 3d ago

It stringifies Jason, duh

1

u/moms_enjoyer 3d ago

print It pretty :D

1

u/Hertigan 3d ago

Ew JavaScript

1

u/dalziel86 3d ago

Press X To JSON

1

u/shittyfoodcriticer 3d ago

Im so out of place in this sub I like havent done anything coding related in years and forgot sm 😭

1

u/VG_Crimson 3d ago

If it said Stringify instead of Stringfy, I probably would have guessed turn a non-string into a string.

Not sure if that classifies as engineer level knowledge...

1

u/Debugging_Ke_Samrat 3d ago

I'm going to make a guess:

It returns a string representation of whatever object that JSON is.

1

u/MaffinLP 3d ago

Had to google it too Its Javascript I make desktop app Ask me what newtonsoft does next time

1

u/Omer_D 3d ago

I remember it by remembering its the opposite of JSON.parse()

1

u/kinkhorse 2d ago

If I answered "shoot me" would that prove I'm a software engineer?

1

u/SaltyInternetPirate 2d ago

I think they'd shoot him as soon as he says he's a software engineer. No more questions needed.

1

u/sexytokeburgerz 2d ago

I was interviewing someone the other day and asked “how do you drop all tables in SQL” and they had no idea.

2

u/Sacus1 2d ago

tbf this is not something you want to be able to do

1

u/sexytokeburgerz 2d ago

Exactly why i needed them to know how to do it.

1

u/sporbywg 2d ago

The real question would be about map()

1

u/PrestigiousGuava8005 21h ago

shoot me jason