Sujet : Re: My hang-up about OOP (snit)
De : luisXXXlupeXXX (at) *nospam* gmail.com (Luis Mendes)
Groupes : comp.lang.tclDate : 26. Jun 2024, 19:28:33
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <667c5dd1$0$706$14726298@news.sunsite.dk>
References : 1
User-Agent : Pan/0.154 (Izium; 517acf4)
On Tue, 25 Jun 2024 18:09:28 -0300, Luc wrote:
It's hard for me to accept OOP because as hard as I try I really can't
not think that OOP is the Emperor's new clothes.
Example from snit:
snit::type dog {
method {tail wag} {} {return "Wag, wag"} method {tail droop} {}
{return "Droop, droop"}
}
dog spot puts [spot tail wag]
puts [spot tail droop]
Why exactly is that any better than this:
proc dog {args} {
if {$args == "tail wag"} {return "Wag, wag"}
if {$args == "tail droop"} {return "Droop, droop"}
}
puts [dog tail wag]
puts [dog tail droop]
Hi Luc,
I understand your feelings, I also don't like OO.
AFAICT, OO was first implemented in Smalltalk by Allan Kay.
But it seems that he is sort of regretful of having called it a Object
Oriented programming language, instead of a Message Passing programming
language.
Other programming languages tried to the the OO thing, but without the
luster of the rest.
I suggest you see some videos about Smalltalk, and even consider doing a
MOOC in Pharo from a french university to have the real feel of it.
https://mooc.pharo.org/All the best,
Luís