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.

Cwilliams , in Correcting > Helping

My coworkers had a hard time picking resturaunts, so I started recommending McDonald’s for work parties, and then everyone else started chiming in with actually good ideas.

dept , in Correcting > Helping

imo it’s not that correcting feels better than helping but rather it’s easier to correct someone than draft an answer of your own.

suy ,

Sometimes that’s part of the issue (or the whole deal), but sometimes it’s not even that.

Sometimes it’s that someone asked something difficult and elaborate to answer, which has been answered a ton of times, and it’s tedious to answer again and again. But if someone answers with misinformation or even straight FUD, then one needs to feel the urge to correct that to prevent misinformation.

I suffered that with questions in r/QtFramework. Tons of licensing questions, repeated over and over, from people who have not bothered to read a bit about such a well known and popular license as LGPL. Then someone who cares little for the nuance answers something heavy handed, and paints a wrong picture. Then I can’t let the question pass. I need to correct the shitty answer. :-(

repungnant_canary ,

I would say that if someone asks a difficult question it’s often difficult because it’s very general, so you don’t have any specific point to answer that you know will satisfy the person asking.

On the other hand, if someone is writing misinformation then they provide specific statements which still may be difficult to correct but you have those anchor points you can refer to.

So I guess the thing here is that if someone, after asking a question, writes a BS answer they actually refine their question and narrow its scope, thus making it easier to answer.

I usually see broad questions about rather simple things unanswered, but very specific yet difficult questions answered

Snowplow8861 , in Correcting > Helping

Almost like that xkcd joke…

xoggy ,
@xoggy@programming.dev avatar

I was trying to remember where I read this originally. Thank you.

tilcica , in Correcting > Helping

i do the same thing. its called Murphy’s law :D

themeatbridge ,

I know what you’re doing but I can’t help myself. It’s Cunningham’s law.

Malix ,
@Malix@sopuli.xyz avatar

tbh, I prefer Cole’s Law

bassomitron ,

Took me a minute to realize this was a pun… shame on me.

squaresinger ,

Cole’s law is best with a burger.

ObviouslyNotBanana ,
@ObviouslyNotBanana@lemmy.world avatar

Cole’s Law: if there’s a salad, I want that one.

jaybone ,

Brannigan’s Love is like Brannigan’s cole slaw, wet and chunky.

swab148 ,
@swab148@startrek.website avatar

The spirit is willing but the flesh is spongy and bruised.

Z3k3 ,

I’ll be honest you almost for me

magic_lobster_party ,

Ahem, it’s called Poe’s law

Sotuanduso ,

Are you /srs or /j?

AngryCommieKender ,

They’re Super Cereal

Sotuanduso ,

Is this Betteridge’s Law?

FlyingSquid ,
@FlyingSquid@lemmy.world avatar

No.

CJOtheReal ,

Nah thats called laws of thermodynamics! And they were made up by Elvis together with is homy Obama (the guy without last name) who were known for their contributions to biology

moody ,

Are you talking about uncle Obama, well known for his banana?

amanaftermidnight , in Temporary mental block

Trying to write tests for the spaghetti mess of a code of your app: 💀💀💀

fl42v , in A box of DevOps

Those devops should switch to nix already 😁

calcopiritus , in Show me a better text format for serializing

Serializing? For serializing you probably want performance above all else. I’m saying this without checking any benchmark, but I’m sure yaml is more expensive to parse than other formats where indentation don’t have meaning.

For human readability: it has to be readable (and writeable) by all humans. I know (a lot of people) that dislike yaml, toml and XML. I don’t know of a single person that struggles to read/write json, there is a clear winner.

DrM ,

JSON would be perfect if it allowed for comments. But it doesn’t and that alone is enough for me to prefer YAML over JSON. Yes, JSON is understandable without any learning curve, but having a learning curve is not always bad. YAML provides a major benefit that is worth the learning curve and doesn’t have the issues that XML has (which is that there is no way to understand an XML without also having the XSD for it)

Michal ,

Json should also allow for trailing commas. There’s no reason for it not too. It’s annoying having to maintain commas.

DerArzt ,

And also a standard date time type!

kogasa ,
@kogasa@programming.dev avatar

If a comment isn’t part of the semantic content of a JSON object it has no business being there. JSON models data, it’s not markup language for writing config files.

You can use comments in JSON schema (in a standardized way) when they are semantically relevant: json-schema.org/…/comments

For the data interchange format, comments aren’t part of the JSON grammar but the option to parse non-JSON values is left open to the implementation. Many implementations do detect (and ignore) comments indicated by e.g. # or //.

frezik ,

JSON models data, it’s not markup language for writing config files.

JavaScript package management promptly said otherwise. JSON is a config format no matter if you like it or not.

kogasa ,
@kogasa@programming.dev avatar

I’ve disagreed with JavaScript before, what makes you think I won’t do it again?

Anyway, anything using JSON as a config language will also certainly use a JSON interpreter that can ignore comments. Sure that’s “implementation specific,” but so is a config file. You wouldn’t use “MyApplication.config.json” outside the context of MyApplication loading its own configuration, so there’s no need for it to be strictly compliant JSON as long as it plays nicely with most text editors.

frezik ,

JSON5 has comments, among fixing a few other shortsighted limitations of the original.

kool_newt ,

I don’t know of a single person that struggles to read/write json, there is a clear winner.

Really? Any JSON over 80 chars becomes a nightmare to read for me, especially if indention is not used to make it more readable.

kogasa ,
@kogasa@programming.dev avatar

Serializing isn’t necessarily about performance, or we’d just use protobuf or similar. I agree Json is a great all rounder. Combine with JSON object schema to define sophisticated DSLs that are still readable, plain JSON. TOML is nice as a configuration language, but its main appeal (readability) suffers when applied to complex modeling tasks. XML is quite verbose and maybe takes the “custom DSL” idea a little too far. YAML is a mistake.

Blackmist ,

I don’t know why we’re fucking about trying to use text editors to manipulate structured data.

Yeah, it’s convenient to just be able to use a basic text editor, but we’re not trying to cram it all on a floppy disk here. I’m sure we could have a nice structured data editor somewhere for all those XML, JSON and YAML files we’re supposed to maintain every day.

Artyom , (edited ) in Show me a better text format for serializing

Yaml is a great, human-readible file format. Unless there’s an exclamation point in it, then it is an illegible Eldrich horror.

MagnoliaMayhem , in Show me a better text format for serializing

Json. Your move, Joker.

theterrasque ,

puts the json in the yaml parser

Your move, foolish mortal

derpgon ,

For those uninitiated, every JSON is a valid YAML, since YAML is just a superset of JSON.

Windex007 , in Show me a better text format for serializing

Genuinely curious what features OP is looking for, specifically for serialization as per the post, that has resulted in the conclusion being yaml.

magic_lobster_party , in Show me a better text format for serializing

JSON for serialization all the way. It’s simple and to the point. It does one thing and does it well. There’s little room for annoying surprises. Any JSON can easily be minified and prettified back and forth. If you want it in binary format you can convert it to BSON.

Yaml is too much of a feature creep. It tries to do way too many things at the same time. There are so many traps to fall into if you’re not cautious enough. The same thing can be written in multitudes of ways.

jjjalljs ,

Yes, but whoever decided that json can’t have trailing commas has my ire.


<span style="color:#323232;">{ "a": 1,
</span><span style="color:#323232;">  "b": 2,  &lt;-- nope
</span><span style="color:#323232;">}
</span>

There was some other pitfall I can’t remember around missing keys and undefined, too, but I can’t remember it now.

OmnipotentEntity ,
@OmnipotentEntity@beehaw.org avatar

Change to Haskell formatted commas and the problem goes away :D


<span style="color:#323232;">{ "a": 1
</span><span style="color:#323232;">, "b": 2
</span><span style="color:#323232;">, "c":
</span><span style="color:#323232;">    [ 3
</span><span style="color:#323232;">    , 6
</span><span style="color:#323232;">    , 9
</span><span style="color:#323232;">    ]
</span><span style="color:#323232;">}
</span>
ursakhiin ,

Where is the nearest fire to dump this comment in?

Sgtmoustache ,

I’m pretty sure you can have trailing commas…

Bjornir ,

You can’t but some parser allow them. But those that do do not respect the standard.

Sgtmoustache ,

Good to know. Must be why I thought you could. Thanks.

adambowles ,

Trailing commas are supported in json5, as well as comments

kool_newt ,

There should be a “Simple YAML” that is just scalars, lists, and dicts.

kogasa ,
@kogasa@programming.dev avatar

Toml

interolivary , in Show me a better text format for serializing
@interolivary@beehaw.org avatar

There’s a special place in hell for the inventor of semantically significant whitespace.

YAML itself is one of the circles of hell. You have to copy-paste YAML from web etc sources with dubious formatting for all eternity, and the editor doesn’t have YAML support. Also you can only use Python

synae ,
@synae@lemmy.sdf.org avatar

Sounds like a good time to me!

interolivary ,
@interolivary@beehaw.org avatar

I’m not sure which thought is scarier: that you don’t know what you’re signing up for, or that you do know and you enjoy fixing undecidable formatting fuckups manually

synae ,
@synae@lemmy.sdf.org avatar

There’s a bonus third option: I started writing python professionally in 2007 and nowadays spend 75% of my “hands on keyboard” time working on kubernetes YAML and I am indeed having a good time.

I admit, I hastily misread the tail end of your comment as (e.g.) “A reason YAML is bad because you have to copy-paste from the web and that sucks”; not as you probably meant it “in this special hell, you must deal with copy-pasted nbsp and other trash”. So maybe I did not know exactly what I was signing up for ;)

