There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

notanaltaccount , in Please stop

The packages in Debian are really old. It’s awful.

I was looking at my xzutils package the other month. “So outdated,” I thought, envying the cool hip trendy Arch users.

RustyShackleford , in Please stop
@RustyShackleford@programming.dev avatar

Getthefuckouttamyfacewiththisridiculousbullshit.

avidamoeba , in Please stop
@avidamoeba@lemmy.ca avatar

SOFTWARE WAS NOT SUPPOSED TO BE STABLE

Someone with a case of brain rot.

Sonotsugipaa ,
@Sonotsugipaa@lemmy.dbzer0.com avatar

Me, because I cannot understand how people can miss the facetiousness of this meme template with such confidence

avidamoeba ,
@avidamoeba@lemmy.ca avatar

🪦

Appoxo ,
@Appoxo@lemmy.dbzer0.com avatar

When even the skull is more alive

jubilationtcornpone ,

Ah, I see you’ve met the product owner.

OneCardboardBox , in Trying to understand JSON…
bleistift2 OP ,

I’m sad that there are people who call themselves developers who need to be told this.

ooterness , in Surely "1337" is the same as 1337, right?

CBOR for life, down with JSON.

0x0 ,

If there are no humans in the loop, sure, like for data transfer. But for, e.g., configuration files, i’d prefer a text-based solution instead of a binary one, JSON is a nice fit.

MonkderDritte ,

What, no! Use TOML or something for config files.

0x0 ,

TOML

Interesting… me likes it.

frezik ,

What I’d like for a configuration language is a parser that can handle in-place editing while maintaining whitespace, comments, etc. That way, automatic updates don’t clobber stuff the user put there, or (alternatively) have sections of ### AUTOMATIC GENERATION DO NOT CHANGE###.

You need a parser that handles changes on its own while maintaining an internal representation. Something like XML DOM (though not necessarily that exact API). There’s a handful out there, but they’re not widespread, and not on every language.

bitfucker ,

JSON5

frezik ,

Is a very good idea providing much needed fixes to the JSON spec, but isn’t really what I’m getting at. Handling automatic updates in place is a software issue, and could be done on the older spec.

bitfucker ,

Hmm, maybe I am missing the point. What exactly do you mean by handling automatic updates in place? Like, the program that requires and parses the config file is watching for changes to the config file?

frezik ,

As an example, Klipper (for running 3d printers) can update its configuration file directly when doing certain automatic calibration processes. The z-offset for between a BLtouch bed sensor and the head, for example. If you were to save it, you might end up with something like this:


<span style="color:#323232;">[bltouch]
</span><span style="color:#323232;">z_offset: 3.020
</span><span style="color:#323232;">...
</span><span style="color:#323232;">#*# <---------------------- SAVE_CONFIG ---------------------->
</span><span style="color:#323232;">#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
</span><span style="color:#323232;">#*#
</span><span style="color:#323232;">[bltouch]
</span><span style="color:#323232;">z_offset: 2.950
</span>

Thus overriding the value that had been set before, but now you have two entries for the same thing. (IIRC, Klipper does comment out the original value, as well.)

What I’d want is an interface where you can modify in place without these silly save blocks. For example:


<span style="color:#323232;">let conf = get_config()
</span><span style="color:#323232;">conf.set( 'bltouch.z_offset', 2.950 )
</span><span style="color:#323232;">conf.add_comment_after( 'bltouch.z_offset', 'Automatically generated' )
</span><span style="color:#323232;">conf.save_config()
</span>

Since we’re declaratively telling the library what to modify, it can maintain the AST of the original with whitespace and comments. Only the new value changes when it’s written out again, with a comment for that specific line.

Binary config formats, like the Windows Registry, almost have to use an interface like this. It’s their one advantage over text file configs, but it doesn’t have to be. We’re just too lazy to bother.

bitfucker ,

Ahh, then the modification must be done on the AST level not the in-memory representation since anyway you do it, you must retain the original.

frezik ,

Right.

Michal ,

Yaml is more human readable/editable, and it’s a superset of json!

bob_lemon ,

