Live data from Hacker News

Execution in the Kingdom of Nouns (2006)

steve-yegge.blogspot.de

31–40 of 73 posts

Re: Execution in the Kingdom of Nouns (2006)

#31
I like first class functions. I get hung up on the trash example in this essay though. To show the commonality of verbs in a person's general understanding Yegge says 'get the garbage bag from under the sink'. WTF (Who the fuck) 'gets' the garbage? I do. 'I' is implied. I get the garbage from under the sink. Or perhaps 'Steve' gets the garbage from under the sink. These are nouns (or pronouns, whatever).

If anything, verbs do nothing without a noun to do them, and nouns need verbs to do anything. So perhaps we should just acknowledge the value of traits, objects, and functions and move on. Forgive me (but correct me first) if I have missed something massive here... I'm trying to drink as much as Steve is alleged to while writing this comment.

Re: Execution in the Kingdom of Nouns (2006)

#32
post #11
post #7

The problem with verbs is that they are black boxes. With objects you can subclass and override methods - do stuff like the Universal Design Pattern - basing something on prototypes that you tweak here and there. Functions you can only apply, objects have parts that have names.

This is why the fundamental operation in the land of the verbs is composition: do this then do that. It turns out that composition is such a useful idea that we want more of it, which is where categories, monads and arrows come in. The most obvious type of composition for functions is, well, function composition. In math we define the composition of functions f and g as f(g(x)), usually written as f ∘ g. We can write…

I am happy with you with all that mathy stuff and I agree that it is cool - but it does not address my point which was that functions are black boxes. Once you have 'f' you can compose it whatever you want - but you cannot change its parts - ala universal design pattern (yet another too long Yegge rant: http://steve-yegge.blogspot.com/2008/10/universal-design-pat...).

Sure composing can somehow work for these case, just like a Turing Machine would work, after all it is all equivalent - but we really tend to think about reality in terms of prototypes - a pony is like a horse only small, a goose is like a duck only bigger and white, etc. - this is what makes this inheritance and overriding so convenient. And if you argue that it is not as clean as pure function composition, that it can quickly get into a tangled mass where pure functions are pure and easy to reason about (but it is all equivalent - so you can actually write the same tangled mess code in a pure functional language - by carrying the state around like the burlaks on Volga) - then yeah I agree - engineering is always about trade-offs. I am only trying to explain one of the sides of that trade off.

Re: Execution in the Kingdom of Nouns (2006)

#33

Yeah, but you can always have static methods, which let you call a function without creating an object.

Sure, which you can use the following ways:

* C: function pointer

* Pascal/Delphi: procedural type

* JavaScript: function/expression as r-value (weakly typed)

* C#: delegate

* Java: er, ah, well, I guess you're screwed, as there is no way to pass that function around to other functions. Maybe in Java version N+1! (or Scala or Groovy) -- that is, a static function is even worse than a "virtual" function, since you cannot even pass an object/class/interface as a way to call that function (method).

Re: Execution in the Kingdom of Nouns (2006)

#34
post #15
post #7

The problem with verbs is that they are black boxes. With objects you can subclass and override methods - do stuff like the Universal Design Pattern - basing something on prototypes that you tweak here and there. Functions you can only apply, objects have parts that have names.

You can pass functions as arguments to functions, so verbs, too, can have parts.

That is interesting proposal (together with the higher order functions etc) - the problem I see with that is that normally you have many more methods and fields then you normally pass arguments to functions. Maybe with some aggregating.

Re: Execution in the Kingdom of Nouns (2006)

#35
post #30

It's funny that this is so popular, because I think it is probably the single most counterproductive thing written about software ever. Seriously. As far as I can tell, the only point of speaking about the poor oppressed "verbs" is to screw up the thinking of the reader, making the reader feel sorry for them. It seems to have worked in some cases, but is there some other reason for it? But what really annoys me is th…

The common complaint is that he's ok, but needs an editor. However, he is an awful writer. An honest editor would tell him to give up.

Part of the humor in this post, to those who find it funny, is that it is in fact so painfully long.

... in the same way that Java's OOP "purity" forces things to be too bloody long all too often.

Re: Execution in the Kingdom of Nouns (2006)

#36
post #7

The problem with verbs is that they are black boxes. With objects you can subclass and override methods - do stuff like the Universal Design Pattern - basing something on prototypes that you tweak here and there. Functions you can only apply, objects have parts that have names.

There is a standard technique in functional programming called 'defunctionalization'[1] which replaces functions with a data structure that can be poked or prodded or examined. It's usually implemented as a compilation technique, but can be done manually, as in Olivier Danvy's system for transforming an interpreter for a language into an abstract machine for the same language. What you are doing is, in effect, 'nominalizing' your verbs, to use Yegge's terminology. ([1] also acknowledges that it is inverse to the Church encoding of data structures, which 'verbifies' your nouns.)

[1]: http://www.kennknowles.com/blog/2008/05/24/what-is-defunctio...

Re: Execution in the Kingdom of Nouns (2006)

#37
post #31

I like first class functions. I get hung up on the trash example in this essay though. To show the commonality of verbs in a person's general understanding Yegge says 'get the garbage bag from under the sink'. WTF (Who the fuck) 'gets' the garbage? I do. 'I' is implied. I get the garbage from under the sink. Or perhaps 'Steve' gets the garbage from under the sink. These are nouns (or pronouns, whatever). If anything,…

It is true that there is some being, or noun, that is implicitly taking out the garbage in his example. I think the important thing to note is that we can happily describe the process of taking out the garbage without mentioning who does it.

If we step back and look at it in terms of programming the principle here is that an Object Oriented insistence on defining and instantiating a doer for every action is unnecessary clutter.

When a programming paradigm makes people insist that 'everything is an object' or more alternatively 'static methods are terrible' we have strayed from simply finding ways to directly describe what we want a computer to do. We are instead forced into being object oriented.

The example nursery rhymes are a fantastic example of what this culture leads to. That is my daily life and it can be a horror.

I don't think that Steve Yegge would claim that objects are bad, but it is a very effective parody of modern Java programming (perhaps C++ and others but I don't do any of that).

