3 ms·
Yes and? Do you not check return values? Pythons allows you to just yolo call a function lmao. It’s awful. You can NEVER guarantee behavior with Python. Never.
by asylteltine 3y ago
Yes and? Do you not check return values? Pythons allows you to just yolo call a function lmao. It’s awful. You can NEVER guarantee behavior with Python. Never. Go error checking is guaranteed to be either an error type or in the absolute worst case, a nil pointer panic.
- sgarland 3y agoThe question was "how can Go be ugly," which is subjective. I find Go's error handling verbose and ugly. Re: guaranteed behavior, correct me if I'm wrong, but for anything in stdlib, you'll either get the expected return value or an exception. For example, checking an array with str.isdigit() isn't undefined if the array has a None, it raises AttributeError. But yes, you can just yolo things and hope for the best, which is why it's a terrific scripting language. If you add typing and properly catch expected errors, it's quite capable. Whether or not Try/Except blocks are uglier than err is nil is subjective.