Live data from Hacker News

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

english.stackexchange.com

151–160 of 325 posts

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

#151
post #139
post #90

I don't think this is a naming issue at all. In the provided example, 'Accuracy' is the correct name for the parameter, as that's what the parameter represents, accuracy. The fact that accuracy should be given as a value in an interval from 0 to 1 should be a property of parameter type . In other words, the parameter should not be a float, but a more constrained type that allows floats only in [0,1]. EDIT: Some of yo…

Great that you like typed languages, and ones that allow for such constrained/dependent typing as well. It seems disingenuous to me to suggest that anyone using other languages do not have this problem. And really, there are quite a few languages to not have this form of typing, and even some reasons for a language to not want this form of typing. So please, don't answer a question by saying "your questions is wrong"…

"your question is wrong" is indeed unhelpful, especially as a direct response to someone asking a question.

"here is what seems like a better question" is helpful, especially in a discussion forum separate from the original Q/A.

But if "here is what seems like a better question" is the _only_ response or drowns out direct responses, then thats still frustrating.

> condescending

As a man who sometimes lacks knowledge about things, when I ask a question, please please please err on the side of condescending to me rather than staying silent. (No, I don't know how you should remember my preferences separately from the preferences of any other human)

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

#152
post #121
post #90

I don't think this is a naming issue at all. In the provided example, 'Accuracy' is the correct name for the parameter, as that's what the parameter represents, accuracy. The fact that accuracy should be given as a value in an interval from 0 to 1 should be a property of parameter type . In other words, the parameter should not be a float, but a more constrained type that allows floats only in [0,1]. EDIT: Some of yo…

While true, if your language doesn’t support such a type, then the burden for such a name goes to the parameter, does it not?

Joel, on the original purpose of Hungarian notation:

https://www.joelonsoftware.com/2005/05/11/making-wrong-code-...

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

#153
post #69

Related question: what would be the best way to store such a value? A float would only use the mantissa-bits, so it would be rather inefficient. Perhaps as a uint16 with a representation of uint16 / (2^16)?

It depends on how you intend to use it. For example, in digital signal processing (audio), most processing is done using uint32 values. It would make no sense to receive the value as a float, only to convert it back to int before using it.

Case in point: most software volume controls allow to specify the output volume (or rather, control the attenuation) using the full uint16 range. In this case, the entire volume range is expressed from 0x0000 to 0xFFFF. But in practice, this is just an amplification (multiplier) value between 0 and 1.

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

#154
post #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, conta…

> boxes, pallets, containers and vessels

Woo, that's a tough one. Even as a native speaker, I'd be hard-pressed to find one word in English that describes all these similar but different terms.

I looked up some of these in a dictionary for definitions and synonyms. OK, the word "holder" seems to be the most general term that includes all these types of objects.

So I'd name it "holder_events_table", with a column "holder_type" being box, pallet, etc.

This issue of finding precise naming is related to "ontologies", how to establish an organization of agreed-upon terms to classify objects in the world. I agree with you, it would be valuable if there was a community-developed reference where we could search for the most appropriate names of things.

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

#155
post #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, conta…

If you aren't leaning on the English Language at large, then you should ask the community of people who will use your software. Who are your stakeholders?

If you don't have a relationship with your stakeholders because your company has paid lots of money to become Agile[1][2], then you are indeed in trouble.

[1] https://www.youtube.com/watch?v=a-BOSpxYJ9M

[2] https://www.fgcquaker.org/resources/form-without-substance

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

#156

Earlier quoted context omitted.

what if you have to deal with two persons?

In that case you could have the signature func call(person#1 person#2){}

Wouldn't it be better if we could give meaningful names instead of 1 and 2?

    function call(person#sender person#receiver)
And at that point we're back to the square one, just remove the # :)

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

#158
post #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, conta…

> boxes, pallets, containers and vessels

So you keep info about these separately already or in some common table with discriminator? Then maybe:

boxes -> box_events, containers -> container_events,...

Or:

units(type:{box, container,...}) -> unit_events

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

#159
post #139
post #90

I don't think this is a naming issue at all. In the provided example, 'Accuracy' is the correct name for the parameter, as that's what the parameter represents, accuracy. The fact that accuracy should be given as a value in an interval from 0 to 1 should be a property of parameter type . In other words, the parameter should not be a float, but a more constrained type that allows floats only in [0,1]. EDIT: Some of yo…

Great that you like typed languages, and ones that allow for such constrained/dependent typing as well. It seems disingenuous to me to suggest that anyone using other languages do not have this problem. And really, there are quite a few languages to not have this form of typing, and even some reasons for a language to not want this form of typing. So please, don't answer a question by saying "your questions is wrong"…

I'm genuinely sorry if I came across as condescending, that was not my intention at all.

I merely wanted to point out that, in my opinion, this property should be reflected in parameter type, rather than the name. Just like, if we wanted a parameter that should only be a whole number, we wouldn't declare it as a float and name it "MyVariableInteger" and hope that the callers would only send integers.

You mentioned that there are quite a few languages that do not permit what I proposed, would you mind specifying which ones exactly? The only one that comes to my mind is assembly?

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

#160
post #141

Earlier quoted context omitted.

It makes most sense in formulas: Instead of x=(foo/100) * (bar/100) * baz you can do x=foo * bar * baz. Which is rather more readable! Probabilities in statistics are also expressed in this manner. Meanwhile I found out that the Dutch dictionary actually has Perunage for this usage, especially in finance. So maybe that's he term I'll start using?

Looked it up, and a 'perunage' is defined as 'a percentage divided by a hundred'.

Which is indeed technically correct, and even an easy way to explain it the first time.

Of course this rather undersells the elegance and simplicity of perunages, but I'll take it.

Post reply on HN