Rust Is More Readable
funnily enough, rust is the most readable one they simply can't compete int calculate(int bottom, int top) { if (top > bottom) { auto even = [](auto e) { return e % 2 == 0; }; return ranges::accumulate( std::views::iota(bottom, top + 1) | std::views::filter(even), 0); } else { return 0; } } fn calculate(bottom: i32, top: i32) -> i32 { (bottom..=top) .filter(|e| e % 2 == 0) .sum() } int calculate(int bot, int top) { if (bot > top) return 0; bot = (bot + 1) & ~1; top = top & ~1; if (bot > top) return 0; return (((top - bot) >> 1) + 1) * (bot + top) / 2; }
A social media post compares three implementations of the same calculation: modern C++, Rust, and optimized C. The joke is that Rust is presented as the most readable and concise, while the C++ and especially the low-level C versions look increasingly complicated. It is a reaction meme for programming-language debates and playful superiority between developer communities.
code screenshot / скриншот кодаsocial media post / пост в соцсетиC++ logo / логотип C++Rust logo / логотип RustC logo / логотип Cblack code panel / чёрная панель с кодомwhite border / белая рамкаsyntax highlighting / подсветка синтаксисаprogramming function / функция программированияcomputer code / компьютерный код
- @gentoomemes / 18441 2025-08-28
- Type
- image
- Size
- 666×800 · 77.7 KiB
- Mood
- sarcastic, playful
- Language
- en
- Added