7 ms·
While I agree the ensuing argument was excessive, I'll provide a defense of the "botched" definition. The top definition for "predicate", that most people are
by XaspR8d 10y ago
While I agree the ensuing argument was excessive, I'll provide a defense of the "botched" definition.
The top definition for "predicate", that most people are familiar with, and that was omitted from the dictionary quote, is:
> 1. (grammar) The part of the sentence (or clause) which states something about the subject or the object of the sentence.
And in that context, it was a perfectly valid use of predicate, effectively synonymous with "unary function".
Sure, someone could & should have pointed out that the term was confusing because it has a more specific meaning in a computer science context, but all of the responses were simply "you're wrong" and creating in-group/out-group boundaries[1] rather than trying to understand the communication mismatch.
[1] It's usually a bad sign when someone comes in and says "serious programmers should know [...]". :P
- dllthomas 10y agoshrug That's not crazy. My concern was not the particular question, but the tremendous mischaracterisation of the entire linked discussion.
- ssalazar 10y agoI am making serious mental contortions to try to figure out how a grammatical term about the structure of sentences can be synonymous with a unary function and I just can't do it. It seems pretty clear that the instance of the word that inspired that discussion took the computer science definition and mistakenly expanded its definition.
- XaspR8d 10y agoPerhaps I was particularly sensitive to it because it matched my internal models. Here's the way I break it down: In classical/antiquated grammar, most sentences can be divided into a subject and a predicate. The predicate indicates what the subject does/is. While there are issues with agreement and semantics, on a broad syntactic level, the subject is arbitrary and can be replaced with another valid subject: The angry dog // jumped over the fence. My grandmother // jumped over the fence. Twelve apples // jumped over the fence. Since the predicate encodes the action, to me it makes sense to think of this relationship as a predicate function taking a subject argument. Even if the subject is plural or conceptual it is still just a single subject object, hence unary. Then, in the OP's js context of Object.map we have a situation like this: import map from 'just-map-object'; function jumpedOverTheFence(subj) { \\ impl }; var things = ['The angry dog', 'My grandmother', 'Twelve apples']; map(things, jumpedOverTheFence); Obviously I'm doing some weird things for brevity like conflating strings and objects there, but hopefully gets the point across. IMO the analogy actually extends fairly well too. Agreement is a good match for typing (A singular typed predicate "walks" can't take a plural typed subject "Some dogs" => "Some dogs walks" fails at the syntax level), and semantics match internal expectations of functions (The "12 apples jumped..." breaks internal, but untyped expectation that the subject would have agency or control over its actions, like a "chooseTo" method or a "consciousness" property.)