Thought for the Dazed

I've had to give up that Distance Learning course as I was having trouble seeing the teacher.

Flickr
www.flickr.com
RobMiles' items Go to RobMiles' photostream
Twitter
C# Yellow Book

Search entire site
« Live Writer Goes Live | Main | Super Zune »
Wednesday
Nov142007

Easy Money

I won 10p yesterday. I had a bet in a lecture that:

i=0;

j = ++i;

- would set j to 1. (it does, because the increment is done before the assignment). Someone didn't agree, a bet was made. Sample code was written and executed. And I won. I didn't keep the money. I handed it back with a magnanimous "Get yourself a drink on me" which shows how out of touch I am...

I went into today's C# lecture with hopes for similar financial gain, but it was not to be. I think the word may be out that I am some kind of hustler. I really like teaching the first year course. Every year we seem to get a great batch of students who ask sensible questions and enjoy learning how to program. It is rather nice at the moment because we are looking at things where there are no "right" answers, just ones which fit the context better than others. So we can debate these issues. Great fun.

Reader Comments (3)

I was there! I thought you were right from the start - it seems more intuitive that ++i would perform the operation before and i++ would do it after, simply due to the ordering.
November 15, 2007 | Unregistered CommenterMatt
You still owe me £1million from two years ago Rob.

Cheque or Cash preferred
November 15, 2007 | Unregistered CommenterDavid
Can't you just let me buy a drink with it?
November 15, 2007 | Registered CommenterRob

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.