Ah, so it is like a wrapper enum, ok
contains the data type you want and err
the error object?
Ah, so it is like a wrapper enum, ok
contains the data type you want and err
the error object?
deleted
I know Java and I am learning C#, I don’t feel like I can just send a few hours and be at the same level as I am with Java. There are a lot of things I do not know or understand yet with C#.
Can’t say I agree. It feels like an almost even 50/50 split between Java and C# when I look at job postings.
If I except a boolean, there is an error and get a Result, is Result an object? How do I know if I get a bool or error?
If someone really wants this service but do not want to (or cannot) host it themself, https://ovpn.com offer this in their client. I used to have a pi-hole selfhosted but not anymore. Using their client on my phone as well solved the problem with blocking ads while not at home.
The difference being where you handle the error?
It sounds to me like Java works in kinda the same way. You either use
throws Exception
and require the caller to handle the exception when it occurs, or you handle it yourself and return whatever makes sense when that happens (or whatever you want to do before you do a return). The main difference being how the error is delivered.Java has class similar to Result called Optional.