Exceptions represent a special case in many programs: they have their own execution path and the program can jump into this path any time. Is this ideal, though? This depends on the size of the try block (or whatever the name); this might cover several statements and debugging a runtime exception stops being fun quickly. A better way to achieve safe error handling could be to integrate errors in the results of a function call—a practice that can already be seen in C functions where the parameters do the data transfer and the return code indicates success/failure. Newer, more functional paradigms suggest something akin to the Result type in Rust—which comes with functions to elegantly deal with the various outcomes. This makes the errors an expected outcome of a function and enables smooth error handling without additional if conditions for...
United States
Great Britain
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Singapore
Hungary
Ukraine
Luxembourg
Estonia
Lithuania
South Korea
Turkey
Switzerland
Colombia
Taiwan
Chile
Norway
Ecuador
Indonesia
New Zealand
Cyprus
Denmark
Finland
Poland
Malta
Czechia
Austria
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Netherlands
Bulgaria
Latvia
South Africa
Malaysia
Japan
Slovakia
Philippines
Mexico
Thailand