Yaml is just arcane bullshit to actually write as a human. Nor is it intuitively clear how yaml serializes.

Aux ,

Yaml is cancer.

JackbyDev ,

It’s entirely disingenuous because who the hell is throwing JSON into YAML without converting it? Oh wow, I changed the file extension and it still works. I’m so glad we changed to YAML!

bitfucker ,

Until someone cannot tell the difference between tab and space when configuring or you miss one indentation. Seriously, whoever thinks indentation should have semantic meaning for computers should burn in hell. Indentation is for us, humans, not computers. You can write a JSON with or without indentation if you want. Also, use JSON5 to have comments and other good stuff for a config file.

themusicman ,

If you’re moving away from text formats, might as well use a proper serialisation tool like protobuf…

wtfrank ,

Yaml?

JackbyDev ,

For the love of all things pure, holy, and just, please do not use YAML in your APIs…

wtfrank ,

Fine, and if you don’t use json in your API because of the deficiency highlighted in the meme, what format do you use in your API?

JackbyDev ,

I use JSON. I have used Avro for things in Kafka but I’m not sure the benefits outweigh the negatives. Avro is much more complicated than people think and most folks don’t really have a strong desire to learn how it should be used and do stuff incorrectly. Everybody knows JSON and it works with everything though. (Example: so many people just hear that Avro schemas can be backwards compatible but have zero idea that you still need the schema that wrote the message even if you want to read it into a newer one.)

Interestingly, I take the meme as saying a dev is using the wrong types in their serialization format (using strings to store integers) which was my biggest problem with Avro. Mostly from people not using logical types or preferring to use ISO 8601 datetime strings instead of the built-in timestamp-millis type.

bleistift2 OP ,

Hell, no. If I wanted to save bytes, I’d use a binary format, or just fucking zip the JSON. Looking at a request-response pair and quickly understanding the transferred data is invaluable.

chicken , in Surely "1337" is the same as 1337, right?

Explicit types are just laziness, you should be catching exceptions anyways.

fapforce5 ,

I do. I return an error.

otter , in Alcohol is my way to turn myself on and off again

Oh, we do have a !talesfromtechsupport community (link). Looks like the mod is inactive and the community doesn’t have that many subscribers

Maybe we can try making a new one here on programming.dev

graphito OP ,
@graphito@beehaw.org avatar

Touche, I get your point, indeed there’s a lot of tech supporty posts however narrowing the community is only good when it has enough content

How about we wait out on fragmentation for flagship community of the instance until it starts to get at least 5 posts/day (30 posts/week)?


For lurkers hoarding high quality content for this community, this is your sign to press the button “New post”

otter ,

Oh I don’t mind it, I like the post :)

I was thinking that there might be a lot of Lemmy users working in such roles, without a place (that I know of) to share those stories

Lightfire228 ,

For lurkers hoarding high quality content for this community, this is your sign to press the button “New post”

I’ve never really had good ideas to post

Even on reddit

graphito OP ,
@graphito@beehaw.org avatar

if your coworker shared smt or you see smt online that made you chuckle, it’s good enough to repost it on lemmy. Dont’ overthink it

https://media1.tenor.com/m/YmYYTz-cW7sAAAAC/memes-just-do-it.gif

bleistift2 ,

I wouldn’t have thought that content suitable for talesfromtechsupport would be acceptable here. As the description says,

This is a place where you can post jokes, memes, humor, etc. related to programming!

Customer support is not usually related to programming.

bitchkat , in Junior dev VS FAANMG dev

My experience is exactly the opposite. I don’t work for a FAANG but I’ve been around the block a bit. Its always the junior devs that try and add new warnings etc to the code base. I always require warnings to be cleaned up even if that means disabling specific instances (but not the whole rule) because the rule is flagging a false negative.

bleistift2 ,

the rule is flagging a false negative

false positive?

bitchkat ,

Warnings and errors are negatives not positive. So if it generates a warning that is OK, it’s a false negative.

pantyhosewimp ,

Just so you know, if your doctor calls and tells you that your HIV test is positive, you probably shouldn’t run out and celebrate.

bitchkat ,