I feel his essay is an excellent rebuttal to the complaint that a piece of code is 'not very object oriented' in some corners of the programming world objects have become and end in themselves. Steve is humorously pointing out that there are alternatives.

Re: Execution in the Kingdom of Nouns (2006)

#38
post #32
post #11

Earlier quoted context omitted.

This is why the fundamental operation in the land of the verbs is composition: do this then do that. It turns out that composition is such a useful idea that we want more of it, which is where categories, monads and arrows come in. The most obvious type of composition for functions is, well, function composition. In math we define the composition of functions f and g as f(g(x)), usually written as f ∘ g. We can write…

I am happy with you with all that mathy stuff and I agree that it is cool - but it does not address my point which was that functions are black boxes. Once you have 'f' you can compose it whatever you want - but you cannot change its parts - ala universal design pattern (yet another too long Yegge rant: http://steve-yegge.blogspot.com/2008/10/universal-design-pat... ). Sure composing can somehow work for these case,…

Why would you need to change its parts, it can be parameterized over the parts that change, by passing in other functions as arguments. It's also cheap conceptually and syntactically to create new ones, if an existing one doesn't fit the bill.

Re: Execution in the Kingdom of Nouns (2006)

#39
post #34
post #15

Earlier quoted context omitted.

You can pass functions as arguments to functions, so verbs, too, can have parts.

That is interesting proposal (together with the higher order functions etc) - the problem I see with that is that normally you have many more methods and fields then you normally pass arguments to functions. Maybe with some aggregating.

And I think it's one of the problems with OOP - it's too easy to create class that have 20 methods and 10 parameters, and too hard to refactor it into smaller classes once you have it in such state. You start with simple - domain related classes that have a few methods and related state. Then real life happens and you end up with such monstrocities.

It's much less convenient to work with function that takes 30 arguments, so nobody write such functions - you just divide it into smaller parts. And it's much easier to refactor when most of the code don't need to deal with internal state, and when you can use closures.

Re: Execution in the Kingdom of Nouns (2006)

#40
post #31

I like first class functions. I get hung up on the trash example in this essay though. To show the commonality of verbs in a person's general understanding Yegge says 'get the garbage bag from under the sink'. WTF (Who the fuck) 'gets' the garbage? I do. 'I' is implied. I get the garbage from under the sink. Or perhaps 'Steve' gets the garbage from under the sink. These are nouns (or pronouns, whatever). If anything,…

It is true that there is some being, or noun, that is implicitly taking out the garbage in his example. I think the important thing to note is that we can happily describe the process of taking out the garbage without mentioning who does it. If we step back and look at it in terms of programming the principle here is that an Object Oriented insistence on defining and instantiating a doer for every action is unnecessa…

This was a very nice clarification; thank you. I think your point to look at this 'in terms of the programming principle' identifies the truth that Yegge is getting at, the functions should be first class, without the clutter of the English metaphor.
Post reply on HN