this post was submitted on 02 Sep 2024
124 points (100.0% liked)

Programming

17507 readers
206 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

There are a couple I have in mind. Like many techies, I am a huge fan of RSS for content distribution and XMPP for federated communication.

The really niche one I like is S-expressions as a data format and configuration in place of json, yaml, toml, etc.

I am a big fan of Plaintext formats, although I wish markdown had a few more features like tables.

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 58 points 2 months ago* (last edited 2 months ago) (22 children)

ISO 8601 date format. Not because it's from a standards body, but because it's simple, sensible, clearly defined, easy to recognize, and very effective.

Date field placement in any order other than most-significant-digits-first is not only counterintuitive, but needlessly complicated to work with. Omitting critical information like the century is ambiguous and confusing.

We don't live in isolated villages any more. Mixing and matching those problems by accepting all the world's various regional and personal date styles, especially with no reliable indication of which ones apply in any given case, leads to the hodgepodge of error-prone date madness that we have today.

The 2024-09-02 format should be taught in schools and required in official documents. Let the antiquated date styles fall into disuse outside of art and personal correspondence, like cursive writing.

[–] [email protected] 24 points 2 months ago

And it can be sorted alphabetically in all software. That's a pretty big advantage when handling files on a computer

[–] [email protected] 8 points 2 months ago* (last edited 2 months ago) (2 children)

I love this standard. If you dig deeper into it, the standard also covers a way to express intervals and periods. E.g. "P1Y2M10DT2H30M" represents one year, 2 months, 10 days, 2 hours and 30 mins.

I recall once using the standard when writing a cron-style scheduler.

I also like the POSIX "seconds since 1970" standard, but I feel that should only be used in RAM when performing operations (time differences in timers etc.). It irks me when it's used for serialising to text/JSON/XML/CSV.

Also: Does Excel recognise a full ISO8601 timestamp yet?

load more comments (2 replies)
load more comments (20 replies)
[–] [email protected] 50 points 2 months ago* (last edited 2 months ago) (28 children)

The metric system, f*ck the imperial system. Every scientist sticks to the metric system, and why are people even still having an imperial system, with outdated measurements like stones for weight blows my mind.

Also f*ck Fahrenheit, we have Celsius and Kalvin for that, we don't need another hard to convert temperature measurement.

[–] [email protected] 24 points 2 months ago

You are allowed to say fuck here.

load more comments (27 replies)
[–] [email protected] 42 points 2 months ago* (last edited 2 months ago) (6 children)

IPv6. Stop engineering IoT junk on single-stack IPv4, you dipshits.

Ogg Opus. It's superior to everything in every way. It's free and there is absolutely no reason to not support it. It blows my mind that MPEG 1.0 Layer III is still so dominant.

[–] [email protected] 11 points 2 months ago* (last edited 2 months ago) (2 children)

It blows my mind that MPEG 1.0 Layer III is still so dominant.

Count the number of devices in use today that will never support Opus, and it might not blow your mind any longer. Also, AFAIK, the reference implementation still doesn't implement full functionality on hardware that lacks a floating point unit.

These things take time.

load more comments (2 replies)
[–] [email protected] 8 points 2 months ago

IPv6. Stop engineering IoT junk on single-stack IPv4, you dipshits.

Amen

load more comments (4 replies)
[–] [email protected] 32 points 2 months ago (15 children)

It's completely bonkers that JPEG-XL is as good as it is and no one wants to actually implement it into web browsers

[–] [email protected] 14 points 2 months ago (3 children)

Adobe is backing the format, Apple support is coming along, and there are rumors that Apple is switching from HEIC to JPEG XL as a capture format as early as the iPhone 16 coming out in a few weeks. As soon as we have a full blown workflow that can take images from camera to post processing to publishing in JXL, we might see a pretty strong push for adoption at the user side (browsers, websites, chat programs, social media apps and sites, etc.).

load more comments (3 replies)
load more comments (14 replies)
[–] [email protected] 24 points 2 months ago (1 children)

Zigbee or really any Bluetooth alternative.

Bluetooth is a poorly engineered protocol. It jumps around the spectrum while transmitting, which makes it difficult and power intensive for bluetooth receivers to track.

load more comments (1 replies)
[–] [email protected] 23 points 2 months ago (2 children)

I'll give my usual contribution to RSS feed discourse, which is that, news flash! RSS feeds support video!

It drives me crazy when podcasters are like, "thanks for listening to our audio podcasts. We also have a video feed for our YouTube subscribers." Just let me have the video in PocketCasts please!

[–] [email protected] 15 points 2 months ago (1 children)

I feel you but i dont think podcasters point to youtube for video feeds because of a supposed limitation of RSS. They do it because of the storage and bandwidth costs of hosting video.

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 23 points 2 months ago* (last edited 2 months ago) (6 children)

Depending where you use it, but often tables are available in markdown.

markdown table
x y
 |markdown|table|
 |--|---|
 |x|y|

