News for hackers. Stuff that matters.
Re:Git Notes: Git's Coolest, Most Unloved­ Feature by luispauloml on Monday November 28, 2022 @12:38AM (#33770165)
I have a question totally unrelated to the post, but that I finally decided to ask because of it.

In the tweet by Simon Willson at the top of the blog post, he uses the word "against":

  Started experimenting with "git notes" against a new repo [...]
English is not my native tongue, but I always take the use of this preposition as if to state an adversarial relationship between two things, a relationship of opposition between them. Therefore, sometimes I find it odd the way it is used in programming-related context. A few examples of what I mean:

  - "to program against a standard" instead of "to program based on a standard"
  - "to match against a pattern" instead of "to match the pattern onto the thing"
  - "to compare against a list" instead of "to compare with items from a list"
  - "to file an issue against the repository" instead of "file an issue at the repository"
It is possible (and very likely) that my proposed meanings are grammatically or even semantically wrong, but I feel that "against" is being correctly used in these examples because I can see a slight opposition between the two things in them, and I can understand that some people might even find an adversarial relationship there. However, in the specific case of Simon Willson's tweet, the use of "against" sounds even more off because I fail to see a repository and Git notes as being adversaries or opposite to each other. So the question is: is only me, as non-native speaker, that finds this usage (not only Willson's, but the examples too) a bit weird, or do native speaker also have similar sentiments?
Re:Git Notes: Git's Coolest, Most Unloved­ Feature by Someone on Monday November 28, 2022 @12:59AM (#33770257)
Not a native speaker, but “Against” has many meanings, not all implying adversity/competition. https://www.merriam-webster.com/dictionary/against mentions, for example, “compared or contrasted with”, which covers the search and compare examples you gave.
Re:Git Notes: Git's Coolest, Most Unloved­ Feature by adamweaver on Monday November 28, 2022 @01:16AM (#33770337)
Against has a rare meaning of “adjacency”. We say that we lean something against another, for example. English is weird.
Re:Git Notes: Git's Coolest, Most Unloved­ Feature by bacon_waffle on Monday November 28, 2022 @01:16AM (#33770340)
I'm a native English speaker and agree that it is a slightly weird corner of the language - thanks for asking!

"Against" can also mean something like "adjacent to" or "in contact with", like "let's put the chair against this wall".