I don’t deal with anything like that and not entirely sure how it happens to people enough that it is a common complaint. “undecidable formatting fuckups” are a non-issue in my life, I really don’t understand how people encounter such things. Maybe they need to fix their editor/IDE/tools? Skill issue? IDK.

As a tangent- I don’t care what language code is written in, it had better be indented properly (and linted, and follow the project’s codestyle, …). Our juniors learn pretty early that their change requests will be blocked on formatting alone by CI, and a human won’t even bother reviewing the substance of their change if they don’t follow convention. I don’t hear them ever complaining about any of these things, least of all semantic whitespace … and we have a rich culture of bitching about menial/pedantic things ;)

magic_lobster_party ,

Indenting copy pasted yaml is always a pain in the butt. Any indentation you give is likely a valid yaml. Especially bad considering indentation has a significant meaning. You have to double check back and forth to ensure nothing bad has sneaked in.

With JSON there are no such discrepancies. It’s likely the editor has figured it out for you already. If it hasn’t it’s easy to prettify the JSON yourself.

interolivary ,
@interolivary@beehaw.org avatar

Semantic whitespace problems can easily be literally impossible to solve automatically. One of the dumbest fucking ideas anybody ever came up with in computing and its inventor if anyone belongs in YAML Hell. As a fuckup it’s not quite as bad as null, but that ain’t exactly a high bar

