Hacker News new | ask | show | jobs
by joeberon 1706 days ago
Exactly the point they were making. All these problems were already around at the time. In fact people didn't even see them as problems. Read gang of four, and they don't really mention working around the limitations of the language. It is as if they are not really aware how many of their problems are arising due to the language's design, and think their patterns are just a generically good to do it. People don't use a majority of them now because there is just no need for them anymore in modern languages.
2 comments

Curiously, Smalltalk also lacks the idea of a function. Everything is an object; instead of a function, you have a code block which is an object.

But, unlike Java, Smalltalk is (utterly) dynamic, and you don't have to declare a class for your code block. In Java, you had to dance that dance, until lambdas were introduced to let the compiler do that for you.

> > > Everything is an object…

"Every object in Smalltalk, even a lowly integer, has a set of messages, a protocol, that defines the explicit communication to which that object can respond. Internally, objects may have local storage and access to other shared information which comprise the implicit context of all communication."

p290 Byte Magazine 1981

http://worrydream.com/refs/Ingalls%20-%20Design%20Principles...

> > > … instead of a function…

Instead of a function, a message.

Let's take that literally —

  perform: aSymbol with: anObject
  
    Answer the result of sending a binary message
    to the receiver with selector aSymbol and argument
    anObject. Report an error if the number of arguments
    expected by the selector is not one.
(For more of those methods, see p425

https://rmod-files.lille.inria.fr/FreeBooks/SmalltalkVTutori... )

Last-time I remember using those #perform methods, it was for testing — walking the code sending arbitrary messages and and arguments.

"III. Anonymous Function = Block?" slides 17 & 18

"Smalltalk blocks and closures origin and evolution" Juan Escalada

https://smalltalks2017.fast.org.ar/talks

Until lambdas came to be, the workaround was to use anonymous classes, very few people would do a separate class.

And no lambdas are not implemented that way, rather they take advantage of invokedynamic.

So the Sapir-Whorf hypothesis is true for programming languages?