8 Most common mistakes C# developers could make

source: 8 Most common mistakes C# developers make

1. String concatenation instead of StringBuilder

2. LINQ – ‘Where’ with ‘First’ instead of FirstOrDefault

3. Casting by means of ‘(T)’ instead of ‘as (T)’ when possibly not castable

4. Not using mapping for rewriting properties

5. Incorrect exceptions re-throwing

6. Not using ‘using’ for objects disposal

7. Using ‘foreach’ instead of ‘for’ for anything else than collections

8. Retrieving or saving data to DB in more than 1 call

Even though I disagree for some of these, I thought this might be good for some beginner or  intermediate level developers.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s