Даже для нас это перебор
Proposal: A built-in Go error check function, try We propose a new built-in function called try, designed specifically to eliminate the boilerplate if statements typically associated with error handling in Go. No other language changes are suggested. We advocate using the existing defer statement and standard library functions to help with augmenting or wrapping errors. This minimal approach addresses most common scenarios while adding very little complexity to the language. The try built-in is easy to explain, straightforward to implement, orthogonal to other language constructs, and fully backward-compatible. It also leaves open a path to extending the mechanism, should we wish to do so in the future. The try built-in function takes n+1 arguments (where n may be zero) where the last argument must be of type error. It returns the first n arguments (if any) if the (final) error argument is nil, otherwise it returns from the enclosing function with that error. For instance, code such as f, err := os.Open(filename) if err != nil { return ..., err // zero values for other results, if any } can be simplified to f := try(os.Open(filename)) Даже для нас это перебор
В посте предлагают добавить в язык Go встроенную функцию try, чтобы упростить многословную обработку ошибок. Внизу Pornhub отвечает: «Даже для нас это перебор», намекая, что предложение настолько чрезмерное и «грязное», что даже порнографический сайт считает его перебором. Мем используют как реакцию на слишком радикальную, нелепую или чрезмерно упрощающую идею в программировании. EN: The post proposes adding a built-in try function to Go to simplify verbose error handling. Pornhub replies at the bottom: “Even for us, this is too much,” implying that the proposal is so excessive and “dirty” that even a pornographic site considers it over the top. The meme is used as a reaction to an overly radical, absurd, or aggressively simplifying programming idea.
- @profunctor_io / 2319 2019-06-06
- Type
- image
- Size
- 800×800 · 88.0 KiB
- Mood
- саркастичный, абсурдный
- Language
- en
- Added