4 ms·
I'd extend that by saying it teaches you what OO was meant to be.. It also shows you a lot of what is missing in modern environments. Imagine being able to run
by rjblackman 9y ago
I'd extend that by saying it teaches you what OO was meant to be.. It also shows you a lot of what is missing in modern environments. Imagine being able to run code and create any objects via a kind of command line and while any program is running be able to change it on the fly for experimentation/exploration purposes! I wish .net had something like this!
- shawnz 9y agoVS does have that functionality, although it was only added in VS 2015: https://johnkoerner.com/csharp/the-c-interactive-window-in-visual-studio-2015-update-1/ https://johnkoerner.com/csharp/the-c-interactive-window-in-v... Previously there was the Immediate window but it is limited: https://msdn.microsoft.com/en-us/library/f177hahy%28v=vs.110%29.aspx https://msdn.microsoft.com/en-us/library/f177hahy%28v=vs.110...
- rjblackman 9y agounfortunately, it's not really the same as with proper message passing/late binding like in smalltalk.
- shawnz 9y agoYou could use C# dynamic objects to achieve late binding.
- philippeback 9y agoTry a become: in C#
- ben-coman 9y agoGilad Bracha (co-author of the Java Language Specification) on "#become:" in Smalltalk (https://gbracha.blogspot.com.au/2009/07/miracle-of-become.html https://gbracha.blogspot.com.au/2009/07/miracle-of-become.ht...) btw, see the section here on "Blub Paradox" (http://www.paulgraham.com/avg.html http://www.paulgraham.com/avg.html ) which means I'm not really competent to comment of C#'s dynamic objects.
- ben-coman 9y agoI'm not familiar with these. Are the properties and methods that dynamically add visible in the code editor? It seems C# work by subclassing the DynamicObject class. What about dynamically extending all the other existing C# classes? What if I subclassed a C# Queue as MyQueue and then while my days long simulation was running I wanted add an instance variable 'trackCount' to all existing MyQueue instances? In Pharo all you do is this... Queue subclass: #MyQueue instanceVariableNames: ’trackCount’ classVariableNames: ’’ poolDictionaries: ’’ category: ’Example’ and program keeps running, this definition is updated in the editor.
- rjblackman 9y agoof course you could also build a whole smalltalk environment in C# also, but that really is not the point.