I think it would be a great idea to explain exactly what a method is right after introducing Objects.
99.next looks like magic. But if you show that it's actually a method that can look like this:
class Integer
def next
self + 1
end
end
... it removes some of the mystery. Plus there are opportunities to use methods in later examples, like n bottles of beer on the wall. Why start with 99? Pass whatever you want into a method. Even better, recursive method.
I think it would be a great idea to explain exactly what a method is right after introducing Objects.
99.nextlooks like magic. But if you show that it's actually a method that can look like this:... it removes some of the mystery. Plus there are opportunities to use methods in later examples, like
nbottles of beer on the wall. Why start with 99? Pass whatever you want into a method. Even better, recursive method.