3 ms·
Looking at the absurdly long code required to make factorials work makes you wonder what conveniences we are all used to without really appreciating them. And w
by zeotroph 7y ago
Looking at the absurdly long code required to make factorials work makes you wonder what conveniences we are all used to without really appreciating them. And which ones will future programmers take for granted but are too niche now - maybe async/await or the borrow checker concepts, or is programming mostly "done"?
http://rosettacode.org/wiki/Factorial#COBOL http://rosettacode.org/wiki/Factorial#COBOL
or also http://rosettacode.org/wiki/FizzBuzz#COBOL http://rosettacode.org/wiki/FizzBuzz#COBOL
Is there a code example where Cobol shines in comparison to, say, Python?
- dmix 7y agoOh no every time I visit Rosettacode I spend an hour looking up languages on Wikipedia. Today’s winner is dc > dc is the oldest surviving Unix language. https://en.wikipedia.org/wiki/Dc_(computer_program)?oldformat=true https://en.wikipedia.org/wiki/Dc_(computer_program)?oldforma...
- js8 7y ago> Is there a code example where Cobol shines in comparison to, say, Python? Yes, processing (like tabulating) fixed-size records (like punch cards) with hierarchical structure. You can do that with Python's struct module but it might be more readable in COBOL. Other than that somewhat domain specific task, no. Python has a lot more features and is a lot more general language.