The Mudcat Café TM
Thread #28443   Message #352798
Posted By: Jon Freeman
06-Dec-00 - 10:32 PM
Thread Name: BS: Is this comprehensible?
Subject: Is this comprehensible?
I am seething at the moment for being marked down on a programming assignement in my course at HE level for not putting comments in a programming assignment. The tutors remarks were "{comments please} tell other users what you are doing and thinking". Apart from the fact that I don't believe that users ever read source code (programmers do), I commented that I did not believe that a program of such a trivial nature warranted comments and he half agreed saying "Yes but you have to remember this is an artificial environment and I want comments so that is how it is" and the fact that he had not mentioned that in the assessment criteria (although he had again probably wrongly used the term user) is apparently irrelevant.

Anyway, that is mainly by the by. What I realy want to know is whether non-programmers can understand this code (bear in mind what would be commented on would be program logic and uses of variables rather than the meaning of a words like integer - something that holds a whole number value, and real - something that holds a decimal value or the structure of pascal, in other words the bits I would expect to be hard for someone who has never read Pascal or any other programming language - or a user):

  program Wages;    

var
Employee: integer;
Hours: integer;
Pay: real;

begin
for Employee := 1 to 5 do
begin
Write('Enter hours worked: ');
Read(Hours);
if Hours > 20 then
Pay := Hours * 4.00
else
Pay := Hours * 3.75;
WriteLn('Pay due = ', Pay:5:2);
end;
end.

Oh well I guess that if nothing else, I should be glad that a course I have been on at HE level since August has at least got me this far in programming.

Jon