Exercise 6: Corrections, come on really?

spyro.makedonski
BASIC-Programmierer
Beiträge: 102
Registriert: 18. Apr 2010 13:45

Exercise 6: Corrections, come on really?

Code: Alles auswählen

    case Until0(until, body) => {
val (testV, s1) = interp(until, env, store)
testV match {
//return doesn't matter what
case NumV(0) => (NumV(5),s1)

case NumV(n)=>{
val (bodyV, s2) =interp(body,env,s1)
interp(Until0(until,body),env,s2)
}
case _ => sys.error("can only test numbers, but got: " + testV)
}

}
and i got a point taken from me for this ...

I am sorry but i do not agree with the taken point here... There is only one line which is just one row (character width) out of place... To qualify this as unreadable code is simply wayyy too pedantic.
Lets not even talk about the "state of the art" "IDE", or the names you are using (i.e. DFHFDBDSGDFH), which we have to work with here. No hard feelings, but I spend wayyy over the average time on these excercises than on any other subject and to take points from me for pressing spacebar once more is very disrespecting for my efforts. Just be more considerate

f_jakob
Mausschubser
Beiträge: 50
Registriert: 27. Okt 2009 14:05

Re: Exercise 6: Corrections, come on really?

Hi spyro.makedonski,
I am sorry but i do not agree with the taken point here... There is only one line which is just one row (character width) out of place... To qualify this as unreadable code is simply wayyy too pedantic.
Yes, I am pedantic about whitespace, but in the context of formal languages this micrology has its right to exist. Additionally, the space before the val in the second line is not the only reason for the deduction of 0.5 points.

More important is the miss-alignment of the closing braces. At first glance, it seems as if the case expression is not closed at all and there would be a closing brace missing. This together with the already mentioned wrong indentation of the val took me a short moment to understand which brace closes which block.

Last, your usage of spaces is inconsistent, which makes your code look twitchy.

These are the reasons for the deduction of the 0.5 points, which is only 5% of the grade for this task.
Lets not even talk about the "state of the art" "IDE"
I assume you are referring to the WebLab editor. Yes, it has some issues. As a workaround, you could copy & paste the code into another editor (e.g. http://scala-ide.org/) and use its formatting and syntax highlighting features.
or the names you are using (i.e. DFHFDBDSGDFH)
The idea is to add one letter for each (new) feature in the interpreters, which leads to this naming pattern. So SCFWAE for example stands for State, Conditionals, First-Class Functions, With, Arithmetic and Expression.
No hard feelings, but I spend wayyy over the average time on these excercises than on any other subject and to take points from me for pressing spacebar once more is very disrespecting for my efforts. Just be more considerate
It is nice to hear that our exercises have such a high priority for you. But polishing your solution by formatting the code and fixing the indentation should only take a few minutes (max), or could be automated with other tools, as already mentioned. Indentation is relevant to parsing in some languages (e.g. python), so attaching the same importance to correct indentation (or use of whitespace in general) as to correct placement of semikolons after statements in language which require them (e.g. Java), is not too far off.

That said, the deduction of this half point is not in disrespect of your efforts, but to give you the incentive to write beautiful and well-readable code in the future.

spyro.makedonski
BASIC-Programmierer
Beiträge: 102
Registriert: 18. Apr 2010 13:45

Re: Exercise 6: Corrections, come on really?

Hi f_jakob,
thank you for the answer ... i accept your explanation