Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!tektronix!psueea!jove.cs.pdx.edu!warren From: warren@jove.cs.pdx.edu (Warren Harrison) Newsgroups: comp.software-eng Subject: COBOL as a Programming Language Message-ID: <1121@psueea.UUCP> Date: 3 May 89 03:08:42 GMT Sender: news@psueea.UUCP Reply-To: warren@jove.cs.pdx.edu (Warren Harrison) Organization: Dept. of Computer Science, Portland State University; Portland OR Lines: 62 The discussion regarding COBOL has been quite interesting. It seems quite obvious however that the majority of people flaming COBOL don't have much experience with it. If written correctly, COBOL is perhaps the most modular language in use. This is not at first obvious because few people ever use subprograms in their college COBOL courses, and this appears to be limit of most of the posters' exposure to COBOL. In fact, COBOL has NO global variables. The only way in or out of a COBOL subprogram is via the parameter list, which by default is passed by address, but it can be forced to pass by value if desired. I have successfully developed and taught a course on data abstraction This can be inefficient, but it gives a great motivation for students to address memory allocation issues [no new(xyz) ... you're responsible for the free list or garbage collection yourself]. Data abstraction was much easier in COBOL than in Pascal since you really could ensure the internals of the operation abstractions were unavailable to the user. Because of this, you didn't have any "global linked lists" floating around that the programmer is tempted to access outside the "pop" and "push" routines. Unfortunately, the potential is usually not realized since most CS COBOL courses are taught by either (1) people who know COBOL, but have no formal CS training - eg, the adjunct instructor from the local dog food plant or (2) CS faculty who know barely more about COBOL than what is in the first 10 chapters of a sophomore lvele text book. Here are some of the good points of COBOL, that few other languages have ... as far as I know, no other language has them all: packed decimal number representation, built-in report writer, built in (via the OS access methods that is) indexed sequential file system, built in binary search and sorting commands, exception flagging and handling, built-in string handling (eg, STRING/UNSTRING), (REPLACE USING), pseudocode-like syntax (?). Bad points: Wordiness, poor control stuctures (fixed in COBOL 8x), no dynamic RAM memory. I may have missed some of each. Note that my fondness for built-in operations such as indexed files, string/unstring, etc. is because I don't like surprises, and everytime I use someone's super duper B-tree library, they seem to want to change the calling conventions. If you want to flame COBOL, please spend some time looking over the language first. It's potential is great. It's too bad no one is making use of it. Warren Warren Harrison CSNET: warren@pdx.edu Department of Computer Science UUCP: {ucbvax,decvax}!tektronix!psu-cs!warren Portland State University Internet: warren%pdx.edu@relay.cs.net Portland, OR 97207-0751