Fixed..cos you could only see rendered and not code.

[–] [email protected] 12 points 2 months ago (2 children)

Oh. Good one. Markdown everywhere. Slack always pissed me off for it's sub par markdown support.

load more comments (2 replies)
load more comments (5 replies)
[–] [email protected] 21 points 2 months ago (3 children)

This isn't exactly what you asked, but our URI/URL schema is basically a bunch of missed opportunities, and I wish it was better designed.

Ok so it starts off with the scheme name, which makes sense. http: or ftp: or even tel:

But then it goes into the domain name system, which suffers from the problem that the root, then top level domain, then domain, then progressively smaller subdomains, go right to left. www.example.com requires the system look up the root domain, to see who manages the .com tld, then who owns example.com, then a lookup of the www subdomain. Then, if there needs to be a port number specified, that goes after the domain name, right next to the implied root domain. Then the rest of the URL, by default, goes left to right in decreasing order of significance. It's just a weird mismatch, and would make a ton more sense if it were all left to right, including the domain name.

Then don't get me started about how the www subdomain itself no longer makes sense. I get that the system was designed long before HTTP and the WWW took over the internet as basically the default, but if we had known that in advance it would've made sense to not try to push www in front of all website domains throughout the 90"s and early 2000's.

[–] [email protected] 7 points 2 months ago* (last edited 2 months ago)

Then don’t get me started about how the www subdomain itself no longer makes sense. I get that the system was designed long before HTTP and the WWW took over the internet as basically the default, but if we had known that in advance it would’ve made sense to not try to push www in front of all website domains throughout the 90"s and early 2000’s.

I have never understood why you can delegate a subdomain but not the root domain, I doubt it was a technical issue because they added support for it recently via SVCB records (But maybe technical concerns were actually fixed in the decades since)

load more comments (2 replies)
[–] [email protected] 20 points 2 months ago (2 children)

JSON5. it's basically just JSON with several QoL improvements, like comments, that make it usable as a format for human consumption (as opposed to a serialization format).

[–] [email protected] 12 points 2 months ago (3 children)

Objects may have a single trailing comma.

I just came.

load more comments (3 replies)
load more comments (1 replies)
[–] [email protected] 17 points 2 months ago (4 children)

Since nobody's brought it up: MQTT.

It got pigeonholed into IoT world, but it's a pretty decent event pubsub system. It has lots lf security/encryption options, plus a websocket layer, so you can use it anywhere from devices, to mobile, to web.

As of late last year, RabbitMQ started suporting it as a supported server add-on, so it's easy to use it to create scalable, event-based systems, including for multiuser games.

load more comments (4 replies)
[–] [email protected] 17 points 2 months ago (4 children)

GRPC for building APIs instead of REST. Type safety makes life easier

[–] [email protected] 8 points 2 months ago (2 children)

The biggest problems with gRPC are:

  1. Very complicated. Way more complexity than you want in most cases.
  2. Depends on HTTP 2. I've seen people who weren't even doing web stuff reach for gRPC, and now boom you have a web server in your stack for now reason. Compare to Thrift which properly separates out encodings, transports, etc.
  3. Doesn't work from the web. There are actually two modifications to gRPC to make it work on the web which means you have three different incompatible versions of gRPC with different feature sets. IIRC some of them require setting up complex proxies, some don't support streaming calls, ugh. Total mess.

Plain HTTP can be type safe. Just publish JSON schema or Typespec files or even use Protobuf.

load more comments (2 replies)
[–] [email protected] 8 points 2 months ago* (last edited 2 months ago)

I mean, REST-ful JSON APIs can be perfectly type-safe, if their developers actually take care to make them that way. And the self-descriptive nature of JSON is arguably a benefit in really large public-facing APIs. But yeah, gRPC forces a certain amount of type-safety and version control, and gRPC with protobuf is SUCH a pleasure to work with.

Give it time, though, it's definitely gaining traction.

[–] [email protected] 7 points 2 months ago* (last edited 2 months ago)

It's the recommended approach to replace WCF which was deprecated after .NET framework 4.8. My company is just now getting around to ripping out all their WCF stuff and putting in gRPC. REST interfaces were always a non-starter because of how "heavyweight" they were for our use case (data collection from industrial devices which are themselves data collectors).

load more comments (1 replies)
[–] [email protected] 17 points 2 months ago* (last edited 2 months ago) (1 children)

I wish standards were always open access. Not behind a 600 dollar paywall.

When it is paywalled I'm irritated it's even called a standard.

load more comments (1 replies)
[–] [email protected] 15 points 2 months ago (1 children)

ActivityPub :) People spend an incredible amount of time on social media—whether it be Facebook, Instagram, Twitter/X, TikTok, and YouTube—so it’d be nice to liberate that.

load more comments (1 replies)
[–] [email protected] 15 points 2 months ago* (last edited 2 months ago) (2 children)
[–] [email protected] 10 points 2 months ago

