> 9(3) is shorthand for 999
I did some cobol work in the past and know 9(3) but you can write 999? And how is 4 chars shorthand for 3?
But, as an over-30 on HN, I'd be afraid that having the word "mainframe" on my resume would alienate a 20-something co-founder or hiring manager. :)
OK, OK, I did once do a little bit of mainframe-related work. It was reverse-engineering a small part of a certain domain-specific mainframe network protocol, with the goal of replacing at least one of the companies' mainframes with... 21st century Linux servers running... Lisp. (IMHO, the HN karma should at least balance out there by using Lisp, like the post did by using Rust.)
Mainframes may not be what you’d work on at a startup today, but they’re complicated pieces of engineering, and writing software for them requires you to understand a lot about how they work. Updating or rewriting their software further requires you to understand how the people before you _thought_ they worked. That’s how I tell that story.
Many languages also have libraries (or standard libraries) for supporting arbitrary length and precision rational numbers.
Couldn't you just express everything in eg cents, if you want that?
Otherwise, many languages also have libraries for working with exact rational numbers.
Cents was just an example. Old British currency used to be even crazier than your example of a unit divided into 1,000.
> But, the moment you need to convert from KWD to VND (84000.00:1) you could be at the edge of the size of a 64 bit int.
So? You should use arbitrary length integers for that. Many languages have good support for them. Eg in Python they are the default integer you get.
PICTURE IS $-999,999.99
which defines a signed money value represented in decimal. If you print that value, it will be formatted as requested.There are a few other formatting characters. A "CR" at the end will cause negative numbers to be printed with "CR" (Credit) at the end. A "Z" causes lead zero suppression. "*" causes lead zeros to be replaced with asterisks, for check-writing. Numeric display formatting is an attribute of the data.
That concept, and built-in support of money-like values, has been lost in later languages. In Rust you can have implicit Display or Debug functions for types, although it's mostly used for debugging.
Mixing value and presentation wasn’t the brightest idea. In their defence, everything was new at the time, and everywhere they were breaking new ground.
Spreadsheets still do that.
Deloitte, for example, has quite a big practice around Mainframe modernization with a toolsuite https://www2.deloitte.com/us/en/pages/consulting/topics/appl...
And AWS bought a company with such a toolsuite and offers it now as a service https://aws.amazon.com/de/mainframe-modernization/capabiliti...
Consider a hypothetical Python example:
import os
os.system("DIRECTORY ./SHELVED_STATE")
if you ported the python to C# it wouldn't suddenly work on Windows or Linux
markus_zhang•8mo ago
The most compiler-ish work I ever worked on is a yaml to yaml transpiler. I mean, yeah...at least I got to write some recursions.
almostgotcaught•8mo ago
eru•8mo ago
chihuahua•8mo ago
We didn't learn anything "useful" except we got to understand things like the bizarre FOR construct for the first time.
I'm sure Raymond Chen could write an airtight argument why the batch scripting language HAD TO BE exactly the way it is, and there was no alternative to iterating over files and lists using the FOR command with its bizarre flags, but once he leaves the room, I'll go back to insisting that this is one of the most screwed up things that have ever been done with software, and it's a travesty that this was still being used to run the Windows build system at Microsoft in 2013.