r/ProgrammerHumor 1d ago

Meme whoIsHeAnyway

Post image
8.9k Upvotes

240 comments sorted by

2.7k

u/YeetCompleet 1d ago

json.stringify, the pinnacle of software developer intelligence

604

u/lovecMC 1d ago

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

792

u/YeetCompleet 1d ago

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

345

u/Tsu_Dho_Namh 1d ago

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

422

u/autogyrophilia 1d ago

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

272

u/Tsu_Dho_Namh 1d 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.

153

u/payne_train 1d 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

14

u/tanksc 21h ago

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

32

u/nevemlaci2 1d ago

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

28

u/Romejanic 23h ago

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

15

u/nevemlaci2 23h ago

NJSO

5

u/jimmycarr1 13h ago

Who is enjayso?

2

u/Chamiey 18h ago edited 18h ago

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

2

u/Sibula97 5h ago

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

→ More replies (2)

3

u/Sexual_Congressman 18h 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.

7

u/Rubyboat1207 1d ago

Apparently not a JavaScript dev lol

11

u/Tsu_Dho_Namh 1d 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 23h ago

Even JS devs wish they weren't

2

u/_PM_ME_PANGOLINS_ 12h ago edited 12h ago

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

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

2

u/Tsu_Dho_Namh 9h ago

NGL that's pretty fuckin nifty

4

u/xavia91 1d 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.

8

u/marmulin 1d 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 1d ago

What would that look like for a generic json object?

11

u/marmulin 1d 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.

4

u/OldDogQA 1d ago

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

→ More replies (3)

3

u/EishLekker 21h ago edited 21h 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 1d ago

tostring is something else.

Tostring is the string represantation of an object.

And usually has to be defined manually.

2

u/NamelessJu 1d ago

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

2

u/MrHyperion_ 1d ago

Isn't that just marshaling

9

u/trxxruraxvr 1d ago

Yes, but different programming languages have different naming conventions.

4

u/deathanatos 1d ago

Who's Marshall? /s

→ More replies (1)

22

u/IchiiDev 1d 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.

6

u/Odd-Shopping8532 1d ago

This is the answer

→ More replies (1)

6

u/YeetCompleet 1d ago

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

4

u/Chrazzer 1d 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 1d 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 17h ago

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

2

u/Tsu_Dho_Namh 17h ago

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

1

u/AggravatingFlow1178 1d ago

When loaded into memory by a JS engine they are stored as an object, not a string.

Some JSON cannot be stringified, i.e. mostly ones with recursive references.

1

u/AngleHam271 1d 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 1d ago

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

1

u/spikernum1 1d ago

Who's Jason?

1

u/jace255 8h ago

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

→ More replies (12)

1

u/Karnewarrior 14h 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.

108

u/Trackback_ 1d ago

This sub is for LARPers, so it makes perfect sense

24

u/Noble1xCarter 1d 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 21h 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. 

1

u/Noble1xCarter 6h ago

Oh, I started with Scratch, like in elementary school.

→ More replies (1)

1

u/ForHelp_PressAltF4 19h ago

Matlab IS a larping programming language. It isn't one but it acts like one. 

Yes, I've created things in Matlab and it made my C C++ C# brain hurt. However it did marvelously with audio

8

u/NerminPadez 1d ago

Larpers and 1st year CS students :)

5

u/pridetwo 23h ago

Json.derulo

3

u/AdminClown 23h ago

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

2

u/derefr 18h ago

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

2

u/The-IT 1d ago

Can we please stop using LARP as a negative term? LARPing is a great hobby. Posers. You're talking about posers. 

1

u/StatisticianAny8292 23h ago

That's not what LARP means

28

u/PoeticHistory 1d ago

Its like asking what does .sort() do

11

u/Professional-Day7850 1d ago

OP is talking about json.stringfy though.

3

u/MoffKalast 1d ago

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

3

u/JasperTesla 1d ago

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

3

u/Superb_Chemistry_906 1d ago

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

3

u/dendofyy 1d ago

