Some things are different in Smalltalk

In many languages a variable is of some type. Sometimes you have to define the type when you set it or at least when you read it. In Smalltalk you dont redefine the type of a variable. Its always an object. So if you want to work with a value of some type you create an object and then send the value of the source objects as a message to the new object. And as this object has expects a value and handles the value, there is no process of redefining. One could say that this is redefining But its rather something like: A thermometer measures the temperature – you dont define that the number is a temperature – you send the value of the number (like 16) to a display object . And this display then works with that value. So I think this
is much easier for many reasons: You dont have to worry of which type a variable has – you just need to send its value and rather define inside the object how to check and work with that incoming values. So you concentrate on the objects rather then on the characteristics of variables, even if they are objects in languages other than Smalltalk.
Thats a very different approach. And I think even people who know what object oriented programming is are used to, like in Python work with types of variables.

Leave a comment

Filed under Programming

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s