If Err Nil Really That Bad
> Asks if 'if err != nil' is really that bad > Screenshot example shows accidental fallthrough from error case to success case Do we really need to discuss further? Kai Fall @kai_fall · 12 ч. is `if err != nil` really that bad? match atoi "6942" with | Error -> Printf.printf "failed to parse int\n" | Ok n -> Printf.printf "hello %d\n" n GO n, err := atoi("6942") if err != nil { fmt.Printf("failed to parse int\n") } fmt.Printf("hello %d\n", n)
The meme presents a sarcastic post asking whether Go's `if err != nil` pattern is really so bad. The accompanying example shows an error branch followed by a success print, making the criticism self-evident: the code continues after the error instead of stopping, so the joke is aimed at careless error handling and accidental fallthrough. EN: The meme presents a sarcastic post asking whether Go's `if err != nil` pattern is really so bad. The accompanying example shows an error branch followed by a success print, making the criticism self-evident: the code continues after the error instead of stopping, so the joke is aimed at careless error handling and accidental fallthrough.
computer code / компьютерный кодcode screenshot / скриншот кодаGo logo / логотип GoOCaml code / код OCamlerror message / сообщение об ошибкеsuccess message / сообщение об успехеtext post / текстовый постsocial media profile / профиль в соцсетиblack cat avatar / аватар с чёрной кошкойwhite background / белый фон
- @pokupkabitka / 46850 2024-12-21
- Type
- image
- Size
- 681×800 · 70.3 KiB
- Mood
- sarcastic
- Language
- en
- Added