[Cuis-dev] Some un-accurate information on The Cuis Book

ken.dickey at whidbey.com ken.dickey at whidbey.com
Sun Feb 26 05:31:18 PST 2023


On 2023-02-25 12:54, Hernán Wilkinson via Cuis-dev wrote:
..
> About the scope of inst vars, they are protected in the c++/java/c# 
> parlance... I think the word protected should be use and reference the 
> other languages

This is a good observation, but I think it is simpler to assume common 
language use for "private".

In a "stand-alone" introduction, we could introduce a chapter describing 
differences between programming languages and the world views they 
present, but I think this is best left to contexts where multiple 
languages are used (see comment below).

I went to high school before we had calculators or computers and I like 
to use programming languages which do something close to what I think of 
as "high school math"

In Smalltalk:

   (1/2) + (1/3) + (1/6).  "-->  1 "

   (100 factorial) / (99 factorial). "--> 100 "

   Feature require: #Complex.
   -4 sqrt squared. "--> -4 + 0 i "

Pointing to C++/Java/C#, one has to take time and energy to explain how 
broken their math is and how to work around the breakage.

I think it much better to show how to extend the math support in 
Smalltalk by adding complex numbers than it is to explain why/how 
implementing and using numbers in C++/Java/C# is so broken.

BTW, we can do better.  I think -4+0i above should be and print as -4.  
I am willing to take a look at this.

Again, the great thing here is the ability to "make it better", which is 
really, really hard in C++/Java/C#.

These days, I am sure many students come from a context where they 
already know multiple programming languages.  Hernán, would you be 
willing to write an appendix chapter comparing Smalltalk to other 
programming languages which students are probably familiar?  Perhaps 
more questions and hints?

$0.02,
-KenD


More information about the Cuis-dev mailing list