On Fri, 17 May 2013 17:27:15 -0700 (PDT), Patrick
<
halfm...@gmail.com> wrote:
>Hi Everyone
>
>I am trying to use Cobol well outside of it's traditional domain. My interest is in controlling scientific instruments and processing data from them. Open Cobol is easy to use in tandem with C, the only thing is I would like to use the best strategy to create reusable code for others when I write Cobol libraries.
>
>OO seems to offer a somewhat standard way of organizing code, at least in comparison to Cobol 85 but currently open Cobol does not support OO.
>
>I am thinking about writing a small compiler that will translate OO Cobol into Cobol 85.
>
>It's my understanding that the first C++ complier merely translated C++ code into C. It seems like someone could still get good C++ coverage with just C, it's just that stuffing function pointers into structs makes for hard to read code and so on.
>
>Is it reasonable to assume that Cobol 85 code could be organized to simulate OO Cobol constructs? If so I could probably right my libraries in OO style and then use a command to translate them to what might be called Cobol 85+, open Cobol, with support for some of the 2002 standard and most of the 85 one.
>
>Feedback would be appreciated-Patrick
My question is: What do you intend to do with the extended COBOL code
you hope to write? If you plan to maintain the code for your own use,
and if doing it in some object-oriented extension of COBOL sounds like
a good idea, then I can't think of a single reason why you shouldn't
do it.
On the other hand, if you plan to sell the code you write, especially
in source form, do you really want yours to be the only scientific
instrument interface written in *any* version of COBOL, let alone the
version you're thinking of creating?
C++ can be a nightmare, but it's sometimes possible to find a
reasonable subset. You don't have to use the language's more cryptic
features if you don't want to. If you need object orientation and
speed, then C++ might be the way to go.
If you don't need as much speed, there's Java. I know almost nothing
about Java.
If you want a lightweight scripting language, there's Lua. It's used,
from what I hear, for implementing games. I've played with Lua. I've
gotten simple things to work.
A war story: In the early 80s, I worked at a university that had
bought an academic administrative package written in COBOL and bundled
with a Harris 530 minicomputer. The 530 was a 24-bit machine designed
for number crunching, but someone at Harris apparently wanted to
expand into the data processing market.
Since we needed a package to drive tape backups and track which files
had been backed up to which tapes, I wrote one in COBOL, since that
was the only language compiler we had (I didn't want to write it in
assembler). What I hadn't taken into account was the fact that the
Harris COBOL compiler generated code for branches but library calls
for moves and adds and everything else COBOL did. The backup driver
took way too long to run, and the project was not a success. I don't
recall any complaints about the administrative software, but the
Harris went away after a few years, and the Vaxes came.
Louis