Hide "this"
Posted: Jul 5th, '17, 08:10
Can I start off by saying that I'm NO CS expert and I work(ed) in UK primary education using Scratch.
The Scratch concept of low floor-high ceiling has always been a good mantra for me :)
So - I on my first real foray into using GP - I looked at RabbitsAndGrass and can see its a good example of defining classes and then creating instances from the classes.
However, I'm struggling to see how sprinking the code with "this" does anything except add unnecessary clutter.
I can't find anything in the code that uses "this" but it seems to be needed in a lot of user defined blocks.
Now if there is a very good reason for needing "this" for bigger projects - how about just using the concept of the black right arrow (e.g like wait block) to hide "this"
Like I say, I'm no CS expert but I make a good (hopefully constructive) CS critic :)
Simon
PS
I'm against "self" in Python as well for same reason - my attitude is that the interpreter should be able to determine scope of functions without the programmer having to tell it every 5 seconds :)
The Scratch concept of low floor-high ceiling has always been a good mantra for me :)
So - I on my first real foray into using GP - I looked at RabbitsAndGrass and can see its a good example of defining classes and then creating instances from the classes.
However, I'm struggling to see how sprinking the code with "this" does anything except add unnecessary clutter.
I can't find anything in the code that uses "this" but it seems to be needed in a lot of user defined blocks.
Now if there is a very good reason for needing "this" for bigger projects - how about just using the concept of the black right arrow (e.g like wait block) to hide "this"
Like I say, I'm no CS expert but I make a good (hopefully constructive) CS critic :)
Simon
PS
I'm against "self" in Python as well for same reason - my attitude is that the interpreter should be able to determine scope of functions without the programmer having to tell it every 5 seconds :)