Sign in
jaredpar's WebLog
Code, rants and ramblings of a programmer.
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Tags
Active Object
Anonymous Types
API Design
await
BclExtras
Blogging
Books
C#
C++
Closures
CLR
CodeDom
Debugging
Developing
DotNet
EESdk
Evil
Exceptions
Expression Evaluator
Extension Methods
F#
Functional
Futures
FxCop
Generics
Gotcha
Humor
IMetaDataImport
Immutable
ISynchronizeInvoke
Lambda
LINQ
LUA
MEF
Misc
Orcas
Patterns
Performance
PInvoke
PowerShell
Rant
RantPack
Refactoring
Regex
Security
SEH
SynchronizationContext
Talks
Templates
Testing
Threading
Tuple
Type Inference
VB
Visual Studio
VsVim
WinForms
Wow64
Browse by Tags
MSDN Blogs
>
jaredpar's WebLog
>
All Tags
>
exceptions
Tagged Content List
Blog Post:
Do not throw a NullReferenceException when validing “this” in an extension method
JaredPar MSFT
One pattern I’ve started running into is developers explicitly throwing a NullReferenceException when validating the “this” parameter of an extension method. public static void ForEach<T>( this IEnumerable <T> enumerable, Action <T> action) { if ( null == enumerable) { throw...
on
28 Jun 2010
Blog Post:
The File System is unpredictable
JaredPar MSFT
One of the more frequent questions I answer on StackOverflow is a variation of the following. I’m doing XXX with a file, how can I know if the file exists? The variations include verify no one else has the file open, if the file is in use, the file is not writable, etc …. The answer to all...
on
10 Dec 2009
Blog Post:
NotImplementedException vs. NotSupportedException
JaredPar MSFT
In responding to a recent blog post , one of the readers, Jeremy Gray, noted that I was using a NotImplementedException where I should have been using a NotSupportedException . At first I did not agree. There was a method on an interface which my underlying object could not implement therefore...
on
12 Dec 2008
Blog Post:
When can you catch a StackOverflowException?
JaredPar MSFT
Answer: When you're the one who threw it. Starting with the CLR version 2.0, the policy for handling a StackOverflowException was changed. User code can no longer handle the exception[1]. Instead the CLR will simply terminate the process. This is not 100% true though. User...
on
22 Oct 2008
Blog Post:
Custom Exceptions: When should you create them?
JaredPar MSFT
I think the best answer is: rarely. It's really hard to go straight to a justification here though. I find that answering a different question will eventually shed led on when to create a new exception. "What are the benefits of creating a new/custom exception?" The answers...
on
20 Oct 2008
Page 1 of 1 (5 items)