Live data from Hacker News

A word for a value between 0 and 1 (inclusive)

english.stackexchange.com

41–50 of 325 posts

Re: A word for a value between 0 and 1 (inclusive)

#41
post #34
post #31

Earlier quoted context omitted.

Unit interval is the interval between 0 and 1. We need a word for a value within that interval.

Then "unitIntervalValue"

Right. That's the thing we need a word for :)

Unit Interval Value is nice but still a bit cumbersome. I mean if we all agreed right now it were called a "poog" then we could just say poog.

Re: A word for a value between 0 and 1 (inclusive)

#43
post #39
post #8

I would actually call this a bit of an antipattern. `accuracy` seems fine to me -- although a more descriptive function name than `FuncName` might suggest a better parameter name as well. Digging through the dictionary to find the perfect word means that whoever reads this code is likely going to have to do the same -- why would you ask them to do that? If you aren't referring to a common mathematical or physical con…

You're not wrong but it would be nice to have a word for this incredibly common type of value still.

As a mathematician, I heartily agree.

Re: A word for a value between 0 and 1 (inclusive)

#44
Does anyone know of a good site for these kind of questions other than the English stack exchange.

I frequently run into programming related naming issues (who doesn't eh?). But I struggle to find accurate search terms to help answer them...and the results are usually downed out by non-technical related language Q&A's

E.g. I was trying to name a table yesterday that would store events related to boxes, pallets, containers and vessels and was looking for a generic name to group them, e.g. goods_events, entity_events, object_events, domain_object_events etc. but I had no idea how to phrase my question and not get a bunch of junk back

Would be awesome if you could tweak some suggestion algo to be trained on repo's specific to your domain and have it spit out suggestions based on human language questions, e.g. gpt3 but focussed on some domain.

Re: A word for a value between 0 and 1 (inclusive)

#46
post #41
post #34

Earlier quoted context omitted.

Then "unitIntervalValue"

Right. That's the thing we need a word for :) Unit Interval Value is nice but still a bit cumbersome. I mean if we all agreed right now it were called a "poog" then we could just say poog.

UnitInterval is the type. The name of the value should reflect its specific use.

Re: A word for a value between 0 and 1 (inclusive)

#47
post #14

The real answer to this XY is comments and documentation, imo. If you want to make it obvious without reading docs or code, get an IDE with doxygen-aware completion. Edit: also, put it into typename, not into argname.

From a practical point of view, a new/academic word would still require serp lookup in most cases. If it were in a type, like float01, one could easily jump to the function definition and then to the type definition, described by a comment. In the case of argument naming, there is no place to jump to, only googling remains.

Re: A word for a value between 0 and 1 (inclusive)

#48
post #8

I would actually call this a bit of an antipattern. `accuracy` seems fine to me -- although a more descriptive function name than `FuncName` might suggest a better parameter name as well. Digging through the dictionary to find the perfect word means that whoever reads this code is likely going to have to do the same -- why would you ask them to do that? If you aren't referring to a common mathematical or physical con…

I couldn't agree more.

If you can't express it using the features of the language itself (custom domain-specific type, compile contracts?), limit yourself to putting this info into the docs, but keep naming simple.

Don't come up with fancy names. One of the commenters already declared (jokingly??) they'd "call it PropUnity, for proportion of unity, unity being 1".

Holy smokes Batman. As a code maintainer, I imagine encountering "accuracy" (even though it isn't fully accurately named itself) would confuse me somewhat less than "propUnity".

Re: A word for a value between 0 and 1 (inclusive)

#50

Earlier quoted context omitted.

Right but it’s specifically not, and liable to make people think “3” is an acceptable input

Again, this is bike shedding bait. I'm going by my own experience with basic mathematics in my American education where "percent" is something you multiply a number by, and usually ranges from 0 to 1. Ex. 50% of 12 marbles is 6 (*.5, 50%). But just looking at all the different answers in the comments here means there's no consensus on a "right" way. Hence bike shedding. A decent code base should be consistent so it c…

fwiw, this post was inspired by a twitter thread i created yesterday (https://twitter.com/v21/status/1301451641699340288), where i collected examples of people getting annoyed that this term doesn't exist... and most of those were inspired by frustration at this being called a percentage when it wasn't. so if you want a nice collection of people stubbing their toe on the word percentage, it's out there.
Post reply on HN