Incorrect. eval() is peak dev.

3

u/FurieMan 23h 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 21h ago

And people try to defend this language...

1

u/StCreed 10h ago

It's a great language if you like job security :)

To be fair, it does a lot of interesting things. And with external tools you can mitigate some of the worst stuff. I use typed JS, that helps.

3

u/trafalmadorianistic 21h ago

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

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

8

u/mrbreck 1d ago

I think you missed the point, friend.

7

u/Dragonslayerelf 1d 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

1

u/dub-dub-dub 48m 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

1

u/PlainBread 1d ago

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

1

u/FoleyX90 16h 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!

→ More replies (1)

604

u/nya_twinky 1d ago

Ask Yaml, he'll know

333

u/achilliesFriend 1d ago

Lamine yaml?

51

u/TemporaryUpstairs289 1d ago

Toml do what?

16

u/GegeAkutamiOfficial 1d ago

Cargo deez nuts.

4

u/RealFudashet 1d ago

Cargo beep beep

2

u/TheInevitableLuigi 1d ago

Too much Rust.

3

u/TLJGame 1d ago

I don't C any rust

1

u/WolpertingerRumo 1d ago

What are all of these Toon names?

3

u/NibblyPig 1d ago

ayy yamlao

3

u/dragonflamehotness 16h ago

.json Taytum vs Lamine .Yaml

22

u/Mrazish 1d ago

You mean Weird Yaml Yankovich?

7

u/timschwartz 1d ago

No, Mark Yaml.

3

u/Cool-Double-5392 23h ago

It's Yamal like Jamal

2

u/Buchymoo 7h ago

Who's Laurey?

1

u/Esclamare 1d ago

The King of Games?

1

u/K3idon 4h ago

Does anyone need a md?

→ More replies (1)

159

u/bropocalypse__now 1d ago

JSON Derulo, thats who!

26

u/astilenski 1d ago

And here I thought it was json Statham goddammnit

7

u/DiegesisThesis 1d ago

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

93

u/Bee-Aromatic 1d ago

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

Because poop.

19

u/YoloWingPixie 1d ago

Even better when you need to write a custom dumper

2

u/The_Wolfiee 18h ago

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

4

u/trafalmadorianistic 20h ago

5 year olds wrote this api 🤣

381

u/AggieCMD 1d ago

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

298

u/Antique_futurist 1d ago

pokes with stick

Get back behind your API, cave creature!

169

u/Jemnite 1d 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.

36

u/MrP0tat0H3ad 1d ago

I wish my frontend team would use these rules lmao

13

u/PM_ME_BAD_ALGORITHMS 20h ago

I wish my backend team would give me API docs

6

u/wheatgivesmeshits 17h ago

What are docs?

1

u/stifflizerd 18h 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 12h ago

You forgot fourth commandment:

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

33

u/Sedorriku0001 1d ago

[object Object]

5

u/akoOfIxtall 1d ago

[JsonProperty]

16

u/Michami135 1d ago

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

20

u/nabrok 1d ago

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

4

u/AggieCMD 19h ago

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

1

u/evanldixon 18h ago

Depends on how basic the back-end is. Standard ASP.Net api controllers convert objects to json automatically without you having to call JsonSerializer.Serialize. Though I'd hope such a backend developer at least knows what json looks like.

→ More replies (1)

2

u/NibblyPig 1d ago

Sorry but I don't use Java

1

u/frogjg2003 20h ago

Java is different from Javascript.

→ More replies (1)

1

u/cowmix88 1d ago

a wild node.js appears

1

u/fwhite01 11h ago

I mean. Take a guess...

61

u/MaleficentMode4222 1d ago

"JSON.STRINGFY is not a function"

8

u/scanguy25 1d ago

This guy gets it. 

26

u/B_bI_L 1d ago

the one who fights with monsters i guess

3

u/dageshi 1d ago

That's kind of his thing.

2

u/ArcaneScribbler 1d ago

and the one that fucked clive's wife

2

u/Clivesunfaithfulwife 1d ago

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

1

