Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The changing bit is at the beginning, unless I misunderstand you.

Worker and Worklet are primitives, you can't really split them up. You can't have a LetWorkGlobalScope and an ErWorkGlobalScope, so WorkerGlobalScope and WorkletGlobalScope is the best you can do.

That said, I usually prefer the changing bit at the end. So something like GlobalScopeForWorker, GlobalScopeForWorklet. But then that's clunky, so we're back at WorkerGlobalScope and WorkletGlobalScope again.



> That said, I usually prefer the changing bit at the end. So something like GlobalScopeForWorker, GlobalScopeForWorklet. But then that's clunky, so we're back at WorkerGlobalScope and WorkletGlobalScope again.

I wouldn't necessarily call "GlobalScopeForWorker" more clunky than "WorkerGlobalScope", just a bit longer, but also more descriptive.

Using the languages namespacing features might also make it more obvious, e.g. "Worker::GlobalScope" and "Worklet::GlobalScope" or the inverted version "GlobalScope::{Worker,Worklet}".

Looking at it from a functional programming perspective, I also like approaches of the form "GlobalScopeFor({Worker,Worklet})", i.e. a function returning the respective thing.

Naming things is hard, but the possibilities are endless...


„Of” is underused in programming. It’s short, can appear standalone, as prefix, infix and suffix and it’s generic enough that it works in most contexts for types, type functions, functions, constructors, mappings etc.


When Java introduced List.of(1, 2, 3), I was sceptical but now I like it


> That said, I usually prefer the changing bit at the end. So something like GlobalScopeForWorker, GlobalScopeForWorklet. But then that's clunky, so we're back at WorkerGlobalScope and WorkletGlobalScope again.

I've done this and it's always ended up biting me in the ass when I want to auto-complete and have 9 million "GlobalScope..." to chose from. Which is where "Work..." becomes handy.


On the other hand, it can be nice for other types of autocomplete usage. Say I know I'm looking for a GlobalScope, but I just don't know which one. Type "GlobalScope" and you get a nice list of everything prefixed with it. It's nice for things like Error enums, or similar usages. I know I'm looking for an Error, but I'm not sure of all the ones available to me.


Depending on your IDE and/or plugin used for autocomplete, you can usually type "worklet" and the symbols containing that substring will still be included in that list, even if it's at the end.


It seems to me that the problem was naming something Worklet when another thing called Worker already exists. I personally strive for unique class names when possible.

But that decision was made long before OP started contributing to this project.


I think they mean that the change is at the end of the first word in the Variable. i.e, Worker vs. Worklet instead of Worker vs. TinyWorker?

Doesn't make too much sense to me, but I think that's what they are saying.


That seems reasonable. I understand Worker and Worklet are established concepts in the domain, though, so better to use those names than invent new terminology.


I think subconsciously I look to the end to find differences too. So maybe I'd prefer er/let to come last


When I joined my current team, I was surprised when I realized all of my co-workers were using the end of strings to verify their identity, when I was looking at the beginning of them. It was confusing: I'd be reading off random characters, and they'd be reading them aloud at the same time, and we'd all be saying different things.


I've run into this with GUID/UUID strings. Some apps truncate them while appending an ellipses to the end, so that the last bits of characters are not even visible by default. It's a mixed bag to be sure


I feel like if you have to display UUIDs in your app’s UI, you’ve already lost. Copy to clipboard should hopefully be enough.


It doesn't matter when/where the IDs are or how they are to be used. Ever been on a call trying to get someone to look at a specific commit? There are plenty of cases where using some sort of ID is necessary. I think you've chosen the very wrong part of the comment to focus on, like the actual point.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: