r/programmingbydoing • • Feb 11 '13

Assignment 39 - compareTo() challenge - Explanation on how it works?

The lesson gives an extremely brief description and gives you an example code from which you're able to figure out the gist of what's going on. However, I feel as if the compareTo() method isn't really explained. When I tried to run the assignment, I'd get values of positive and negative, but I wouldn't understand why I'd get specific values.

I'm guessing this is one of the assignments that's missing a lecture perhaps? I would greatly appreciate an explanation since I'm having a hard time finding good explanations from google.

5 Upvotes

10 comments sorted by

View all comments

Show parent comment

2

u/holyteach Feb 11 '13

Yeah, what you say is all correct, but it's WAY more detail than beginners need. Interfaces? Really?

1

u/FancyMonocle Feb 14 '13

It isn't that bad. I understood it because I have some experience with C, but he explains it in a way that should be easily understood by any newcomer.

1

u/holyteach Feb 14 '13 edited Feb 14 '13

I can assure you, I've taught the basics of programming to over 2,000 students over the past fifteen years, and his explanation would not be "easily" understood by "any" newcomer. It's actually a quite good explanation for people who somewhat know what is going on, but functions, classes and arrays are quite a bit out of reach for truly inexperienced regular people.

To give a specific example: today I had to help a student who has BEEN IN MY CLASS for 4-1/2 hours a week for nearly 15 weeks. He needed help remembering how to write an IF statement to compare two ints. Admittedly, he's struggling more than most students, but this is literally a thing that happened today.

You apparently have done more than 30 of my assignments with virtually no help from a live human and in less than 3 weeks. That would put you among the top 20% of the students in my courses.