3 ms·
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 LetWorkGl
by sd9 2y ago
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.
- mrunkel 2y agoI 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.
- sd9 2y agoThat seems reasonable. I understand Worker and Worklet are established concepts in the domain, though, so better to use those names than invent new terminology.
- Neywiny 2y agoI think subconsciously I look to the end to find differences too. So maybe I'd prefer er/let to come last
- macintux 2y agoWhen 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.
- dylan604 2y agoI'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
- physicles 2y agoI feel like if you have to display UUIDs in your app’s UI, you’ve already lost. Copy to clipboard should hopefully be enough.
- dylan604 2y agoIt 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.
- matrss 2y ago> 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...
- mirekrusin 2y ago„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.
- n_plus_1_acc 2y agoWhen Java introduced List.of(1, 2, 3), I was sceptical but now I like it
- dotancohen 2y agoIt 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.
- Quothling 2y ago> 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.
- kevindamm 2y agoDepending 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.
- xboxnolifes 2y agoOn 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.