3 ms·
The more programming languages I use the less I care about this or that particular language and the more I think it comes down to the atomic level of good or ba
by voidhorse 5y ago
The more programming languages I use the less I care about this or that particular language and the more I think it comes down to the atomic level of good or bad features that are often available across different languages.
For example, I was writing some vimscript earlier today. Vimscript supports var-args in functions: bad idea. Dynamic type systems: generally a bad idea. Mixing declarative and imperative code: bad. Fancy comments/docstring systems (javadoc, python test): bad. Complicated type system features (e.g. dependent types): not necessarily bad but often unnecessary. Type casting: sometimes necessary but bad. Optional function arguments/arguments with default values: convenient but bad…
Basically any semantic element that increases the cognitive demand placed on the reader should be avoided. Circling back to varargs, they might be convenient when I’m writing a function initially, but they give readers no information, and it’s not uncommon at all that I have to go back and examine the precise details of how exactly I was using this or that vararg again.
Essentially, the more I program the more I think it’s best to use the simplest features possible and avoid anything fancy unless absolutely necessary, even when the fancy stuff is terser. This is part of what makes c, go, standard ml, scheme (even though I just knocked dynamic types) some of the best languages imo. Sure they are missing a lot of great writer-oriented features that programmers tend to drool over, but their absence is actually what makes these languages better.
- avindroth 5y agoJust to add some nuance: simplicity might be a boon for someone/company/industry working with multiple languages, but if you live in the, say, Java world, complexity may pay off for the native residents. For instance, natural languages develop all sorts of intricacies that are inconvenient for the learners, but expressive for the native residents. If the frequency of language usage is high, features of previously medium-level complexity become simpler and more “chunked”, due to how many times you have seen them (e.g. decorators in Python). So to Python residents, decorators are simple.