On Friday 15 April 2005 22:05, Jerry Feldman wrote:
On Friday 15 April 2005 2:23 am, Colin Carter wrote:
Programming standards have deteriorated significantly.
My argument: Some years ago academics developed design systems (Jordan etc) to stop young programmers writing spaghetti code (with lots of 'goto' statements). Then Knuth developed PASCAL to force young programmers to write properly structured code (goto statement not included).
Well, nobody could get a job if they hadn't done one of these 'design' courses and didn't know PASCAL.
Turns out that we old guys (especially FORTRAN scientific types) had been writing structured code for years, and we controlled our goto statements.
And 'they' had to add a goto to PASCAL (we grinned) because without it the code can become very inefficient (especially with PUSH/POP overheads).
Now the latest is "Object Oriented" (shouldn't that actually be orientated?) code with lots of over-heads. I know: there's plenty of cpu power and plenty of memory now. So now we are forced to buy hundreds of MB of RAM because so many young programmers say "there's plenty of memory". Nothing runs in 4 MB any more - too much over-head.
As been previously answered, Wirth developed Pascal, not Knuth. Yordan developed structured code. Oops - yes you are right about PASCAL, and I never caref for Yordan hence the incorrect spelling of the name of a guy who was trying to tell us how to suck eggs. Programming standards (eg. ANSI, ISO, et. al.) did not eliminate the goto statements. Many programming standards were developed in business so that code written by one programmer could be maintained by others resulting in a much lower cost of maintenance.
I once worked on a COBOL Personal Trust system for a bank. The code looked like this:
ALTER R5RETURN TO GO TO S1. GOTO P1. S1. <--- more of the same --->
P1. <--- do some processing ---> GOTO R5RETURN.
R5RETURN. GOTO.
To a COBOL programmer, this code was horrendous. However, I had a background in assembler, and the code had been ported from IBM assembler to COBOL on a Burroughs mainframe. What this was in assembler was something like (if I can remember old 360 mainframe assembler): BALR r5, s1 Or branch to s1, storing the return value in register 5. In essence these were a series subroutine calls. The COBOL ALTER statement was a self modifying code statement that inserted the return address into the GOTO statement in paragraph R5RETURN.
In today's world, programming standards for languages like COBOL, FORTRAN, C, C++, PASCAL, JAVA are very important because we write code that must work on many different platforms and OS's. I want my code to be able to run effectively on Linux (32 and 64-bit), HP-UX, Solaris, Tru64 Unix and more. If I follow the language standard and the Unix standards, my code should be portable. Yes, I agree with having standards. FORTRAN had them a long time ago. Even had the standard that there were no 'reserved' words.
If you're an old COBOL guy you are probably aware that a very large proportion of today's active code is still in COBOL (and FORTRAN).
-- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
Colin