parsing

c#

TryParse and the Exception Tax

In .NET 1.1, TryParse is only available for the Double datatype. Version 2.0 of the framework extends TryParse to all the basic datatypes. Why do we care? Performance. Parse throws an exception if the conversion from a string to the specified datatype fails, whereas TryParse explicitly avoids throwing

By Jeff Atwood ·
Comments

parsing

Parsing: Beyond Regex

I’ve blogged ad nauseam about how much I love Regular Expressions, but even the mighty regular expression has limits. As noted in Daniel Cazzulini’s blog: A full-blown programming language cannot be parsed with regular expressions. But given the limited number of programming languages (successful ones, let’s say)

By Jeff Atwood ·
Comments