Skip to main content
exception spelling
Source Link
sergiol
  • 4.4k
  • 5
  • 52
  • 92

C# + CLR:

  1. Thread.MemoryBarrier: Most people wouldn't have used thisit and there is some inaccurate information on MSDN. But if you know intricacies then you can do nifty lock-free synchronization.

  2. volatile, Thread.VolatileRead, Thread.VolatileWrite: There are very very few people who gets the use of these and even fewer who understands all the risks they avoid and introduce :).

  3. ThreadStatic variables: There was only one situation in past few years I've found that ThreadStatic variables were absolutely god send and indispensable. When you want to do something for entire call chain, for example, they are very useful.

  4. fixed keyword: It's a hidden weapon when you want to make access to elements of large array almost as fast as C++ (by default C# enforces bound checks that slows down things).

  5. default(typeName) keyword can be used outside of generic class as well. It's useful to create empty copy of struct.

  6. One of the handy feature I use is DataRow[columnName].ToString() always returns non-null value. If value in database was NULL, you get empty string.

  7. Use Debugger object to break automatically when you want developer's attention even if s/he hasn't enabled automatic break on eceptionexception:

 #if DEBUG if (Debugger.IsAttached) Debugger.Break(); #endif 
  1. You can alias complicated ugly looking generic types so you don't have to copy paste them again and again. Also you can make changes to that type in one place. For example,
 using ComplicatedDictionary = Dictionary<int, Dictionary<string, object>>; ComplicatedDictionary myDictionary = new ComplicatedDictionary(); 

C# + CLR:

  1. Thread.MemoryBarrier: Most people wouldn't have used this and there is some inaccurate information on MSDN. But if you know intricacies then you can do nifty lock-free synchronization.

  2. volatile, Thread.VolatileRead, Thread.VolatileWrite: There are very very few people who gets the use of these and even fewer who understands all the risks they avoid and introduce :).

  3. ThreadStatic variables: There was only one situation in past few years I've found that ThreadStatic variables were absolutely god send and indispensable. When you want to do something for entire call chain, for example, they are very useful.

  4. fixed keyword: It's a hidden weapon when you want to make access to elements of large array almost as fast as C++ (by default C# enforces bound checks that slows down things).

  5. default(typeName) keyword can be used outside of generic class as well. It's useful to create empty copy of struct.

  6. One of the handy feature I use is DataRow[columnName].ToString() always returns non-null value. If value in database was NULL, you get empty string.

  7. Use Debugger object to break automatically when you want developer's attention even if s/he hasn't enabled automatic break on eception:

 #if DEBUG if (Debugger.IsAttached) Debugger.Break(); #endif 
  1. You can alias complicated ugly looking generic types so you don't have to copy paste them again and again. Also you can make changes to that type in one place. For example,
 using ComplicatedDictionary = Dictionary<int, Dictionary<string, object>>; ComplicatedDictionary myDictionary = new ComplicatedDictionary(); 

C# + CLR:

  1. Thread.MemoryBarrier: Most people wouldn't have used it and there is some inaccurate information on MSDN. But if you know intricacies then you can do nifty lock-free synchronization.

  2. volatile, Thread.VolatileRead, Thread.VolatileWrite: There are very very few people who gets the use of these and even fewer who understands all the risks they avoid and introduce :).

  3. ThreadStatic variables: There was only one situation in past few years I've found that ThreadStatic variables were absolutely god send and indispensable. When you want to do something for entire call chain, for example, they are very useful.

  4. fixed keyword: It's a hidden weapon when you want to make access to elements of large array almost as fast as C++ (by default C# enforces bound checks that slows down things).

  5. default(typeName) keyword can be used outside of generic class as well. It's useful to create empty copy of struct.

  6. One of the handy feature I use is DataRow[columnName].ToString() always returns non-null value. If value in database was NULL, you get empty string.

  7. Use Debugger object to break automatically when you want developer's attention even if s/he hasn't enabled automatic break on exception:

 #if DEBUG if (Debugger.IsAttached) Debugger.Break(); #endif 
  1. You can alias complicated ugly looking generic types so you don't have to copy paste them again and again. Also you can make changes to that type in one place. For example,
 using ComplicatedDictionary = Dictionary<int, Dictionary<string, object>>; ComplicatedDictionary myDictionary = new ComplicatedDictionary(); 
Escaped < with &lt;
Source Link
dso
  • 9.6k
  • 10
  • 56
  • 59

