What Is a Property?

(alperenkeles.com)

45 points | by alpaylan 4 days ago

4 comments

  • happytoexplain 3 hours ago
    Maybe I have a bit of a brain problem, but for me, 90% of the effort that goes into learning anything in tech is spent on identifying which nouns are Nouns, and which are just nouns, and the (often mushy) semantics of how people use those nouns in varying contexts and sub-contexts. I understand the reasons for this complexity - domain-specific terminology is valuable and forms naturally from pre-existing words. It's just that, in tech, everything is abstract, and everything consists of multiple contexts spread across multiple dimensions (vertically, in abstraction layers; horizontally, in use cases), so the domain-specific terminology explodes like an exponential web. Sometimes I'm talking to somebody and they are using some word, and it takes me days to even realize that they are using it in a much more specific context than I assumed. It's a little hellish.
    • alemwjsl 56 minutes ago
      "Property" here comes from mathematics (and I guess similar definition to science). What are the properties of this function? E.g. x * y has the property that x * y = y * x.

      So we do import stuff from Mathematics alot.

      I think we need better tutorials. It is a hard problem. How to teach something, who is your audience. For an AI tutorial, do I need to explain what inference is? Maybe. If I don't and they don't know it is another weird word.

      In terms of brain problem - I have the same thing. It is worse inside the corporate barrier as there is no internet documentation on what the terms mean. I think all we can do is slow down and write cheat sheets until we remember.

    • analog31 2 hours ago
      I'm reminded of the story of Richard Feynman and the names of birds:

      https://philosophy.stackexchange.com/questions/85809/feynman...

    • alpaylan 2 hours ago
      I agree. It’s especially weird moving across related domains because suddenly something you think you know has changed meaning. For instance eBPF is “verified”, but the verification is almost completely unrelated from the usual connotations.
    • gerdesj 1 hour ago
      "which nouns are Nouns, and which are just nouns"

      English (int al) distinguishes "proper" nouns as a subset of nouns. A proper noun is a name and is capitalized. Hence you might write: King Charles is a king. Now, you also capitalize the first word of a sentence but here King is not the first word of a sentence - King Charles is a name. If you make a small change (indefinite to definite article), you get: King Charles is the King. The second king becomes a moniker and no longer just a description.

      English also tends to get capitalization-loopy as soon as religion rocks up (any religion).

      You can obviously ignore all that bollocks and write whatever you like, mostly without blushing!

      Some other related languages eg German, capitalize all nouns.

      • blanched 1 hour ago
        Maybe this is a joke about the dangers of being abstract going over my head, but I don’t think they literally meant they don’t understand capitalization rules :)
      • happytoexplain 42 minutes ago
        I was being humorous/pithy. I meant e.g. the difference between "property" (the dictionary word) and "property" (the programming word, which is a domain-specific usage of the dictionary word) and "property" (as in Property-Based Testing, an even more domain-specific usage). It's analogous to the concept of regular nouns vs proper nouns, but not the same (which is why I didn't use the term "proper noun").
    • troupo 3 hours ago
      It doesn't help that many texts approach this as a very pseudo-mathematics abstract. It's not a function, it's an implication. It's there are satisfactions of preconditions, there's a thousand different things.

      Unfortunately, very few texts and tutorials on property-based testing actually tell you how to see what properties are. I have it on paper somewhere in some workshop materials. But online I think this is one of the very few that describe what they are: https://fsharpforfunandprofit.com/posts/property-based-testi...

      • skybrian 1 hour ago
        Good link. I think that explanation works because it's somewhat closer to providing concrete examples of the kinds of tests you can write.
    • wizardforhire 2 hours ago
      This is literally the difficulties with learning any discipline!
    • AlienRobot 2 hours ago
      The worst thing is being corrected about minutiae. It's not a "property" it's an attribute/field/member/key/column/variable/getter/function/procedure. Deep down it's all variables. Even the constants are variables from the viewpoint of the CPU that has to load it in its registers.

      Sometimes I see people saying "in LANG, obj.foo is just 'syntax sugar' for foo(obj)" and I think that technically it has always been "syntax sugar" and there have always been ways to call any "method" with any "object" of any "type."

      Sometime along the way we decided that "syntax sugar" means "it means the same thing as" but except for (<cast OtherType>obj).foo(), which means that the semantics of "syntax sugar" don't mean it's simpler than the phrase it was supposed to replace.

      • DonaldPShimoda 1 hour ago
        > It's not a "property" it's an attribute/field/member/key/column/variable/getter/function/procedure.

        For what it's worth, to a researcher in the field of programming languages (like the author of the post), these all have distinct unambiguous meanings. At least as far as PL goes, almost every term has a well-defined meaning, but as those terms were adopted into less-than-academic contexts, the meanings have diluted.

        "Property" is such a term in the context of programming languages research, and, in particular, it is a very specifically defined term in the realm of property-based testing (no surprise).

        > Even the constants are variables from the viewpoint of the CPU that has to load it in its registers.

        No; this is not what "variable" means. Registers are properties of the processor, i.e., they are implementation details; variables are an abstract concept from the domain of the formal language specification.

        > Sometime along the way we decided that "syntax sugar" means "it means the same thing as" but except for (<cast OtherType>obj).foo(), which means that the semantics of "syntax sugar" don't mean it's simpler than the phrase it was supposed to replace.

        No; this is not what "syntax sugar" means. If a language defines some syntax f and it "expands to" some other syntax g, then f is syntax sugar for g. This is well defined in Felleisen's "On the Expressive Power of Programming Languages" [0]. For example, Python's addition operator `+` is implemented in terms of a method `__add__`; therefore, `a + b` is syntax sugar for `a.__add__(b)`, because the former syntax is built on top of the latter.

        Notably, syntax sugar has nothing to do with casts; casts are semantic, not syntactic. There are also no promises about whether syntax sugar makes something "easier"; it's simply the ability to syntactically express something in multiple ways.

        [0] direct PDF: https://www2.ccs.neu.edu/racket/pubs/scp91-felleisen.pdf

  • skybrian 41 minutes ago
    The property being tested in this example is “after inserting a row into a database table, the same row can be read back again.”

    The insert statement isn’t independent of the database because the table needs to exist and its schema has to allow the inserted values. If the database is generated randomly, you need access to it to generate an insert statement that will work.

    This is straightforward to do if the library is designed for it. Using my own TypeScript library [1]:

    const insertCaseArb: Arbitrary<InsertCase> = arb.from((pick) => {

      const db = pick(dbArb);
      const table = pick(arb.of(...db.tables));
      const values = pick(rowArbForTable(table));
    
      return {
        db,
        tableName: table.name,
        insert: {
          kind: "insert",
          table: table.name,
          values,
        },
      };
     });
    
    Why might that be difficult? Some property testing libraries don’t let you call a pick function directly.

    [1] https://jsr.io/@skybrian/repeat-test

  • cristoperb 1 hour ago
    I missed the "a" in the title and expected something about Proudhon
  • tug2024 2 hours ago
    [dead]