8

RANT: So in school, we have to program using some kind of pseudocode.
Today we wrote an algorithm from a previous exam. Apparently, they don't give you a mark if you get the Array.length(). To receive the mark you have to have to use a variable.
WHICH MAKES ABSOLUTELY NO SENSE TO ME.
My teacher said it would even be ok to define a variable like Variable = Array.length. THAT MAKES EVEN LESS SENSE

Comments
  • 0
    Ouch bro, ouch... What cave do you study in?
  • 3
    @karma the wrong one I guess.
    Good thing, I have to only survive this for a limited time.
  • 1
    It might make sense. Using the length method may be more resource intensive than calling it once, assigning its value to a variable, and using the variable from there on out. Unless that length method returned value is changing along the way, then you may need to use the more resource intensive method.
  • 1
    @funkyboss in this course they don't care about efficiency, just that it works. However the way they wanted to have it is as we converted a collection to array before, they wanted us to save the counter of elements there and use it in the for loop.
  • 0
    @McTschecker Don't care about efficiency? Yup, sounds like school.
Add Comment