3 ms·
Not that reserved keywords are the only measure of a well designed language, but it is interesting to note that Golang has 25 (which most likely contributes to
by rcaught 7y ago
Not that reserved keywords are the only measure of a well designed language, but it is interesting to note that Golang has 25 (which most likely contributes to the feeling of fluency earlier than many languages). Java has 50 and C++ has 82 keywords for comparison.
- nnq 7y agoThe human brain has no problem handling a 70k+ vocabulary of a natural language, just saying... until a language goes over a few thousand reserved words I'd say there's no adverse effect to them as long as they are clearly named/prefixed etc. in ways that don't conflict with frequently used words (and we know we can have sigils like $ for namespacing, # for separating function names from variable names etc. etc.
- codegladiator 7y agoYet very few can write an enjoyable novel which others can read. Try reading documentations to see how the 70k+ vocabulary helped the writer and reader. Sigils like $ and # are even worse. I had to maintain an old perl codebase once (# @_ holds all arguments passed)
- nnq 7y agoNever worked professionally on a Perl codebase but I kind of liked it when I learned a tidbit and feel a bit nostalgic that it went out of fashion :P
- codegladiator 7y agoTry reading this Date module (which is very cleanly written compared to the codebase which I was supposed to maintain) https://github.com/mojolicious/mojo/blob/master/lib/Mojo/Date.pm https://github.com/mojolicious/mojo/blob/master/lib/Mojo/Dat... I just find it impossible to glance over it and understand whats happening even though I know what is supposed to be happening there. Something similar in golang https://github.com/araddon/dateparse/blob/master/parseany.go https://github.com/araddon/dateparse/blob/master/parseany.go
- nnq 7y agoHmm, that Perl code seems quite irregular / badly structured, I see some regexps are inline while others in named variables, no clear docs of what is the return of functions etc. Beside that, the extra clarity in Go is from using a static language. Also, Perl is inexcusable for having no readable function signatures, that's really a no-go for a modern language :| But for me at least, when I see that wall of boilerplatish Go code, my mind instantly ADHDs away, while those dense squiggles of Perl make me WANT to spend time and focus and solve the puzzle of what they do, I have 10x more chances of paying attention to the Perl code while reading it and maybe even spotting a bug in it :P ...
- ihnorton 7y agoWe have an entire profession built around the often-vain attempt to clarify and resolve ambiguities in the use of those 70k+ words: law.