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.

ohlaph , in GoOn

Doug

vox , in GoOn
@vox@sopuli.xyz avatar

ipv6

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.

aaaaaaadjsf , in Merge then review
@aaaaaaadjsf@hexbear.net avatar

“Xtreme programming practices”.

Lmao what!

Blackmist , in Merge then review

Do we have a Linked In Lunatics sub on Lemmy?

jozep ,
Anders429 ,

Wow, I’m really disappointed, it’s just full of posts from parody accounts with people in the comments not realizing it isn’t real.

Anders429 , in Merge then review

Bet you $50 we later learn this guy was orchestrating a supply chain attack.

Mr_Dr_Oink , in GoOn

0.0.0.0 /0 ::/0

SUCK MY DICK, GRU!

Jimmyeatsausage ,

This is the way.

KairuByte ,

Haha spot on

asw13c , in Yes

wow

GissaMittJobb , in Oh yea, that's the good stuff **huffs glue**

Since all of the expressions just wrap a None, I wouldn’t be surprised if the transmutes basically get compiled to 0, making the assertion at the end assert_eq!(0 * 0, 0).

tatterdemalion OP ,
@tatterdemalion@programming.dev avatar

Nah these are the actual integer representations. Otherwise you would have Some(None) == Some(Some(None)) which is way too Javascripty for Rust folks.

GissaMittJobb ,

That’s kind of wild, I double-checked and it’s true.

Although I disagree with the second part, the Rust folks wouldn’t care about the in-memory representation as long as the compilation is on point.

Looking closer at the final enum, I guess it’s because there are nine possible cases for it, making the compiler pack it into 4 bits, with one number representing each? I checked and None is represented as 8, while 7 Somes containing a None is 0 and the full 8 Somes is represented by 1.

tatterdemalion OP ,
@tatterdemalion@programming.dev avatar

the Rust folks wouldn’t care about the in-memory representation as long as the compilation is on point.

Well I can’t speak for everyone, but Rust is very intentional about supporting things like repr©. At least some of us care a lot.

FauxPseudo , in Yes
@FauxPseudo@lemmy.world avatar

I’m currently trying to relearn all my advanced bash in python.

aes ,

i already learned how to use my operating system, now you’re telling me I have to learn 30 new libraries that do the exact same shit?

bort ,

no, you’ll also have to learns each libraries special quirks on your OS

tdawg ,

Just for fun or do you have a specific thing you feel would be better in python?

FauxPseudo ,
@FauxPseudo@lemmy.world avatar

Certain things I want to do will be easier in python and will be more portable. But bash is my home.

tdawg ,

Fair enough. The line for me has always been whether or not I expect to use it for more than just glue or a one off run

nxdefiant , in Merge then review

I help JavaScript engineers become framework A…

ssholes.

schnurrito , in Merge then review

I mean this is basically a wiki, isn’t it.

Shinji_Ikari ,
@Shinji_Ikari@hexbear.net avatar

A typo in the first paragraph of the article in a wiki wont make the 5th paragraph tear down the entire wiki.

schnurrito ,

you’d be surprised how complex MediaWiki syntax is nowadays, there are many ways to break things on a wiki

okamiueru , in Merge then review

This is satire, right? Surely no one would put their name on that publicly?

Like someone working in a kitchen boasting about a life hack of not wasting time with hygiene.

DudeDudenson ,

Wash your hands after cooking, never let food products sit stale

affiliate ,

never chew before swallowing either. the food can still get stale in your mouth

Static_Rocket , in GoOn
@Static_Rocket@lemmy.world avatar

0.0.0.0/0 0::0/0

You didn’t specify it couldn’t be in CIDR block notation…

Redjard ,

::/0

Mr_Dr_Oink ,

Remember, when we abbreviate an ipv6 address all leading zeros are reduced to a single 0.

E.g

0003 would just become 03

When there are geoups of 4 zeros these can be represented as a single 0 or as a double colon ::

But we can only use the :: once so when summarizing an address containing multiple groups of 4 0s one after the other they can all be abbreviated to a single ::

Eg

fe80:0000:0000:0000:0210:5aff:feaa:20a2 would become fe80::210:5aff:feaa:20a2

Therefore it is perfectly valid to abbreviate an address of 0000:0000:0000:0000:0000:0000:0000:0000 /0 to just ::/0

Static_Rocket ,
@Static_Rocket@lemmy.world avatar

Eh, I’ve seen some software internally prefer 0::0 instead of just ::0 or :: . Notation wise though you are correct, it is unnecessary.

superfes , in GoOn

People name IPs outside of DNS, I mean is there like a Susan or a Karen, perhaps a Clark IP?

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