That’s why I said false negative. The medical test is testing for the presence of a disease. So if they find the disease is considered a positive test (it found what it was looking for). For static analysis on code, its the opposite. Its testing if your code is free of issues that it can detect. If it finds no issues, then the test was positive. If does find issues, the test failed and each issue is a negative that contributed to the test failing.

overcast5348 ,

You could say “A static analysis tool is testing for the for the presence of defects” or “a medical test is testing if your body is free of diseases that it can detect” to change how you’re looking at either of the tests in the previous comment.

bitchkat ,

By your logic it would be a positive for your code to have errors/warnings. And on the latter, that would appropriate if there was a test that determined if you are free from all known diseases (or at least those that it can detect).

overcast5348 ,

Is it a positive to have pathogens that cause dengue/malaria in your blood? Yet we still say that someone tested positive for dengue if they have the virus.

Static analysis tools don’t test for all known issues either, no?

It’s all just semantics dude. :)

pantyhosewimp ,

I’m not debating. It is not a matter of opinion. I’m doing you the courtesy of informing you how the entire rest of the world uses the term.

If action A looks for thing X, and it finds thing X, then the test is positive. If action A fails to find thing X, then the test is negative.

If action A claims to find thing X, but later confirmation determines that thing X is not really there, then this situation is called “false positive”.

If action A claims fails to find thing X, but later confirmation determines that thing X is actually there, then this situation is called “false negative”.

That thing X may subjectively be considered an unwanted outcome has **nothing ** to do with the terms used.

gravitas_deficiency ,

It boils down to desensitization/normalization. Warnings (and errors, of course, but tests as well) exist for a reason. If you don’t care about these gauge constructs are telling you, then they have no real diagnostic value. Getting into a place where you’re not looking at how your systems are actually running is generally a bad idea, especially in the long run.

mlg , in Play stupid games, win stupid prize
@mlg@lemmy.world avatar

At first I thought this was a legit ban but it actually looks more like an error message similar to 404 lol

onlinepersona , in Alcohol is my way to turn myself on and off again

The “what do we even pay you for?” is just like with projects:

“why isn’t this finished yet?”
We have to add tests and make sure we’ve tried to cover our bases.
“that’s not necessary, if it works now, just release it” That’s not-
“I don’t care, I pay the bills”
Sure thing boss.
a few weeks later “This thing doesn’t work”
Yeah, it’s what we wanted to test.
“Well why didn’t you?”
😐

Anti Commercial-AI license

Hexarei ,
@Hexarei@programming.dev avatar

Somehow there’s never time to do it right, but there’s always time to do it again

Asafum ,

The company I work for doesn’t advertise, we live and die by our reputation.

Also: ship it, let the customer complain if they find it.

…ffs

taanegl , in Nobel Prize to Be Awarded to Forum User From 9 Years Ago With Same Niche Problem

This person, nay, this legend, has reached across language barriers and opened up entire new worlds to people who suffer from lacking or outdated documentation.

If you or your loved ones are afflicted by bad documentation, please voice your grievances to whatever ticket or email chain deserves to be told their documentation is absolute ass.

Yes, I can read the code API, now delete that old ass mess. If you don’t want to communicate it, let someone else have those search engine results.

Ffs.

CanadaPlus , (edited ) in Please stop

YEARS OF BACKPORTS yet NO REAL WORLD USE FOUND for staying more than ONE VERSION behind

I have a really old computer that still gets the job done, and just getting up to Bullseye broke it a bit.

I know, I know, it’s just a meme.

Transporter_Room_3 , in Alcohol is my way to turn myself on and off again
@Transporter_Room_3@startrek.website avatar

I have a friend who works for a local, but widespread bank, and got to head up their digital security and IT stuff. Not sure what all it encompasses, but he quickly found out that it was a lot, and the previous guy quit because he had had enough bullshit.

Long story shorter, after a particularly bad week, he decided to just… Stop doing his job.

Kept all their legal stuff and sensitive info under lock and key, but the smaller stuff, he just let it go. Went on vacation, turned everything off, didn’t do everything for a temporary replacement (which isn’t even his job, it’s hr’s) and spent a week playing video games and spending time with his wife and baby.

