Welcome to MekTrix 4.0

Aka Shish’s Place of Stuff

I weep for compsci

I don’t even weep softly. I weep fucking hardcore. I have to wait for these people to catch up before the interesting stuff starts :(

For reference, the full question:

You have an ArrayList called “library” which holds some Book objects. The Book object has a method called getTitle() which returns a String. Write a for-each loop (which we’d been learning about in the lesson) to print the titles of each book, one per line.

And the answers:

  • for(Book title : library) {System.out.println(title);}
  • Shouldn’t the title be of type String, rather than Book?
  • Replace “title” with “book”
  • The print line should have book.getTitle() in it
  • Actually, use the “String title” in the loop, then print book.getTitle(title)
  • No no, the book already has the title, you want library.getTitle(title) !

The lecturer (a temporary one) was encouraging them with things like “that’s sort of right”, whereas the regular guy would just have said “no”…

And then as I’m walking out of the lecture, a cocky voice from behind me — “ha, they all fail – it says one title per line, and they all forgot to put +”\n” in the println command”

;___;


One Response to “I weep for compsci”

  1. r9Paul Says:

    I read and had flashbacks to G.W. attempting to teach Pascal to the rest of the year 12 Computing group. Good Times :-)

    Just sleep through year 1, you’ll learn more.

    On a more serious note, it seems to me from the failing attempts that people are lacking the common sense and basic logic to understand objects, properties, methods and types. I would have thought (hoped) that were people to make mistakes on the given task, they would be no more than basic syntax stuff from not knowing the language fluently yet, or a difficulty grasping the iterative nature of the code (given that was the point of the exercise?)

    **Sigh**

Leave a Reply