C# + CLR:

  1. Thread.MemoryBarrier: Most people wouldn't have used this and there is some inaccurate information on MSDN. But if you know intricacies then you can do nifty lock-free synchronization.

  2. volatile, Thread.VolatileRead, Thread.VolatileWrite: There are very very few people who gets the use of these and even fewer who understands all the risks they avoid and introduce :).

  3. ThreadStatic variables: There was only one situation in past few years I've found that ThreadStatic variables were absolutely god send and indispensable. When you want to do something for entire call chain, for example, they are very useful.

  4. fixed keyword: It's a hidden weapon when you want to make access to elements of large array almost as fast as C++ (by default C# enforces bound checks that slows down things).

  5. default(typeName) keyword can be used outside of generic class as well. It's useful to create empty copy of struct.

  6. One of the handy feature I use is DataRow[columnName].ToString() always returns non-null value. If value in database was NULL, you get empty string.

  7. Use Debugger object to break automatically when you want developer's attention even if s/he hasn't enabled automatic break on eception:

 #if DEBUG if (Debugger.IsAttached) Debugger.Break(); #endif 
  1. You can alias complicated ugly looking generic types so you don't have to copy paste them again and again. Also you can make changes to that type in one place. For example,
 using ComplicatedDictionary = Dictionary>;Dictionary<int, Dictionary<string, object>>; ComplicatedDictionary myDictionary = new ComplicatedDictionary(); 

C# + CLR:

  1. Thread.MemoryBarrier: Most people wouldn't have used this and there is some inaccurate information on MSDN. But if you know intricacies then you can do nifty lock-free synchronization.

  2. volatile, Thread.VolatileRead, Thread.VolatileWrite: There are very very few people who gets the use of these and even fewer who understands all the risks they avoid and introduce :).

  3. ThreadStatic variables: There was only one situation in past few years I've found that ThreadStatic variables were absolutely god send and indispensable. When you want to do something for entire call chain, for example, they are very useful.

  4. fixed keyword: It's a hidden weapon when you want to make access to elements of large array almost as fast as C++ (by default C# enforces bound checks that slows down things).

  5. default(typeName) keyword can be used outside of generic class as well. It's useful to create empty copy of struct.

  6. One of the handy feature I use is DataRow[columnName].ToString() always returns non-null value. If value in database was NULL, you get empty string.

  7. Use Debugger object to break automatically when you want developer's attention even if s/he hasn't enabled automatic break on eception:

 #if DEBUG if (Debugger.IsAttached) Debugger.Break(); #endif 
  1. You can alias complicated ugly looking generic types so you don't have to copy paste them again and again. Also you can make changes to that type in one place. For example,
 using ComplicatedDictionary = Dictionary>; ComplicatedDictionary myDictionary = new ComplicatedDictionary(); 

C# + CLR:

  1. Thread.MemoryBarrier: Most people wouldn't have used this and there is some inaccurate information on MSDN. But if you know intricacies then you can do nifty lock-free synchronization.

  2. volatile, Thread.VolatileRead, Thread.VolatileWrite: There are very very few people who gets the use of these and even fewer who understands all the risks they avoid and introduce :).

  3. ThreadStatic variables: There was only one situation in past few years I've found that ThreadStatic variables were absolutely god send and indispensable. When you want to do something for entire call chain, for example, they are very useful.

  4. fixed keyword: It's a hidden weapon when you want to make access to elements of large array almost as fast as C++ (by default C# enforces bound checks that slows down things).

  5. default(typeName) keyword can be used outside of generic class as well. It's useful to create empty copy of struct.

  6. One of the handy feature I use is DataRow[columnName].ToString() always returns non-null value. If value in database was NULL, you get empty string.

  7. Use Debugger object to break automatically when you want developer's attention even if s/he hasn't enabled automatic break on eception:

 #if DEBUG if (Debugger.IsAttached) Debugger.Break(); #endif 
  1. You can alias complicated ugly looking generic types so you don't have to copy paste them again and again. Also you can make changes to that type in one place. For example,
 using ComplicatedDictionary = Dictionary<int, Dictionary<string, object>>; ComplicatedDictionary myDictionary = new ComplicatedDictionary(); 
added 256 characters in body; added 42 characters in body; deleted 18 characters in body
Source Link
Shital Shah
  • 69.9k
  • 21
  • 258
  • 202

