Jeremy
06-13-2006, 10:40 AM
I don't think the way the book approaches user-made functions is clear.
You should simply teach the user NOT to create a new function for a one liner.
For example
if ( alice.height < 10) then
alice.moveUp ....
Your book and most of the exercises tells the students to do it this way:
if (alice.smallerThan10) then
alice.moveUp ....
Then my students have to go through the unneccesarily complicated task of creating a method called smallerThan10 which is just
T/F function alice.smallerThan10
return alice.height < 10
No one really codes this way. While I understand that you are trying to write a book that gently shows them functions, I think it's better to leave this chapter until after you have discussed variables and arrays.
I doubt that Alice's Java code has boolean functions defined this way. I do remember seeing bad programmers code:
if (x == y)
if (x.isreallyequaltoInValue(y))
and then make a method called isreallyequaltoInValue, but who does this?:rolleyes:
A couple of other opinions:
Variables should be taught earlier
for loops should be taught in one chapter as opposed to two
More practice problems with while loops should be added, not just the while event handler
Fix the dotogether bug in the while event handler..... (please fix at least one bug before sims)
Just my 2cents.
You should simply teach the user NOT to create a new function for a one liner.
For example
if ( alice.height < 10) then
alice.moveUp ....
Your book and most of the exercises tells the students to do it this way:
if (alice.smallerThan10) then
alice.moveUp ....
Then my students have to go through the unneccesarily complicated task of creating a method called smallerThan10 which is just
T/F function alice.smallerThan10
return alice.height < 10
No one really codes this way. While I understand that you are trying to write a book that gently shows them functions, I think it's better to leave this chapter until after you have discussed variables and arrays.
I doubt that Alice's Java code has boolean functions defined this way. I do remember seeing bad programmers code:
if (x == y)
if (x.isreallyequaltoInValue(y))
and then make a method called isreallyequaltoInValue, but who does this?:rolleyes:
A couple of other opinions:
Variables should be taught earlier
for loops should be taught in one chapter as opposed to two
More practice problems with while loops should be added, not just the while event handler
Fix the dotogether bug in the while event handler..... (please fix at least one bug before sims)
Just my 2cents.