Rust lacks C-style else-while
Yeah, else-if is cool and all but does your Rust have the else-while construction that C had since 1970? Yeah, I don't think so if (new_size <= da->capacity) { da->count = new_size; } else while (new_size > da->capacity) { da->capacity *= 2; }
A programming joke compares Rust with C by mockingly presenting an “else while” construction as an advantage C has had since 1970. The punchline is that the shown C code uses an unusual but valid control-flow combination, teasing language enthusiasts who argue over syntax and features. EN: A programming joke compares Rust with C by mockingly presenting an “else while” construction as an advantage C has had since 1970. The punchline is that the shown C code uses an unusual but valid control-flow combination, teasing language enthusiasts who argue over syntax and features.
code screenshot / скриншот кодаcomputer code / программный кодblack background / чёрный фонdark gray code panel / тёмно-серая панель кодаyellow syntax highlighting / жёлтая подсветка синтаксисаwhite text / белый текстcurly braces / фигурные скобкиcomparison operators / операторы сравненияpointer operator / оператор указателяmemory capacity variable / переменная ёмкости памятиcount variable / переменная счётчикаwhile loop / цикл whileC programming language / язык программирования C
- @gentoomemes / 5171 2023-07-03
- Type
- image
- Size
- 800×449 · 63.2 KiB
- Mood
- sarcastic
- Language
- en
- Added