Clean Code or Shitposting
I can't distinguish 'clean code' from shitposting anymore. That's just 3 ifs. Don't you love #Rust? fn validate(&self) -> Result<()> { match ( self.recipe_template.contains(VAR_URL), self.recipe_template.contains(VAR_SHA), self.recipe_template.contains(VAR_VERSION), ) { (false, _, _) => bail!("missing URL variable"), (_, false, _) => bail!("missing SHA variable"), (_, _, false) => bail!("missing VERSION variable"), (_, _, _) => {} } Ok(()) }
A screenshot shows a humorous Rust code snippet using three if-like match conditions to validate missing variables. The joke is that the code is technically structured and idiomatic, yet absurdly overcomplicated for a simple check, making it hard to distinguish clean code from shitposting. It is shared as a reaction to overly elaborate programming, especially Rust code.
code screenshot / скриншот кодаRust logo-style hashtag / хэштег в стиле логотипа Rustcomputer code / программный кодblack background / чёрный фонwhite code panel / белая панель с кодомsocial media post / публикация в соцсетиprofile avatar / аватар профиляsyntax highlighting / подсветка синтаксисаtext caption / текстовая подпись
- @profunctor_io / 10022 2024-05-07
- Type
- image
- Size
- 800×741 · 78.9 KiB
- Mood
- саркастичный
- Language
- en
- Added