3 ms·
K +/!100 Python sum(range(100)) Haskell sum [0..99] Rust (0..100).sum() Ruby (0..99).sum There are plenty of ultra-concise languag
by Veedrac 7y ago
K +/!100
Python sum(range(100))
Haskell sum [0..99]
Rust (0..100).sum()
Ruby (0..99).sum
There are plenty of ultra-concise languages for toy problems like these; they are called ‘golfing languages’. Ultimately it's a bit pointless since most of the time people aren't playing code golf.
(The issue with setting everything to obscure ultra-compressed keywords isn't that it's not possible to learn those keywords, but that most of the time programming is done over specific and customized domains with larger and problem-specific vocabularies.)
- bryanrasmussen 7y agoWell I guess I agree with this statement, except that I don't think K is primarily used for solving toy problems.
- Kwantuum 7y agoExcept in K all the idioms are laid flat. As pointed out in the article, the K code is the equivalent of range(100).reduce(operator.add), it encapsulates the entire meaning, there is no need for an intermediate function definition because that would be longer than the code itself.
- satokema 7y agoThe article's point is a meta-point. Congratulations on actually being part of the meme in the article.
- brazzy 7y agoThe article's point is dishonest smugassery. Congratulations on convincing people to avoid K for its community, if not the language itself.
- lolc 7y agoThat's what I'm wondering with K! What happens once I want to abstract over the basic operations?