by ecyrb · 14y ago · 0 comments
"Most of the solutions for this assignment can be written as one-liners. If you have more, you probably need to rethink your solution. In other words, this assignment needs more thinking (whiteboard, pen and paper) than coding ;-)."
Is it not entirely possible that they're getting some false positives?
class Rational(x: Int, y: Int) {
def numer = x
def denom = Y
}
and then homework is to implement def less(that: Rational) = ???
then you're gonna get 15 000 people answering with def less(that: Rational) = numer * that.denom < that.numer * denom
and another 15 000 with def less(that: Rational) =
numer * that.denom < that.numer * denom
and maybe a couple thousand with something like def less(that: Rational) = numer*that.denom < that.numer*denom
(This example was taken from Scala course lectures, but some of the homework problems are as short as this.)But it's a moot argument as we need to do a real research (or ask coursera / Martin Odersky for the data, which I'm sure HN community will be happy to run some data mining on)