Re:Git Notes: Git's Coolest, Most Unloved­ Feature by luispauloml on Monday November 28, 2022 @02:04AM (#33770556)
Thank you for answering. Also, I did check the dictionary before asked. As others comments pointed out, it does have a meaning of adjacency or contrast, and I guessed that this is where this usage was coming from. But still, even with this meaning, I feel a bit of an adversarial meaning. "Contrast" itself is adversarial, right? Because it comes from comparison. For instance, in "the chair against the wall", I can see the chair exerting force against the all, and the wall reacting to it with equal intensity and opposite direction (Newton's Third Law). Yet, in Willson's tweet, I can't imagine anything like that coming off of a git repository and git notes, hence my comment.

As an addendum, my first language is Portuguese, and a direct translation for this word is "contra"¹ which fits all the meanings for "against" listed in Merriam-Webster, except the adjacency one. I've never seen "contra" being used for this meaning in the wild, and I guess this is the reason I feel a bit off about it and never used it myself for that meaning when communicating in English.

¹ https://dicionario.priberam.org/contra

Re:Git Notes: Git's Coolest, Most Unloved­ Feature by jhrmnn on Monday November 28, 2022 @03:18AM (#33771036)
The same with Czech (and I assume all Slavic languages?). Would be interesting to track the etymological development of this meaning.
Re:Git Notes: Git's Coolest, Most Unloved­ Feature by martopix on Monday November 28, 2022 @04:37AM (#33771512)
I didn't understand if in the end you can say "contra o muro" in portuguese (about the chair). In Italian, you can.
Re:Git Notes: Git's Coolest, Most Unloved­ Feature by brunno on Monday November 28, 2022 @10:01AM (#33774438)
You can say that in portuguese, it's completely correct but it seems to be much less used than "junto ao muro" as in "next to the wall/adjacent to the wall". Even being correct in this use, "contra" is a word very charged with adversarial context. Maybe that's the source of the strangeness the thread OP feels about the use of "against".
Re:Git Notes: Git's Coolest, Most Unloved­ Feature by prolyxis on Monday November 28, 2022 @05:14AM (#33771782)
The physical act of comparing two objects or testing one object against another would typically involve some physical contact or proximity, so even in the case of testing some code on something, it is natural in English to by analogy use the word "against." But I think you are right in this case that "against" has significant adversarial meaning in the act of testing something: often, one introduces stress scenarios or edge cases that could cause some software to fail. Tests are in large part adversarial to the object under test.
Re:Git Notes: Git's Coolest, Most Unloved­ Feature by jhoechtl on Monday November 28, 2022 @02:39AM (#33770767)
I can confirm that in your example the German "Stell die Sessel gegen die Wand" would be valid too and well understood, yet with a slight touch of colloquialism and old-fashioned phrasing.
Re:Git Notes: Git's Coolest, Most Unloved­ Feature by agumonkey on Monday November 28, 2022 @02:59AM (#33770912)
Interesting how the notion of symmetric contact can be seen as a positive or negative relationship.
Re:Git Notes: Git's Coolest, Most Unloved­ Feature by garettmd on Tuesday November 29, 2022 @09:54AM (#33788314)
But I think a distinction between "against" and "next to" is that generally speaking, "against" implies a closer contact than just being "next to" or "adjacent to" something. Like in the chair example, "against the wall" would mean pushing the chair up as close to the wall as you can make it, whereas "next to the wall" would mean putting it close to it, but not necessarily touching it. If it was a folding chair and someone told me to put it "against the wall" I would take that to mean "fold it up and prop it up on the wall".
Re:Git Notes: Git's Coolest, Most Unloved­ Feature by juped on Monday November 28, 2022 @05:27AM (#33771857)
Your examples:

> - "to program against a standard" instead of "to program based on a standard"

both idiomatically correct enough

> - "to match against a pattern" instead of "to match the pattern onto the thing"

the second one reads very strangely and I would not be sure what you meant, first is _very_ idiomatically correct

> - "to compare against a list" instead of "to compare with items from a list"

second one is a little strange in the sense of feeling like too many words

> - "to file an issue against the repository" instead of "file an issue at the repository"

second one feels wrong, first is correct but a little weird, "on" is probably what I would write; you can also file "with" if it is a bureaucracy, you file tax forms "with" the irs

Re:Git Notes: Git's Coolest, Most Unloved­ Feature by Aeolun on Monday November 28, 2022 @05:41AM (#33771952)
I think the usage of against in that way is normally correct, but:

> starting to experiment with x against a new repo

Is still weird. It’s not incorrect, but it feels like the author should have used ‘in’ here.

Re:Git Notes: Git's Coolest, Most Unloved­ Feature by andyferris on Monday November 28, 2022 @05:41AM (#33771953)
When it's used to describe a process it can be a physical kind of analogy:

- "to push your hand against a wall" - "to press a grinder against some metal" - "to push a mold against the clay"

There's a Newton's third law kind-of thing going on, where two things push against each other, and affect each other.

For "to program against a standard" I am imagining some malleable computer code being pushed against an unyielding form or mold until it conforms to the intended shape (i.e. standard). A similar deal as TDD (test-driven development).

It seems to me that the second and third examples are forms of "compare with and contrast against" the latter being the "relationship of opposition" you mention.

Thinking aloud, "to file an issue against a repository" grammatically resembles "to file a lawsuit against a person" and is similar in that you are registering a complaint against some problem.