X# or C#?
Posted: Tue Oct 20, 2020 4:06 am
Hi Chris,
for that where I need to work with SubStr() in VO, I'm not interested if the string is shorter than my requested length, or even is null.
Using the .NET method, either I have to check all conditions before I execute the method, or I have to deal with exceptions in every line.
In VO, normally I encapsulate an entire method in a begin/end sequence and have my globally defined errorblock doing the work, whereas in X# I have to deal with exceptions at every level.
Let me explain better: often I have code that is executed from both a Windows service and a GUI application. When there something fails, the errorblock of the calling program is called - regardless if an errorbox has to be popped up or an email has to been sent.
In .NET I have to define an interface that has at least a "ProcessException()" method, and when an error is occurring in the common code, I have to execute that code. IMHO this is much more and, even worse, much more complicated code.
Slowly I'm learning in how many places I have to deal with exceptions - and throwing exceptions slows down the program.
But since we are all programmers, we are nearly to lawyers (ask 5 lawyers about a legal question and you will receive at least 7 different answers) - so I don't expect you will agree.
Generally I have to say that I like it working with the .NET Framework - but the exception handling is the thing I absolutely don't like.
Wolfgang
for that where I need to work with SubStr() in VO, I'm not interested if the string is shorter than my requested length, or even is null.
Using the .NET method, either I have to check all conditions before I execute the method, or I have to deal with exceptions in every line.
In VO, normally I encapsulate an entire method in a begin/end sequence and have my globally defined errorblock doing the work, whereas in X# I have to deal with exceptions at every level.
Let me explain better: often I have code that is executed from both a Windows service and a GUI application. When there something fails, the errorblock of the calling program is called - regardless if an errorbox has to be popped up or an email has to been sent.
In .NET I have to define an interface that has at least a "ProcessException()" method, and when an error is occurring in the common code, I have to execute that code. IMHO this is much more and, even worse, much more complicated code.
Slowly I'm learning in how many places I have to deal with exceptions - and throwing exceptions slows down the program.
But since we are all programmers, we are nearly to lawyers (ask 5 lawyers about a legal question and you will receive at least 7 different answers) - so I don't expect you will agree.
Generally I have to say that I like it working with the .NET Framework - but the exception handling is the thing I absolutely don't like.
Wolfgang