Several employees just in his building basically ended up doing nothing by the end of the first day because they had locked themselves out of the system.

By day 3 there were several lines that couldn’t be used by the tellers in every branch, older employees were bricking their systems so fast, construction workers started taking notes.

By the end of the week they had people showing up at his door to try and contact him since nobody could get ahold of him. Some legit thought he was dead.

His first words when he got into the office on Monday, we’re “THAT is why you pay me.”

And after that, he was given 3 people to help out (he had been asking for 4) and they had a company come in and redo a lot of the computer systems that year.

Still works for the bank, still has a team although I think they’re bigger now since they’ve opened a few more branches, and still tells that story at every gathering after his one single beer gets him tipsy.

Is it just me, or do programmers only come in “lightweight” and “Rivals Þor in trying to drink the oceans dry” varieties?

joby ,

Is it just me, or do programmers only come in “lightweight” and “Rivals Þor in trying to drink the oceans dry” varieties?

Somehow I manage to be both. My alcohol tolerance is very high (which is great… I like a little buzz but never want to be actually drunk), but for me, one toke is over the line.

Zoop ,

One toke is over the line? Sweet Jesus!

SoleInvictus ,

I’m the same way. I take like a quarter hit and I’m alright. The whole puff? Gone for hours.

bleistift2 ,

Somehow I can tell that this story didn’t go down in the US.

Transporter_Room_3 ,
@Transporter_Room_3@startrek.website avatar

Surprisingly, in the Midwest.

firelizzard ,
@firelizzard@programming.dev avatar

Two cocktails will get me tipsy, two beers if they’re strong, but I can drink an entire bottle of vodka (over the course of 2-3 hours) without blacking out. Or at least I could in college, I’m not looking to try again.

someguy3 , in Junior dev VS FAANMG dev

I thought we decided FAANGM was better as FAGMAN.

MHanak ,

“Pepsiman” started playing in my head, but instead of pepsiman it was f****tman

sheepishly ,

It was the Batman theme for me. Na nanana na na... fagmaaaaannnn

TheKMAP ,

Facebook is Meta, no one cares about Microsoft.

So the acronym is MANGA

excel , (edited ) in Trying to understand JSON…
@excel@lemmy.megumin.org avatar

If you’re branching logic due to the existence or non-existence of a field rather than the value of a field (or treating undefined different from null), I’m going to say you’re the one doing something wrong, not the Java dev.

These two things SHOULD be treated the same by anybody in most cases, with the possible exception of rejecting the later due to schema mismatch (i.e. when a “name” field should never be defined, regardless of the value).

sik0fewl ,

Ya, having null semantics is one thing, but having different null and absent/undefined semantics just seems like a bad idea.

Username ,

Not really, if absent means “no change”, present means “update” and null means “delete” the three values are perfectly well defined.

For what it’s worth, Amazon and Microsoft do it like this in their IoT offerings.

0x0 ,

It gets more fun if we’re talking SQL data via C API: is that 0 a field with 0 value or an actual NULL? Oracle’s Pro*C actually has an entirely different structure or indicator variables just to flag actual NULLs.

expr ,

Zalando explicitly forbids it in their RESTful API Guidelines, and I would say their argument is a very good one.

Basically, if you want to provide more fine-grained semantics, use dedicated types for that purpose, rather than hoping every API consumer is going to faithfully adhere to the subtle distinctions you’ve created.

masterspace , (edited )

They’re not subtle distinctions.

There’s a huge difference between checking whether a field is present and checking whether it’s value is null.

If you use lazy loading, doing the wrong thing can trigger a whole network request and ruin performance.

Similarly when making a partial change to an object it is often flat out infeasible to return the whole object if you were never provided it in the first place, which will generally happen if you have a performance focused API since you don’t want to be wasting huge amounts of bandwidth on unneeded data.

expr ,

The semantics of the API contract is distinct from its implementation details (lazy loading).

Treating null and undefined as distinct is never a requirement for general-purpose API design. That is, there is always an alternative design that doesn’t rely on that misfeature.

