Click here to Skip to main content
15,887,392 members
Home / Discussions / C#
   

C#

 
GeneralRe: Creating a 2 Dimension List<string> Pin
Luc Pattyn2-Jul-09 16:43
sitebuilderLuc Pattyn2-Jul-09 16:43 
GeneralRe: Creating a 2 Dimension List<string> Pin
PIEBALDconsult2-Jul-09 17:27
mvePIEBALDconsult2-Jul-09 17:27 
GeneralRe: Creating a 2 Dimension List<string> Pin
Luc Pattyn3-Jul-09 4:30
sitebuilderLuc Pattyn3-Jul-09 4:30 
AnswerRe: Creating a 2 Dimension List<string> Pin
Luc Pattyn2-Jul-09 16:37
sitebuilderLuc Pattyn2-Jul-09 16:37 
QuestionCreating batch file to install/uninstall C# app Pin
steve_rm2-Jul-09 15:11
steve_rm2-Jul-09 15:11 
AnswerRe: Creating batch file to install/uninstall C# app Pin
Arindam Sinha2-Jul-09 23:54
Arindam Sinha2-Jul-09 23:54 
QuestionIf (null == something) or if (something == null) Pin
_Maxxx_2-Jul-09 13:38
professional_Maxxx_2-Jul-09 13:38 
AnswerRe: If (null == something) or if (something == null) [modified] PinPopular
Luc Pattyn2-Jul-09 13:52
sitebuilderLuc Pattyn2-Jul-09 13:52 
Hi,

the origin is it protects you against a typo where you drop one equal sign; then constant=variable yields an error, whereas variable=constant may not (it wouldn't in C/C++, it most often would in C# unless the types are bool). (*)

However, I am with you, it does not look good, and any decent compiler would normally (there are exceptions conceivable) generate a WARNING message, either saying: "are you sure that is what you intend?" or "condition will always be true/false". However MS compilers seem not to do so.


[ADDED] (*) which is another good reason never to write things such as if (someBool==true)..., just write if (someBool) ....
[/ADDED]

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.

modified on Thursday, July 2, 2009 8:10 PM

AnswerRe: If (null == something) or if (something == null) Pin
Dave Doknjas2-Jul-09 14:15
Dave Doknjas2-Jul-09 14:15 
AnswerRe: If (null == something) or if (something == null) Pin
Thomas Weller2-Jul-09 14:18
Thomas Weller2-Jul-09 14:18 
AnswerRe: If (null == something) or if (something == null) Pin
PIEBALDconsult2-Jul-09 15:11
mvePIEBALDconsult2-Jul-09 15:11 
AnswerRe: If (null == something) or if (something == null) Pin
_Maxxx_2-Jul-09 18:03
professional_Maxxx_2-Jul-09 18:03 
GeneralRe: If (null == something) or if (something == null) Pin
Moim Hossain2-Jul-09 22:08
Moim Hossain2-Jul-09 22:08 
GeneralRe: If (null == something) or if (something == null) Pin
moon_stick3-Jul-09 1:03
moon_stick3-Jul-09 1:03 
GeneralRe: If (null == something) or if (something == null) Pin
PIEBALDconsult3-Jul-09 8:27
mvePIEBALDconsult3-Jul-09 8:27 
AnswerRe: If (null == something) or if (something == null) Pin
btough2-Jul-09 22:08
btough2-Jul-09 22:08 
QuestionDrawing a smooth line graph Pin
Rsesky0002-Jul-09 12:44
Rsesky0002-Jul-09 12:44 
AnswerRe: Drawing a smooth line graph Pin
Luc Pattyn2-Jul-09 12:58
sitebuilderLuc Pattyn2-Jul-09 12:58 
GeneralRe: Drawing a smooth line graph Pin
Rsesky0002-Jul-09 13:49
Rsesky0002-Jul-09 13:49 
GeneralRe: Drawing a smooth line graph [modified] Pin
Luc Pattyn2-Jul-09 13:54
sitebuilderLuc Pattyn2-Jul-09 13:54 
GeneralRe: Drawing a smooth line graph Pin
Rsesky0002-Jul-09 14:27
Rsesky0002-Jul-09 14:27 
QuestionBitmap Pixels in Bulk Pin
hpydir2-Jul-09 11:37
hpydir2-Jul-09 11:37 
AnswerRe: Bitmap Pixels in Bulk Pin
harold aptroot2-Jul-09 11:41
harold aptroot2-Jul-09 11:41 
AnswerRe: Bitmap Pixels in Bulk Pin
Svetlin Panayotov2-Jul-09 11:43
Svetlin Panayotov2-Jul-09 11:43 
GeneralRe: Bitmap Pixels in Bulk Pin
hpydir2-Jul-09 11:50
hpydir2-Jul-09 11:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.