Ce billet présente 8 erreurs régulièrement faites par les développeurs C#.
Voici la liste :
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

Commentaires

Vous devez vous inscrire ou vous connecter pour poster un commentaire