Am 25.09.2020 um 22:16 schrieb James Richters via fpc-pascal:

I think that’s a GREAT quote from Niklaus Wirth, and I agree with that whole heartedly… programs should be readable by humans… otherwise do all your programming in assembly language… the whole POINT of a hi level language is to make it readable by humans… not computers.I can’t stand trying to muddle through things like C++,it’s just to confusing.. trying to follow all those curly braces and figure out what this line of code is going to do.. it’s just a mess. yes I can manage, but I defiantly prefer the clarity of PASCAL… so I also name my variable very clearly instead of using cryptic shorthand.. who cares how verbose my variable names are… it doesn’t make the program any less efficient.. but very clear function and variable names sure make it easier to remember what you were thinking when you have to go back and modify code you originally wrote 30 years ago.


...

I admit my code gets a little sloppy with the indents, so after a while it sometimes looks like:

if something then
begin
some code here;

some more code;
end;

at least it compiles correctly because the begin and end; are defining things… once I get a function or procedure working the way I want it, I will then take the time to go back and fix my indents.


Same for me, except that I totally automated the process of fixing the indents; when inserting new code into a program, I don't care much about indentation; instead after compiling successfully, I run a (self-written) Pascal program which fixes the indentation etc.; it also draws boxes around certain comments and inserts blank lines, when necessary. The parts of the program, which are already well-formed, remain unchanged.

The program, which fixes the indentation, is in many cases scheduled automatically after
a successful compiler run.

This is how a program looks after automated indentation:
https://github.com/StanfordPascal/Pascal/blob/master/PASCAL1.pas

Kind regards

Bernd


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to