[Pharo-users] What other languages can do something similar?
jlhouchin at gmail.com
Mon May 2 08:36:44 EDT 2016
While working on a project I made a mistake in some code. A common
mistake in most languages, a less common one in Smalltalk or Pharo.
Something similar to the below.
| index end |
[ index < end ] whileTrue: [
"Do something clever.
But forget to increment index."
I can execute foreverTrue in a Playground and when nothing returns in an
appropriate amount of time. I can stop the execution. Fix the bug. Try
again. I lose nothing. All my data, all my image state is still there. I
do not have to do anything special to execute foreverTrue again, but now
Because Pharo/Smalltalk is so much more than just a programming
language, this is possible.
Most languages I know you would have to kill the vm and start all over.
I would have to do everything I had already done to get to the correct
state in order to execute my method. I guess many static languages might
catch the bug and not allow execution. But I have no experience there.
I was just curious as to what other languages, environments might
survive my mistake and allow me to gracefully correct and continue.
I think this one of the big wins for Pharo/Smalltalk. We can sometimes
mess up and recover gracefully.
I think small things like this should possibly be collected in a
document as to some reasons for Pharo.
More information about the Pharo-users