3 ms·
Tangentially, seeing this code snippet made me wonder whether we lost something in our push to make programming languages/statements more and more terse.
by hliyan 3y ago
Tangentially, seeing this code snippet made me wonder whether we lost something in our push to make programming languages/statements more and more terse.
DISPLAY "Write something and then press the <Enter> key"
OPEN INPUT SYSIN
READ SYSIN
AT END SET EOF TO TRUE
END-READ
PERFORM UNTIL EOF
Perhaps a little verbosity is good to make programming accessible to a larger audience. I've been programming for over twenty years, but the seemingly redundant "AT", "TO" and "PERFORM" does help the flow in my head. Almost as if it brings into play more of my brain's language centres because now the code can actually be read out aloud.
- tomjakubowski 3y agonamed arguments a la Objective C or Gleam do a similar thing - oftentimes a named argument will start with a preposition or simply be one, "from" or "to", so you can read and write: deliverWidget( to: factory, withCourier: ups )
- paulddraper 3y agoNamed arguments are such a good idea.
- Quekid5 3y agoSadly, many languages that have them make the parameter names optional at the call site. That's a language design mistake, IMO.
- hu3 3y agoI agree. Fortunately IDEs can fill this gap by displaying parameter hints. https://blog.jetbrains.com/phpstorm/2017/03/new-in-phpstorm-2017-1-parameter-hints/ https://blog.jetbrains.com/phpstorm/2017/03/new-in-phpstorm-...
- Quekid5 3y agoIt's definitely an improvement, but it doesn't fix the fundamental issue :/
- petercooper 3y agoPerhaps a little verbosity is good to make programming accessible to a larger audience. Careful, though, or you end up with AppleScript.. :-) But yes, fair point, and AI-powered IDEs could actually make it productive, too. One problem with such verbose code is it can be easy to forget the particular incantations needed because it gets mixed up too much with natural language, but autocomplete, Intellisense, Copilot, etc. could probably bridge the gap.