4 ms·
I know people hate language wars and always reply with “Use the best language for the job.” but wouldn’t it be great if there was a language that could do it a
by worrycue 5y ago
I know people hate language wars and always reply with “Use the best language for the job.” but wouldn’t it be great if there was a language that could do it all optimally (or at least adequately).
Then we can focus on just one language to master and don’t have to keep in our heads a jumble of languages.
- hpoe 5y agoWe already have that language but people keeping getting whiny about parentheses, and refuse to use it.
- Nadya 5y agoBasically any modern, turing-complete, and non-esoteric (eg. Brainfuck) language fulfills the "at least adequately" part. So it comes down largely to preference and style of the language itself. I can't stand C# code or that the language uses Allman style over K&R because I truly find Allman style more difficult to read. I shouldn't - the difference is very minor - and although I work with a C# codebase in my day-to-day work I always struggle parsing the code quickly compared to languages where K&R style won out. Now "optimally" is an entire can of worms because there are some aspects where you need to make mutually exclusive choices. You can optimize A or B but not A and B for multiple sets of A and B. So you'll end up with multiple languages or multiple flavors of a single language where decisions were made to optimize for varying sets of A and B. A and B can even be simple things like "How easy is it to footgun yourself?". Should you make code that is more boilerplate/difficult to write in order to prevent people from footgunning themselves or do you expect your developers to be more experienced and allow them to write more succinct code but having to be aware of and avoid potential footguns themselves? There are a lot of domain-specific languages for precisely the kinds of trade-offs are made that certain fields want/need. For example, mathematics domain languages tend to be 1-indexed instead of 0-indexed. By the way that language is LISP. [0] Just in case anyone is unfamiliar with Allman/K&R styles mentioned you can see examples on Wikipedia: https://en.wikipedia.org/wiki/Indentation_style https://en.wikipedia.org/wiki/Indentation_style