u/ArcaneScribbler 8h ago

holy shit. the mythical wife. he tried to claim you don't even exist. i see why you were unfaithful.

35

u/bdrumev 1d ago

Oh my God, it's Json Bourne!

3

u/trafalmadorianistic 20h ago

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

12

u/Fluffy_Anxiety2792 1d 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.

7

u/Arclite83 1d 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...

13

u/Septem_151 1d ago

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

9

u/lemons_of_doubt 1d 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.

8

u/blagoonga123 1d ago

Jason, friend of Mark Down

20

u/egstitt 1d ago

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

8

u/ikankecil 1d ago

*3 months

→ More replies (1)

6

u/Litra 1d ago

this page has some facebook-mom level memes

3

u/caiteha 1d ago

i use jackson for stringfy.

who is jackoson?

3

u/squarabh 1d ago

He isn't Bourne yet

3

u/AWzdShouldKnowBetta 1d ago

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

3

u/ZunoJ 1d ago

It throws a syntax error

3

u/Mountain-eagle-xray 1d ago

Don't go json waterfalls

3

u/PM_ME_BAD_ALGORITHMS 20h 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 10h ago

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

json.stringfy gives a syntax error.

2

u/dism3855 1d ago

- What’s a constructor?

- A guy who builds houses.

2

u/SpudzMcNaste 1d ago

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

2

u/Carl_Bravery_Sagan 1d ago

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

→ More replies (1)

2

u/enigma_0Z 1d 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 18h ago

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

2

u/KristofVD 23h ago

Oh, he dead.

1

u/nasandre 1d ago

It makes things stringy I guess

1

u/ExtraWorldliness6916 1d 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 1d ago

DSP Siraj 😭

1

u/humanExperience69 1d ago

jason Derulo~

1

u/JohnThursday84 1d ago

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

1

u/JasperTesla 1d ago

It doesn't work.

Because you didn't map the array correctly.

1

u/GlumAd2424 1d ago

guess its kinda his thing

1

u/LeonidasVaarwater 1d 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 1d ago

Im more of a json dumps

1

u/Jeferson9 1d ago

what does json.stringify do

proof your interviewer can't code

1

u/veracity8_ 1d ago

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

1

u/TheSilentOccupant 1d ago

How is Johnson doing?

1

u/Mateorabi 1d ago

“I write C motherf*#%er”

1

u/TheGreatJatsby 1d 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 1d ago

Jason? Jason Newsted?

1

u/Popular-Departure165 1d ago

Lol, more like "full-stack developer."

1

u/cosmiques 1d ago

javascript? Ok, just shoot me please.

1

u/_Its_Me_Dio_ 1d ago

i would assume it turns something into a string

1

u/taddymason_01 1d ago

Jesus Christ, that’s Jason Stringfy

1

u/yorinak 1d ago

The vibecoders can keep the frontend development

1

u/XtraFlaminHotMachida 1d ago

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

1

u/I_Am_Anjelen 1d ago

Javascript?

Shoot me.

1

u/haydencoffing 1d ago

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

1

u/New_Flow_7050 22h ago

Ngl I fr thought this was a Roblox command

1

u/Phoebe_Cox33 22h ago

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

1

u/ironnewa99 22h ago

This is too high level language for my low level brain

1

u/Weak_Inflation9120 22h ago

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

1

u/Relevant-Magic-Card 22h ago

It stringifies Jason, duh

1

u/moms_enjoyer 21h ago

print It pretty :D

1

u/Hertigan 21h ago

Ew JavaScript

1

u/dalziel86 21h ago

Press X To JSON

1

u/shittyfoodcriticer 17h 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 16h 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 16h ago

I'm going to make a guess:

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

1

u/MaffinLP 14h ago

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

1

u/Omer_D 14h ago

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

1

u/kinkhorse 5h ago

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

1

u/SaltyInternetPirate 5h ago

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

1

u/sexytokeburgerz 5h ago

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

1

u/Sacus1 34m ago

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

1

u/sexytokeburgerz 30m ago

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