I also pick this guy's IRC

load more comments (1 replies)
[–] [email protected] 14 points 2 months ago (3 children)

TOML instead of YAML or JSON for configuration.

YAML is complex and has security concerns most people are not aware of.

JSON works, but the block quoting and indenting is a lot of noise for a simple category key value format.

[–] [email protected] 15 points 2 months ago (2 children)

TOML is not a very good format IMO. It's fine for very simple config structures, but as soon as you have any level of nesting at all it becomes an unobvious mess. Worse than YAML even.

What is this even?

[[fruits]]
name = "apple"

[fruits.physical]
color = "red"
shape = "round"

[[fruits.varieties]]
name = "red delicious"

[[fruits.varieties]]
name = "granny smith"

[[fruits]]
name = "banana"

[[fruits.varieties]]
name = "plantain"

That's an example from the docs, and I have literally no idea what structure it makes. Compare to the JSON which is far more obvious:

{
  "fruits": [
    {
      "name": "apple",
      "physical": {
        "color": "red",
        "shape": "round"
      },
      "varieties": [
        { "name": "red delicious" },
        { "name": "granny smith" }
      ]
    },
    {
      "name": "banana",
      "varieties": [
        { "name": "plantain" }
      ]
    }
  ]
}

The fact that they have to explain the structure by showing you the corresponding JSON says a lot.

JSON5 is much better IMO. Unfortunately it isn't as popular and doesn't have as much ecosystem support.

load more comments (2 replies)
[–] [email protected] 15 points 2 months ago (3 children)

YAML is complex and has security concerns most people are not aware of.

YAML is racist to Norwegians.

If you have something like country: NO (NO = Norway), YAML will turn that into country: False. Why? Implicit casting. There are a bunch of truthy strings that'll be cast automagically.

load more comments (3 replies)
load more comments (1 replies)
[–] [email protected] 12 points 2 months ago (17 children)

I don't use XMPP but it seems like such a no-brainer

load more comments (17 replies)
[–] [email protected] 11 points 2 months ago (4 children)
load more comments (4 replies)
[–] [email protected] 11 points 2 months ago (5 children)

Org-mode is like md but has tables and more. Emacs will even run computation as a party of interpretation. GitHub accepts it in place of markdown.

load more comments (5 replies)
[–] [email protected] 10 points 2 months ago* (last edited 2 months ago) (2 children)

PGP or GPG, however you spell it. You can encrypt stuff, protect your email from prying eyes!

Also FOSS in general.

load more comments (2 replies)
[–] [email protected] 9 points 2 months ago (3 children)

i'm a plan 9 from bell labs fan. Imagine how excited I was when wsl used 9P for its plumbing. then they scrapped it all for wsl2.

just, the power they managed to get out of those union mounts... your application wants access to the mouse? sure, here's a file named "mouse". it's got the coordinates in it. you want to draw to the screen? here's a file called like "bitmap" or whatever, just write to it. you want to start a process on another machine? just cd to it and start the process there. want to have the UI show up on your machine? symlink your bitmap file to that directory.

I also wish early web composability could have stayed and expanded. like, the old vlc embed player, which would just show up in your browser and could play any file inline? great stuff. Imagine if every application composed with everything else, like the android Activity and Intent concepts but for anything, just by virtue of living in the same os. need an image? just ask the os and it will present the user with many ways to procure an image, let the selected one run , and hand you back an image. you don't even have to care where from. in a way, it's what the arcan guy is doing with his experiments, although that's more for stitching together graphical pipelines.

load more comments (3 replies)
[–] [email protected] 8 points 2 months ago (4 children)

Problem Details for HTTP APIs - I have to work and integrate with a lot of different APIs and different kinda implementations of error handling. Everyone seems to be inventing their own flavor of returning errors.

My life would be so much easier if everyone just used some 'global unified' way to returning errors, all in the same way

[–] [email protected] 7 points 2 months ago (4 children)

Please guys, stop using line-breaks mid-sentence. It's not the 90's anymore, viewers generally can wrap.

load more comments (4 replies)
load more comments (3 replies)
[–] [email protected] 8 points 2 months ago (2 children)

About s-expressions, what i read about it: https://web.archive.org/web/20120206034439/https://shinkirou.org/blog/2010/06/s-expressions-the-fat-free-alternative-to-json/

Seems rather niche, for non-key-value-pair data structures (aren't no-sql databases good for that?), considering that lightweight markup fulfills that role for readable document source.

load more comments (2 replies)
[–] [email protected] 7 points 2 months ago (7 children)

ISO 216 paper sizes work like this: https://www.printed.com/blog/paper-size-guide/

It's so fucking neat and intuitive! How is it not used more???

[–] [email protected] 20 points 2 months ago (3 children)

sorry to tell you this bud...

map of which countries use iso 216. guess which one just had to be different

load more comments (3 replies)
load more comments (6 replies)
load more comments
view more: next ›