Old-style COBOL translates trivially to or from very brain-dead imperative style code with lots of goto.
If you can look past the syntax, modern COBOL is a decent enough compiled language, with most of the stuff you'd expect.
If you can look past the syntax, modern COBOL is a decent enough compiled language, with most of the stuff you'd expect.
Provided the target language supports "goto", and "fall through PERFORMs" :)
>If you can look past the syntax, modern COBOL is a decent enough compiled language, with most of the stuff you'd expect.
Probably < 1% of production Cobol uses any syntax newer than Cobol 85!
(;-))
And I'm untroubled by syntax; I'd happily use C-like languages, ML languages, Lisps, etc. COBOL just isn't a good or interesting language nowadays, if it ever was.
It feels as if you were writing something like this:
Program Name The Program.
Author the_af
Data section.
Some numbers.
X 1.
Y 2.
Actual code section.
Program beginning.
About to start.
Let's do this.
Add X and Y, Giving Z, Z Being the Addition of X and Y, but not of W nor V. U is right out.
Having Computed Z, Z Being The Addition of X and Y, Z is therefore the Result.
Give Result.
Program End.
Ok, this is a parody, but it's also what writing COBOL feels like -- or at least, what it used to be like. And somebody thought because these were "English words", that this would somehow enable less technically minded programmers accomplish their tasks.But sometimes you just want to write:
f(x, y) = x + y