C# + CLR:

  1. Thread.MemoryBarrier: Most people wouldn't have used this and there is some inaccurate information on MSDN. But if you know intricacies then you can do nifty lock-free synchronization.

  2. volatile, Thread.VolatileRead, Thread.VolatileWrite: There are very very few people who gets the use of these and even fewer who understands all the risks they avoid and introduce :).

  3. ThreadStatic variables: There was only one situation in past few years I've found that ThreadStatic variables were absolutely god send and indispensable. When you want to do something for entire call chain, for example, they are very useful.

  4. fixed keyword: It's a hidden weapon when you want to make access to elements of large array almost as fast as C++ (by default C# enforces bound checks that slows down things).

  5. default(typeName) keyword can be used outside of generic class as well. It's useful to create empty copy of struct.

  6. One of the handy feature I use is DataRow[columnName].ToString() always returns non-null value. If value in database was NULL, you get empty string.

  7. You can alias complicated ugly looking generic types so you don't haveUse Debugger object to copy paste them again and again. Alsobreak automatically when you can make changes to that type in one place. For example,want developer's attention even if s/he hasn't enabled automatic break on eception:

using ComplicatedDictionary = Dictionary<int, Dictionary<string, object>>; ComplicatedDictionary myDictionary = new ComplicatedDictionary();

 #if DEBUG if (Debugger.IsAttached) Debugger.Break(); #endif 
  1. You can alias complicated ugly looking generic types so you don't have to copy paste them again and again. Also you can make changes to that type in one place. For example,
 using ComplicatedDictionary = Dictionary>; ComplicatedDictionary myDictionary = new ComplicatedDictionary(); 

C# + CLR:

  1. Thread.MemoryBarrier: Most people wouldn't have used this and there is some inaccurate information on MSDN. But if you know intricacies then you can do nifty lock-free synchronization.

  2. volatile, Thread.VolatileRead, Thread.VolatileWrite: There are very very few people who gets the use of these and even fewer who understands all the risks they avoid and introduce :).

  3. ThreadStatic variables: There was only one situation in past few years I've found that ThreadStatic variables were absolutely god send and indispensable. When you want to do something for entire call chain, for example, they are very useful.

  4. fixed keyword: It's a hidden weapon when you want to make access to elements of large array almost as fast as C++ (by default C# enforces bound checks that slows down things).

  5. default(typeName) keyword can be used outside of generic class as well. It's useful to create empty copy of struct.

  6. One of the handy feature I use is DataRow[columnName].ToString() always returns non-null value. If value in database was NULL, you get empty string.

  7. You can alias complicated ugly looking generic types so you don't have to copy paste them again and again. Also you can make changes to that type in one place. For example,

using ComplicatedDictionary = Dictionary<int, Dictionary<string, object>>; ComplicatedDictionary myDictionary = new ComplicatedDictionary();

C# + CLR:

  1. Thread.MemoryBarrier: Most people wouldn't have used this and there is some inaccurate information on MSDN. But if you know intricacies then you can do nifty lock-free synchronization.

  2. volatile, Thread.VolatileRead, Thread.VolatileWrite: There are very very few people who gets the use of these and even fewer who understands all the risks they avoid and introduce :).

  3. ThreadStatic variables: There was only one situation in past few years I've found that ThreadStatic variables were absolutely god send and indispensable. When you want to do something for entire call chain, for example, they are very useful.

  4. fixed keyword: It's a hidden weapon when you want to make access to elements of large array almost as fast as C++ (by default C# enforces bound checks that slows down things).

  5. default(typeName) keyword can be used outside of generic class as well. It's useful to create empty copy of struct.

  6. One of the handy feature I use is DataRow[columnName].ToString() always returns non-null value. If value in database was NULL, you get empty string.

  7. Use Debugger object to break automatically when you want developer's attention even if s/he hasn't enabled automatic break on eception:

 #if DEBUG if (Debugger.IsAttached) Debugger.Break(); #endif 
  1. You can alias complicated ugly looking generic types so you don't have to copy paste them again and again. Also you can make changes to that type in one place. For example,
 using ComplicatedDictionary = Dictionary>; ComplicatedDictionary myDictionary = new ComplicatedDictionary(); 
deleted 2 characters in body
Source Link
Shital Shah
  • 69.9k
  • 21
  • 258
  • 202
Loading
added 71 characters in body; added 159 characters in body
Source Link
Shital Shah
  • 69.9k
  • 21
  • 258
  • 202
Loading
Post Made Community Wiki
Source Link
Shital Shah
  • 69.9k
  • 21
  • 258
  • 202
Loading