[Grace-core] Decisions from yesterday's phone conference
Ewan Tempero
e.tempero at cs.auckland.ac.nz
Wed Jun 22 16:06:40 PDT 2011
Given that Grace is intended to be used for teaching, I have to wonder whether leaving so
much of the interpretation of what something means to its context is such a good idea.
When we(1) moved from Pascal to Java, one thing that caught us by surprise was the
students seemed to struggle with the concept of a "type". We(2) speculated that this might
have been partly due to the fact that Pascal has the "type" keyword, and Java doesn't,
meaning students were not being constantly reminded as to what a type was in Java. As far
as I know, no one followed up on this (I'm not even sure if we mentioned this point
specifically in the papers we wrote on using Java for teaching). The fact that Java
classes were used in the context of types didn't seem to be sufficient to get the point
across.
we(1) - I was at VUW at the time
we(2) - Some subset of those teaching Java, probably Robert Biddle, Peter Andreae, myself
The thing that probably most annoys me about C++ is not the things people usually complain
about, but the fact that a lot of what happens in C++ depends on its context, and
sometimes you have to look at a lot of the context to determine what will happen (e.g,
default constructors of different kinds, overloading of operators).
The more of the context that needs to be examined, the more effort it is to understand the
code. For those learning the language (especially if they are learning programming), they
might not even know what context they need to examine, so increasing the difficulty. This
is especially true if even simple questions (eg. "is this a method?" "does this method
return a value?") require looking at more context.
So I would argue for always including parens for any mention of a method, and always
indicating what gets returned (if anything). And generally, whenever the question of
choice of syntax comes up, I would argue for the decision that provides the most
information about what's going on. Sure it will mean more typing, but with IDEs these
days, that shouldn't be an issue.
Just my 10c (that being the smallest coin we(3) have these days :-)
--ewan
On 23/06/11 09:34, Andrew P. Black wrote:
> Yes, that's right with respect to colons. However, I don't recall putting in the empty
> parens for methods with no parameters. We have previously worked very hard to
> eliminate them. So, I believe that this examples should be:
>
> type Cat { color -> Color name -> String miceEaten -> Number miceEaten:= (Number) ->
> Unit }
More information about the Grace-core
mailing list