Jump to content

Talk:Clamp (function)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

bp 07:20, 20 May 2020 (UTC)

Untitled

[edit]

Are six implementations on top of pseudo-code necessary for such a simple function? SchighSchagh (talk) 20:44, 1 October 2011 (UTC)[reply]

Well, there wasn't an 8051 assembler example ... Deleted all but the pseudo-code. Any programmer who can't figure out how to implement the pseudo-code in his/her preferred language shouldn't be programming.
Trappist the monk (talk) 22:21, 4 July 2012 (UTC)[reply]

Name of article

[edit]

Shouldn't this be Clamping (Programming) or something like that? clamp functions certainly aren't restricted to graphics-related use, and most of this article is nothing to do with graphics. 212.44.29.52 (talk) 11:10, 28 March 2012 (UTC)[reply]

Name of article 2

[edit]

I'd go with "Clamping (function misnomers)" or put it under a "List of misused English words".

What's wrong with it ? Well...

1.There is one solitary example given of it's use for the code/functionality specified. This does not qualify it as an industry or subject term, particularly when it is a misnomer. Essentially, one individual working on one (albeit significant) library made a mistake/had an off day and now the entire world is expected to assign a confusing, misleading meaning to an otherwise perfectly good word.

2.The code is so trivial as to not warrant a term.

3.For a function "restricting" a value to a range (which is what the listed code does), "limit","restrict","confine","regulate","constrain","govern" and "restrain" would all be reasonable and intuitive choices. I'm sure there are more. "Clamp" is a very bad choice: it not only does not describe what the function does, it describes something the function does not do (special case excepted).

From a judgement by the U.S. Court of Appeals for the Fifth Circuit (on another topic...obviously): "for a language to remain viable, words must have readily discernible meanings." and here the article's author is trying to assign a meaning at odds with the generally accepted meaning i.e. they are trying to have it relate to a "range" when it properly relates to a fixed point.

The only case for keeping it as a wikipaedia entry at all is to record that the usage suggested is a consequence of a poor choice, currently restricted to one specific area of computing and should not be encouraged to spread further bp 06:35, 20 May 2020 (UTC). To admit it as a legitimate term will encourage its use when it would be better that the library's authors/maintainers recognise their mistake, deprecate the function and refactor with one of the alternative names given above.

Bobpower67 (talk) 06:25, 20 May 2020 (UTC)[reply]

While I agree with a lot of what you said, it's still important to realize that people use Wikipedia to find information. If the name is changed to something else, it might not show in search engines when people look it (clamping) up. Fact of the matter is that the word clamp is so ingrained amongst programmers and space as a whole, that resisting this usage is futile. Example: the W3 Consortium added the clamp() function to CSS. The MDN article is now the first thing that shows up for me.
I think you could add a note to explain how the name is actually a misnomer. But keep in mind that language is an ever changing thing; it constantly evolves, even in ways that might not necessarily make the most sense, etymologically speaking. J. Geerink (talk) 21:37, 24 December 2024 (UTC)[reply]
After editing the last couple of lines of your comment (removed the autosigned SineBot stuff) and making sure all the brackets and whatnot are all the same as those of the other comments, the reply button reappeared :) J. Geerink (talk) 22:05, 24 December 2024 (UTC)[reply]