|
|
|
|
|
by lokedhs
2021 days ago
|
|
It's suited for a very specific kind of data processing. It's a kind which isn't typically used today. The language combines presentation and storage in a way I've never seen in any other language. Let's say you have an 8 digit variable. You can then specify that the last two digits is represented by a different variable, and thus the second variable will only work on those last two digits. This is useful when you have formatted fields, where you have a variable that holds an ISO 8601 date, with other variables representing the year, month and day parts. In a language like Java, you need to create a class that holds this information, with separate methods to manipulate the individual components and formatting the output. In COBOL you only need a few lines of declarations to do this. The drawback is that now presentation is tightly associated with the data storage, meaning that changing presentation format can be a lot of work. This is why COBOL programs were so problematic during Y2K. |
|