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
United Kingdom
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Argentina
Austria
Belgium
Bulgaria
Chile
Colombia
Cyprus
Czechia
Denmark
Ecuador
Egypt
Estonia
Finland
Greece
Hungary
Indonesia
Ireland
Italy
Japan
Latvia
Lithuania
Luxembourg
Malaysia
Malta
Mexico
Netherlands
New Zealand
Norway
Philippines
Poland
Portugal
Romania
Singapore
Slovakia
Slovenia
South Africa
South Korea
Sweden
Switzerland
Taiwan
Thailand
Turkey
Ukraine