5 ms·
>In Pharo, everything is an object. This purity and uniformity in the system and language design makes Pharo clean and comfortable to learn. Does this mean Pyt
by aitchnyu 5y ago
>In Pharo, everything is an object. This purity and uniformity in the system and language design makes Pharo clean and comfortable to learn.
Does this mean Python and JS meet the same definition and are as "clean and comfortable"?
- goatlover 5y agoRuby comes closer than Python or JS with it's blocks and consistent object model (including primitives).
- jhgb 5y ago> Does this mean Python and JS meet the same definition and are as "clean and comfortable"? Are things like message sends or activation records accessible and manipulable as objects in Python and JS?
- e12e 5y agoRuby is much closer to smalltalk than python and js (in the evything is an object sense, and partially in the clean and comfortable sense). Maybe the closest "real world" examples would be Lua, and scheme?
- ssdspoimdsjvv 5y agoPython comes close, but what makes Smalltalk special is that flow control and loops are done with objects. There are almost no keywords. Imagine that you could do something like this in JavaScript: (name === "Mike").ifTrue(() => console.log("Hi Mike"); The implementation of this is done through a Boolean class, which has two subclasses, True and False. True implements the ifTrue(fn) by invoking "fn", False simply returns. The main advantage is that everything is predictable and inspectable.
- TenToedTony 5y agoPrimitives in javascript are not objects.
- billsix 5y agoI remember while learning Smalltalk how surprised I was when if statements and loops weren’t syntax of the language, but methods on objects. True and False are singletons of a Boolean class, which has a method ifTrue:ifFalse which take lambdas as arguments. For loops, a lambda which returns True or False has a method whileTrue: which takes a lambda as an argument. Although I like Python, and I don’t know JS well, I really enjoyed learning Smalltalk, even though I will likely never use it professionally.
- egeozcan 5y agoJS is for me clean and comfortable, sometimes more than C# and for some others Python is, and everyone has their own answer to "what makes them so". Everything being an object may do the trick for you or not. I don't mind a marketing page (even for a programming language) being opinionated, as long as not borderline delusional.
- goatlover 5y agoUnlike most OOP languages, it's true, and not just marketing, for Smalltalk to make the claim that everything is in an object.
- egeozcan 5y agoI was not talking about everything being an object. I was talking about that claim being the key to being nice and comfortable. Many sibling comments, IMHO, miss the point of the parent and focus on the claim about python and js. Python and js could perhaps have been completely object based. It still wouldn't make them comfortable for many.
- xkriva11 5y agoThe sentence says that it makes Pharo clean and comfortable to learn. Not that it makes every language clean and comfortable to learn :-)
- egeozcan 5y agoYes and the comment I replied to vaguely suggested that it didn't make python and js comfortable to learn and everyone focused on the fact that in these languages not everything is an object.
- goatlover 5y agoTrue, but personally I think JS and Python would have benefitted from being more consistent about being object based. JS in particular, since it's prototypal, but has function constructors and class syntax, along with other things added over time that make the language more complex.
- JamesSwift 5y agoWhen Pharo says 'everything' they mean _everything_.