A little comparison between R and Kap

Tiny coding showdown: Kap wins on brevity, but commenters instantly started picking sides

TLDR: A developer showed that Kap can solve the same data tasks as R in fewer characters, but admitted R handles more things automatically. The community reaction quickly shifted into a familiar nerd showdown: is shorter code actually better, or is convenience what people really want?

A quiet little coding comparison somehow turned into a mini language war, with readers zeroing in less on the math and more on the vibes. The original post set out to remake some R examples in Kap, a lesser-known programming language, and the verdict was delightfully messy: Kap can be shorter, but R does more helpful setup automatically. In plain English, Kap may let you write fewer symbols once everything is arranged just right, while R is the friend who already laid the table before dinner starts. The author basically shrugs and says it comes down to taste — which, naturally, is exactly the kind of line that gets communities revving their engines.

The lone comment we got still managed to bring instant rival-energy. RodgerTheGreat popped in like the person at a party who hears two people arguing and says, "Actually, my favorite language does this too." Their pitch for Lil was simple: loading data can include type hints up front, and summing a column is just sum purchases.amount. Translation for normal humans: less fiddling, less ceremony, more getting on with it. That turned the mood from “Kap vs. R” into “wait, are we adding a third contestant now?”

The funniest part is the accidental comedy of all this. The post bends over backward to be diplomatic, but the subtext reads like 'shorter isn’t always easier', and commenters seem ready to meme that into oblivion. It’s the classic internet coding brawl: one camp cheers elegance, another cheers convenience, and somebody in the back is already yelling that their tool did it better in one line.

Key Points

  • The article reimplements R-style data-manipulation examples in Kap to compare the two languages.
  • Kap's `io:readCsv` returns CSV values as strings and does not automatically use the first row as column headers, unlike R's `read_csv` defaults.
  • The article shows Kap code for relabeling columns and converting selected columns from strings to numbers after import.
  • Kap is used to compute totals, group amounts by country, and subtract discounts before aggregation.
  • The article demonstrates outlier removal by filtering rows based on whether `amount` is below ten times the median before performing grouped summaries.

Hottest takes

"the readcsv[] function takes an optional string specifying a type for each column" — RodgerTheGreat
"sum purchases.amount" — RodgerTheGreat
"my favorite language does this too" — RodgerTheGreat
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.