[Info-vax] COBOL Is Obsolete (was Re: Any stronger versions of the LMF planned ?)
Arne Vajhøj
arne at vajhoej.dk
Wed Sep 22 19:40:05 EDT 2021
On 9/16/2021 10:08 PM, Lawrence D’Oliveiro wrote:
> I laugh at your ignorance of dynamic languages like Python. And I’d like to see you stuff something like this
>
> cu.execute \
> (
> "insert into font_features(filename, fileindex, tag) values "
> +
> ", ".join(("(?, ?, ?)",) * len(feature_tags)),
> sum
> (
> (
> (
> fontfilename,
> faceindex,
> HB.UNTAG(tag, True).decode(),
> )
> for tag in feature_tags
> ),
> ()
> )
> )
>
> in your COBOL pipe, and smoke it.
>
> (Taken from <https://github.com/ldo/python_fontconfig_examples/blob/master/collect_opentype_fonts>.)
That program seems to be reading from some files and inserting
some information into a database.
That is a pretty standard task for Cobol. Of course it can be done.
It will undoubtedly require more lines of code. Cobol data
declarations are huge and the executable statements are also
on the verbose side. Typical estimates says Cobol 100 loc/FP
and Python 20 loc/FP, so a guess would be 5 times as many lines.
For the specific case there is also some needed libraries
that will have to be found: scanning dirs, accessing SQLite
and the HarfBuzz stuff.
For the specific task then I don't think Cobol will make
top 20 of language candidates. The only thing Cobol would
be good at for that task is doing the SQL.
Arne
More information about the Info-vax
mailing list