As for patches, while it might be true that JSON Merge Patch assigns different semantics to null and undefined values, JSON Merge Patch is a worse version of JSON Patch, which doesn’t have that problem, because like I originally described, the semantics are explicit in the data structure itself. This is a transformation that you can always apply.

masterspace , (edited )

No there isn’t.

Tell me how you partially change an object.

Object User :

{ Name: whatever, age: 0}

Tell me how you change the name without knowing the age. You fundamentally cannot, meaning that you either have to shuttle useless information back and forth constantly so that you can always patch the whole object, or you have to create a useless and unscalable number of endpoints, one for every possible field change.

As others have roundly pointed out, it is asinine to generally assume that undefined and null are the same thing, and no, it flat out it is not possible to design around that, because at a fundamental level those are different statements.

expr ,

As I already said, it’s very simple with JSON Patch:


<span style="color:#323232;">[
</span><span style="color:#323232;">  { </span><span style="background-color:#f5f5f5;font-weight:bold;color:#b52a1d;">*op</span><span style="font-weight:bold;color:#183691;">": "</span><span style="background-color:#f5f5f5;font-weight:bold;color:#b52a1d;">replace</span><span style="font-weight:bold;color:#183691;">", "</span><span style="background-color:#f5f5f5;font-weight:bold;color:#b52a1d;">path</span><span style="font-weight:bold;color:#183691;">": "</span><span style="background-color:#f5f5f5;font-weight:bold;color:#b52a1d;">/Name™,</span><span style="color:#323232;"> </span><span style="font-weight:bold;color:#183691;">"value"</span><span style="color:#323232;">: "otherName"}
</span><span style="color:#323232;">]
</span>

Good practice in API design is to permissively accept either undefined or null to represent optionality with same semantics (except when using JSON Merge Patch, but JSON Patch linked above should be preferred anyway).

masterspace ,

I.e. waste a ton of bandwidth sending a ridiculous amount of useless data in every request, all because your backend engineers don’t know how to program for shit.

Gotcha.

expr ,

It’s about making APIs more flexible, permissive, and harder to misuse by clients. It’s a user-centric approach to API design. It’s not done to make it easier on backend. If anything, it can take extra effort by backend developers.

But you’d clearly prefer vitriol to civil discourse and have no interest in actually learning anything, so I think my time would be better spent elsewhere.

sukhmel ,

Except, if you use any library for deserialization of JSONs there is a chance that it will not distinguish between null and absent, and that will be absolutely standard compliant. This is also an issue with protobuf that inserts default values for plain types and enums. Those standards are just not fit too well for patching

masterspace ,

I’ve never once seen a JSON serializer misjudge null and absent fields, I’ve just seen developers do that.

sukhmel ,

Well, Jackson before 2.9 did not differentiate, and although this was more than five years ago now, this is somewhat of a counter example

Also, you sound like serializers are not made by developers

masterspace ,

Bruh, there’s a difference between the one or two serializing packages used in each language, and the thousands and thousands and thousands of developers who miscode contracts after that point.

eyeon ,

it does feel ambiguous though as even what you outlined misses a 4th case. if null means delete, how do I update it to set the field to null?

paholg ,

They’re semantically different for PATCH requests. The first does nothing, the second should unset the name field.

expr ,

Only if using JSON merge patch, and that’s the only time it’s acceptable. But JSON patch should be preferred over JSON merge patch anyway.

Servers should accept both null and undefined for normal request bodies, and clients should treat both as the same in responses. API designers should not give each bespoke semantics.

masterspace ,

Why?

Because Java struggles with basic things?

It’s absurd to send that much data on every patch request, to express no more information, but just to appease the shittiness of Java.

Aux ,

Why are you so ignorant?

XpeeN ,

Why not explaining instead of looking down on people? Now they know they’re wrong bit don’t know why. Nice.

Aux ,

You’ve replied to the wrong person.

arendjr ,

JSON patch is a dangerous thing to use over a network. It will allow you to change things inside array indices without knowing whether the same thing is still at that index by the time the server processes your request. That’s a recipe for race conditions.

expr ,

That’s what the If-Match header is for. It prevents this problem.

That being said, I generally think PUTs are preferable to PATCHes for simplicity.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines