Assigning numbers get you around the problem of naming things.

Reply to this note

Please Login to reply.

Discussion

β€œThere are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors.”

Leon Bambrick πŸ˜€

Yes but numbers also minimalize human errors. Typos, big/small letters etc.

We're putting these IDs in Json, tho, to make them machine-readable. If we wanted humans to type kinds into notes, we'd have to use yml.

A computer doesn't care if a kind is "68325" or "tweet4". Neither does a developer, as they can just copy-paste.

And the json is full of gobbledygook strings, anyway. No one is typing that stuff in by hand.

And if a human wanted to know what is the kind for "event deletion" you could tell them that it's "delete_event", instead of "Kind 09".

Kind 5

But still, it's harder to ensure devs all call it delete_event and not deleteEvent or delete_evnt or Delete-event, be it on purpose or by accident. Kind numbers help ensuring that. But yeah, it's not the most human friendly in terms of readability.

πŸ˜‚πŸ€¦β€β™€οΈ dammit

Kind 05 in NIP 09. πŸ˜‚ OMG it's so confusing.

I am not a programmer, but when I needed to code something back in the days, we just used ctrl-n (iirc) in vim to recall already written variable names. So I ended up using always the same name, once it was defined.

I think every IDE has some similar auto-complemtation nowadays?

x1 to xn in code just looks like straight out of the dis-assembler if you ask me.

What I mean is that different Devs might use different names, not necessarily the same one.

Are there not headers or libraries for everyone to include?

Maybe a stupid question, it's really a looong time ago I was doing such things.

People use different sdks or no sdks. Nostr is just a protocol, it's not one implementation everyone uses.

If they dont work togheter on the same project/code, variable names can be different, i don't see the problem then of a missing underscore and so on?

If you send notes around that should be compatible with everything it would indeed be a problem

Hard way of sharing though.

The two hard things in computer science are cache invalidation, naming things and off-by-one errors.

func1, func2, func3

I literally am tearing my hair out on some math formulations some students I'm on a project with sent me, where they named all of the different variables x1 x2 x3... all the way up to x8, despite there being three different variable types.

that made sense back in the days of 16kb basic interpreters lol

Hand-written linear programs solved with Gaussian method over 4 pages and when you're finally done, it's like, What variables are these?

i have no idea what gaussian method is, the dude's most famous for magnetism and blur functions

And normalisation of curves and solving groups of linear equations.

oh, normalization... like derivatives...

well, i never did study the math that hard, i just study it when my task requires it

I actually like math. Sort of.

Starting to get mathed-out, tho.

i like it too but i am more interested in applied math, aka "computation"

so i don't study the math unless it does something

Gotta math-stretch sometimes

Letters are just numbers to computers anyway

Yeah char

good names is a key idiom in #golang and the modules structuring helps you do it but some people just keep using generic words for packages and you run into collisions in single packages more often than it really should be (generic short names should be dedicated to working variables)

No one wants to name things and then I can't read the program.

one of my favourite things is coming up with better names for things... it might be a hold-over from my time as an aspiring graphic designer

also i hate how mathematics notation uses letters, and even worse, greek letters, and sometimes muddles up the semantics, like, gamma should mean "a range" and delta should mean "a change" but that's not always quite how it comes out

Ugh, I'm all mathed-out. Graphing Simplex algorithms all day. Can reformulate and draw them in my sleep.

yeah, i'm a bit feeling that right now, just want to blather and probably play some Dying Light for a bit and then pass out

I'm half-watching a standup comedy show in TV.

I use "filemtime" as a version for all my scripts and styles, making that GET parameters on the URL. Always grabs the new version when it's published. Now, to get the CDN to fetch new versions...