Other Smarter People

I don't like reinventing the wheel. At the same time, I'll look for something and not find it, go through the effort to create something of my own, only to find out that my search skills weren't high enough and someone has already figured that out.

In a matter of twenty-four hours, I found that two such situations had happened. Which means, I can close the topic on identifiers and simply point to other folk's work and build the little quirk I want on to of those.

Series

Identifiers

Let's start with the last six months (it's been that last since the last of this series… actually, of most of my posts): I actually used my ideas to see if they were viable in practice as they were in my head.

I found that when I elided the identifiers, which means only showing the last group of the identifier along with the prefix, it didn't give the benefit I thought it would. For example, group__01_hz613s22_k8nr6w6g_rv1y5c52 being elided to group__rv1y5c52. When seen on screen, the group__ was still the bulk of the screen estate and the content was sufficient to make it unimportant.

Then while I was working on Leicmin, I stumbled onto a series of Rust libraries that implemented a standard that was almost completely the same as mine, including using Crockford32 encoding: TypeID (or my local tag).

TypeID uses the underscore separator, so double-click and selection works. It defaults to UUIDv7 but can also be used with other UUIDs. It only has one between the prefix and identifier block and no grouping. Which means the above example would be group_01hz613s22k8nr6w6grv1y5c52.

I lose the grouping and there no rules for eliding, but those are easy to handle. Just take the left X characters and not worry about anything else. So, in C#, eliding would simply be identifier.ToString()[^8..] and getting rv1y5c52.

Good enough.

Fortunately, there are a lot of implementations of TypeID. None of them work the way I want them too, or they are quite there, but it's a much better start and works with a standard that someone else has already established.

Package URLs

Speaking of finding standard, when I was giving my thoughts on Bakfu, I was trying to come up with a useful approach for referencing packages across different ecosystems.

While learning about TypeID, I noticed that the crates.io packages has a PURL link on the sidebar. I had never seen that before, but it basically lead me down to learning about a “mostly universal” URL format for packages so… other people were trying to solve the same thing and they had some interest behind their own (as opposed to none behind mine).

Some examples (from the website):

  • pkg:deb/debian/curl@7.50.3-1?arch=i386&distro=jessie
  • pkg:docker/cassandra@sha256:244fd47e07d1004f0aed9c
  • pkg:gem/jruby-launcher@1.1.2?platform=java
  • pkg:golang/google.golang.org/genproto#googleapis/api/annotations
  • pkg:maven/org.apache.xmlgraphics/batik-anim@1.9.1?repository_url=repo.spring.io%2Frelease&packaging=sources
  • pkg:npm/%40angular/animation@12.3.1
  • pkg:nuget/EnterpriseLibrary.Common@6.0.1304
  • pkg:pypi/django@1.11.1
  • pkg:rpm/fedora/curl@7.50.3-1.fc25?arch=i386&distro=fedora-25
  • pkg:rpm/opensuse/curl@7.56.1-1.1?arch=i386&distro=opensuse-tumbleweed

Well, that covers pretty much the same scope I was trying to implement, so another thing I can move to an accepted standard and stop working on my own.

Thoughts

A lot of my personal work is in isolation. I've always struggled to join communities and I have a relatively small “footprint” when it comes to social networks. And, because of my fragmented nature, I'm rarely in touch of people who are in the “know” who can tell me that someone else is already working on, or has solved, a problem I'm working on.

That all said, I'm glad I still went down the rabbit hole of trying to solve it. More so when my solution is only trivially different from the more popular one. It tells me I'm in the right direction.

I also think as a thought exercise, it gives me more appreciation for the work that goes behind these efforts and frequently makes me a fan or even advocate because I'm emotional behind the reasons.

So, time not wasted but also relief that someone else figured it out instead.

Metadata

Categories:

Tags: