DSewhuk
Posts
-
Today's entry for the "kill it with fire" listmight get corrupted to equal, say 42. Code that didn't explicitly check consistently for "==true" would take the wrong path. if(flags[x]) would be true, if(flags[x]==true) would be false. Then you also get the VB true, which is -1! -
VS2017 looks like a clown factoryNot done until it doesn't work on Win 7 :laugh:
-
Unions in C#Most useful for hardware registers and even software registers. You can view register broadly via the long/int/short or via the fields contained within it. Save a copy: myCopyReg.bits = mySrcReg.bits. As a bonus your get a copy of the "undefined" bits. Beats myRegCopy.fld0 = myRegSrc.fld0; myRegCopy.fld1 = myRegSrc.fld1; myRegCopy.fld2 = myRegSrc.fld2; et. nauseum
-
Switch boolean.... (reinventing if, unnecessarily)If they had a default: case then I could almost see a reason. Consider the case if the bool was neither true or false. For most x86 C's there are 254 other trues and 65534 other trues on the DSP I code. I remember some very picky standards about what to do with unexpected values for space computing. Pesky alpha/beta/gamma particles flipping RAM cells around and the like. I have fixed my share of mixed boolean true logics gone bad. Is it a one, -1 or non-zero? If true == mySupposedBool can be very tricky to find in C when mySupposedBool = -1 from some other language interface. At least false seems to always == 0. ----- I love standards, there is so many to choose from!
-
WPF PerformanceI wish people didn't use list boxes for states. That is the worst way to select 50+ states with a mobile device using the iPhone spinner control or mouse. It is even worse when they lump our friends up north with New Brunswick in the states list! I punish you to live in NY and select NY from this abomination 1000 times. Lists boxes should not have more than 10 items. This should be taught in UI design 101. Thanks
Dave