5 ms·
This part sounds alluring to me: > “It does exactly what you tell it to do on a line [of code],” explains Stuart. ”Sometimes you get files that are 2,000 lines
by AlbertoGP 4y ago
This part sounds alluring to me:
> “It does exactly what you tell it to do on a line [of code],” explains Stuart. ”Sometimes you get files that are 2,000 lines long, but they’re easy to understand because they simply do what they say they’re doing at that line.”
I don’t think COBOL is a good match for the programs I write in my spare time, but as a job it sounds nice. I guess the main problem if I were to find a job doing it would be the corporate culture at the kinds of companies that use it, but if I could do it remotely using my own workstation with any tools I choose I would do it.
- sweezyjeezy 4y agoSorry to be dense, but what does that actually mean, relative to a modern programming language?
- sclangdon 4y agoThings such as function overloading, operator overloading, dynamic dispatch, etc, are all conveinient but also obscure what is actually happening. To take C++ as an example (I love C++ btw, this isn't another C++ bashing), a line as simple as "variable1 = variable2;", could be doing all kinds of things (including not even assigning) because of the ability to overload the asignment operator. As someone reading this line of code for the first time, you don't really know for sure what is actually happening unless you also go and read the code for "=".
- pdw 4y agoThough COBOL infamously has the ALTER statement, which allows you to rewrite code at run time ;)
- valenterry 4y ago> DNA is really simple. It just consists of small parts that are being used in a chemical reaction. It's very simple to understand the chemical reaction because it's only based on four chemical bases. Sometimes DNA is really long, but it's easy to understand what it does because it simply does what each of its parts does. I guess it's easy to see the difference between "easy to read a line" and "easy to understand a whole program" now?
- AlbertoGP 4y agoHi, you seem confused. It’s not a binary choice: for a same program, the version where each line is easier to understand by itself is easier to understand as a whole.
- valenterry 4y agoOnly under the assumption that the number of lines is equal, which is almost never true.
- rbanffy 4y agoThe individual "files" are usually very simple. They are chained together into more complicated programs, but they rarely go much beyond driving a single screen or report.
- valenterry 4y agoVery simple, sure, but in comparison to what? Maybe the same "file" can be even simpler with less lines but each line itself being less simple.
- rbanffy 4y agoI never did it myself, but a friend of mine compares writing code for CICS to AWS lambdas: small and self-contained programs, strung together into a transaction processing system.
- valenterry 4y agoI have had to deal with e.g. JCL and from my experience it is a PITA. It's like when you have a bunch of small bash tools, each doing their job well. Then you have a this big script, that calls them and has to glue everything together and is hard to test and understand even though the small bits are all easy. I admit though that some things are easier - but this is mostly due to architecture. You rely on one big host and one big database. You don't have to deal with a distributed system then. However it also limits the range of business applications that you can build with such a system.
- SonOfLilit 4y agoC has this property, and doesn't suffer from the cultural issues.
- kagakuninja 4y agoThese feel-good statements ignore the fact that ancient COBOL was based entirely around global data and GOTOs. There were no block structures or loops. You kind of had procedures (I think), in which programs can call other programs. But you still ended up with thousand line files, all linked by GOTOs and GOSUB. All GOTOs. Is GOTO not powerful enough? Good news, we have GOTO DEPENDING ON. The destination of your GOTO is determined by a variable. Youngsters may not realize just how bad GOTO based code can be. This is where the term spaghetti-code comes from. I still remember as a teenager, trying to understand how a BASIC maze generator program worked. I printed out several hundred lines of source and proceeded to study it. And eventually gave up after an hour. I'm sure later variants of COBOL introduced blocks, loops and procedures. But that 50+ year old system will be all GOTOs...
- AlbertoGP 4y agoI see, even if clear unambiguous lines by themselves are a good thing, there might be plenty of reasons to stay away from a COBOL system in particular.