3 ms·
"when Vowel" is not very different to bog standard switch-statement magic. Actually in this case it looks like Cobol is almost doing a kind of pattern matching.
by YeGoblynQueenne 7y ago
"when Vowel" is not very different to bog standard switch-statement magic. Actually in this case it looks like Cobol is almost doing a kind of pattern matching. Which is cool. Although (my Cobol is a bit rusty) I think there might be a more elaborate way to write "when Vowel" that hides less of the actual process? Not sure.
Cobol is really not such a bad language. It's just got a lot of ...ceremony. All those forced divisions and sections. But that's a feature: in the olden days, structured programming was a big thing. And an experienced Cobol programmer can take a quick look at a big Cobol file and find where everything is in a blink.
- ptx 7y agoJava similarly imposes a lot of structure that allows you to more easily find where everything is, but the trade-off is that there is a lot more of this everything to find, whereas in a more flexible language you would have less code to read through and therefore less need for organizing it.
- msla 7y ago> "when Vowel" is not very different to bog standard switch-statement magic. Actually in this case it looks like Cobol is almost doing a kind of pattern matching. It is, but the "magic" is that the pattern-matching is part of the variable declaration, so you can reuse those patterns wherever you can use the variable.