synae , in Show me a better text format for serializing
@synae@lemmy.sdf.org avatar

For serializing? I’d probably just go with json.

For content meant to be written or edited by humans? YAML all day baby

Andy ,
@Andy@programming.dev avatar

Ever tried NestedText? It’s like basic YAML but everything is a string (types are up to the code that ingests it), and you never ever need to escape a character.

synae ,
@synae@lemmy.sdf.org avatar

I’ve got too many consumers that I don’t control which dictate their input formats. And to be quite honest, “types are up to the code that ingests it” sounds like a huge negative to me.

Andy ,
@Andy@programming.dev avatar

Ah, well I love that policy (types being in code, not configs). FWIW I sometimes use it as a hand-edited document, with a small type-specifying file, to generate json/yaml/toml for other programs to load.

NewPerspective , in Show me a better text format for serializing

My problem with yaml is if you truncate it at any random spot, there’s a high likelihood it’s still valid yaml. I don’t like the idea that things can continue without even knowing there’s a problem. The single opening and closing curly braces enclosing a json object is all it takes to at least know you didn’t receive the entire message. Toml has the same issue. I’ll stick with json when it makes sense.

pimeys ,

Add a schema to it and you get XML. The ultimate serialization format.

marcos ,

Quite like YAML, XML has too many stuff in it. While a lot of parsers are not standard compliant and safe, if there’s any chance the stuff you include on your code can evolve into a fully featured parser, including it is something to avoid.

There is this language called KDL that looks interesting.

nxdefiant , in Show me a better text format for serializing

If you have a choice to start from scratch, TOML is probably the better option.

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