Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to re-factor
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01565967
Message ID:
01566075
Views:
56
>>>>Do you really think that the type of pattern used by, for example, Int.TryParse() does not have uses ?
>>>
>>>No, it has its place, I guess, but it could just as easily have returned an object with 2 properties. Not looking to restart a lengthy discussion on style. It is just my personal opinion and practice.
>>
>>I agree with you up to here, but why does TryParse need to return success of failure? I rather have it returning null if it fails and then no need of an output parameter (or an object with 2 properties), I just need to remember that my variable should be nullable.
>
>Starts to get messy if you don't *want* a nullable int ?

I guess it is in the eye of the beholder. For me the whole .NET thing is messy already and I have troubles calling it OO (but I won't go there, I had enough troubles with Martín Salias about this :)), where null is an object that nobody is scared of.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Reply
Map
View

Click here to load this message in the networking platform