Why doesn't VB.NET use exception handling?

Possible duplicate:
Why are there no exceptions in .NET?

If I remember correctly, Java provides for catching and handling any exceptions that the called method may cause. Why doesn't .NET do the same?

+3
source share
3 answers

This function in Java is known as checked exceptions. Anders, the creator of C #, did an interview where he explained in detail why they were not included in C # and, therefore, VB.Net

, , VB.Net, , #, CLR , VB.Net . VB , . , CLR, , .

+11

, .

.

For example, if you are retrieving data from a database and there is a problem with obtaining data, the level of access to the data may not be the best solution to solve this problem. It might be better to allow an exception for bubbles to the level of business logic or the level of presentation, where relevant information can be displayed to the user.

In .Net, the general approach is to handle exceptions only if you can do something about it. And quite often, all you can do is provide the user with useful information.

+2
source

Source: https://habr.com/ru/post/1753937/


All Articles