- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
this.TraceOutput(string.Concat("\n\n\n", "Frist", "\n\n\n"));
Edit Admin
I cannot help but admire the vast amount of code in the last method --- devoted to looping through a string which is guaranteed to be exactly one character. Bravo!
Edit Admin
Microsoft's inclusion of Convert.ToX was a horrible mistake. It caused a massive amount of developers to use them, unaware of the better X.TryParse methods.
Admin
Looks like that mail variable is a global too, so once it is set it will always be set
Edit Admin
´´´this.´´´
This is pretty much always a dead giveaway that code was written by a Java dev.
Addendum 2025-03-06 09:52: And obviously the complete lack of understanding of the Dispose pattern makes it pretty likely that we are no talking about a c/C++ dev here, because it's a bread and butter COM pattern.
Edit Admin
@colejohnson66** ref
The Convert.ToX methods were in .Net from the original Framework 1.0. The Tryparse methods were a later addition, Framework 2.1 IIRC. MS would have needed a time machine to do it the other way.
But yes, once the TryParse. methods exist, there begins to be an argument for deprecating the Convert methods. Without delving into the source code details to assess performance, it may well be that the Convert methods are significantly faster for the happy path. Which would be reason enough not to deprecate them.