4 ms·
Well, shit - someone found a way to make perl code readable.
by meepmorp 3y ago
Well, shit - someone found a way to make perl code readable.
- db48x 3y agoThe author, Damien Conway, has told the story several times about a Romanian company that uses/used Lingua::Romana:Perligata for precisely that reason. Of all the Romance languages Romanian is the closest to Latin, so they actually find/found the resulting code to be more readable than normal Perl with all of its English keywords, standard functions, and so on.
- anthk 3y agoThat's off, because every Romance speaker will see the English tokens in programming languages as if they were abstract Math symbols without their complex semantic meaning, just a very simple one.
- db48x 3y agoRight, which is why it is harder to learn most programming languages than it needs to be. A function like “grep” is hard enough for English speakers to figure out. If you speak Romanian, you might be a lot happier with “vannementa”.
- shagie 3y agoIn ed (the one true editor - https://www.gnu.org/fun/jokes/ed-msg.en.html https://www.gnu.org/fun/jokes/ed-msg.en.html ), the way to do a command across a range of lines was: (1,$)g/re/command-list Global command. The global command makes two passes over the file. On the first pass, all the addressed lines matching a regular expression re are marked. Then, going sequentially from the beginning of the file to the end of the file, the given command-list is executed for each marked line, with the current address set to the address of that line. Any line modified by the command-list is unmarked. The final value of the current address is the value assigned by the last command in the last command-list executed. If there were no matching lines, the current address is unchanged. The execution of command-list stops on the first error. The command to print is: (.,.)p Prints the addressed lines. The current address is set to the address of the last line printed. And thus, `g/re/p` was the command to print all the lines in a file that matched a regular expression. grep predates the executable of the same name. perl, as a "useful than shell for sufficiently large programs" brought with it a large amount of the "how you do things in shell, awk, and sed" - which included grep. To a programmer in 1988, porting their shell script from sh (bash wasn't released for another year) to perl - keeping the same executable names as functions made a lot of sense. All that said, the keywords and jargon associated with particular programming languages are... well, jargon. It isn't meant to something easily understood but rather for two people who both know the same jargon a way of exchanging information more rapidly within a specific domain. That 'grep' isn't as understandable today is because the older jargon is less used and the domain has fractured into a multitude of other languages (the jargon of JavaScript programmers is sometimes inscrutable to me as a Java developer).
- tpoacher 3y agoWhat an incredible bit of trivia. I had no idea that's how grep got its name. Thank you for sharing!
- dolmen 3y agoJust one more Damian joke.