logoalt Hacker News

happytoexplainyesterday at 8:58 PM8 repliesview on HN

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.


Replies

alemwjslyesterday at 11:43 PM

"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.

analog31yesterday at 10:31 PM

I'm reminded of the story of Richard Feynman and the names of birds:

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

alpaylanyesterday at 9:48 PM

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.

kccqzytoday at 1:26 AM

Since we are talking about Haskell, its type system can be explored to answer the question of what is considered a Property by the quickcheck library.

The Property type is a datatype for which the definition is private. So we look at functions that creates Property objects. We find

    class Testable prop where
      property :: prop -> Property
This means anything of the class Testable can be turned into a Property. So let's look at what are the instances of this class. We immediately find

    instance Testable Bool
This means any boolean can be turned into a Property. But more interestingly we find

    instance (Arbitrary a, Show a, Testable prop) => Testable (a -> prop) 
This means any function where the argument has a generator and the result can be turned into a Property can itself be turned into a Property. This implies that for example a function of `Int -> Bool` can be turned into a property. And due to currying, `Int -> Int -> Bool` can also be turned into a property.

This basically covers the first half of the article.

We continue to find other functions that returns Property objects. We find

    forAll :: (Show a, Testable prop) => Gen a -> (a -> prop) -> Property
This states that if we have a function where we explicitly provide a generator and it returns anything that can be turned into a Property, it can also be turned into a Property. This is different from the instance above only by providing an explicit generator.

We also find the implication operator:

    (==>) :: Testable prop => Bool -> prop -> Property 
This states that if we have a Bool, and anything that can be turned into a property, we also have a property.

You see, the beauty of Haskell and similar languages is that you don't need to first gain an intuitive understanding of those vocabularies of a library. The library designer has built up an abstraction of those vocabularies and Nouns and the compiler is tasked to enforce it. You can get things wrong, and the compiler just yells at you. Or you can just mechanically find things to fill in the blanks ("hole-driven development") without understanding the vocabularies. It's your choice.

troupoyesterday at 9:09 PM

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...

show 1 reply
AlienRobotyesterday at 10:26 PM

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.

show 1 reply
wizardforhireyesterday at 10:12 PM

This is literally the difficulties with learning any discipline!

show 1 reply
gerdesjyesterday at 11:17 PM

"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.

show 2 replies