4 ms·
> The equivalent Java program (to use everyone's favorite punching bag) would be a tenth the length. Not if you started dealing with real-life record format sp
by tzmudzin 6y ago
> The equivalent Java program (to use everyone's favorite punching bag) would be a tenth the length.
Not if you started dealing with real-life record format specifications, including fixed-precision numbers for currency, dates etc.
- stickfigure 6y agoYes, really. Every one of the dozen languages I've worked in professionally has support for fixed precision numbers. Processing structured records of data is a thoroughly solved problem.
- tzmudzin 6y agoWe can debate and dispute this, but I'd rather propose: take a closer look at how this is handled in COBOL, and you'll re-evaluate. In shortest words: variable declaration is also used as I/O format specification. Pretty much all of IO is just reading into a buffer, and the values are automatically mapped for your use. Sure you can use the same method in pretty much every general-purpose language (mapping C structs etc), but here it comes just natural.
- stickfigure 6y agoHow about an example? Present a short COBOL program that is actually more concise than a (say) Java program? The example presented in this blog article seems a likely candidate, and yet would be much shorter in modern languages. If you want to make the case that COBOL is still a good DSL for its niche (report generation?), it seems like there should be some straightforward examples. This is super easy to do with the aforementioned SQL or Matlab.
- tzmudzin 6y agoWrong measure. COBOL is verbose (and I hate this), but the fit-for-purpose should not be measured in LOC. It's how natural it is to perform the work, and how easy it's for your successor to maintain your program.