|
Yeah, I can't find a reference to this anywhere aside from online forums. It would be neat if there's a way to disable it (like VB's option strict).
|
|
|
|
|
"In C#, you'd do this:"
Well i guess this is much better you know
string s = "blah" + ((i<<1)- --i);
modified 13-May-12 5:56am.
|
|
|
|
|
Uh, what. No you don't. String concatenation in C# automatically calls ToString on non-string arguments, including basic types. I use this quite frequently for generating temporary debug output.
|
|
|
|
|
I want to throw my computer off the roof. I'm modifying a 700+ line stored procedure and this is done a dozen+ times.
( CASE WHEN [SomeID] IN ( [batch of hardcoded, unique ids] )
THEN [hardcoded enum]
ELSE ( CASE WHEN [SomeID] IN ( [batch of hardcoded, unique ids] )
THEN [hardcoded enum]
ELSE ( CASE WHEN [SomeID] IN ( [batch of hardcoded, unique ids] )
THEN [hardcoded enum]
ELSE …etc…
END )
END )
END )
I …just…
|
|
|
|
|
public class SysAdmin : Employee
{
public override void DoWork(IWorkItem workItem)
{
if (workItem.User.Type == UserType.NoLearn){
throw new NoIWillNotFixYourComputerException(new Luser(workItem.User));
}else{
base.DoWork(workItem);
}
}
}
|
|
|
|
|
And I’ll probably get confronted for changing it. (I’m the new guy in the group.)
I think I’ll adopt a new saying: if you don’t respect my genius then you’ll fear my delete key!
|
|
|
|
|
sorry, i wanted to give you a 5, but clicked on the 4, so.. please, post again so i can give you another 5
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
|
|
|
|
|
|
I just posted "Really???" talking about a 790 line sproc. At least the original author seems to never have heard of CASE before.
I'm hoping the batches and enums were different each time. (doesn't make it any better.)
I'm not a fan of CASE, but I've just hit two updates in a row with minor changes that could be handled better with a few well placed CASE statements.
Peppered throughout this, it joins a field with 6 function calls to a passed tabular type, then to make extra sure, (s)he put in a matching where clause. I'm thinking that's 1.2 million function calls if there are 10K records in the table and 100 records in the passed table. Nope, it's only 600+K records. The join being mostly false, the WHERE will never be hit.
Anyway, I'm a new hire too. Expect some flack as well. If you're curious, see if what I posted beats your's. I think it did.
|
|
|
|
|
public void SettingDeviceList_ReAddingAPreviouslyDeletedDevice_MustAddDevicesToRuleDevicesWithIsDeletedFalseAndIsIncludedTrue()
{
return;
}
I feel like crying.
|
|
|
|
|
It's a bit of an anti-climax when you actually get to the code, isn't it?
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Yeah, its like climbing Rapunzel's tower to find out that she is actually a he.
|
|
|
|
|
In this case, she is actually a he, and he's an inflatable doll.
Software Zen: delete this;
|
|
|
|
|
|
Or finding out the hair you climbed was not the type of hair you anticipated.
|
|
|
|
|
All it's missing is an inline .
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Well, it will be inlined for sure by the compiler in release mode.
|
|
|
|
|
|
Zac Greve wrote: absolutely unreasonably ridiculously insanely crazy
private void absolutely_unreasonably_ridiculously_insanely_crazy()
{
return;
}
FTFY
Alberto Bar-Noy
---------------
“The city’s central computer told you? R2D2, you know better than to trust a strange computer!”
(C3PO)
|
|
|
|
|
Look on the bright side - it's broken up into easily manageable chunks by _'s
Imagine it was not...
|
|
|
|
|
egenis wrote: Imagine it was not... Using all lowercase.
|
|
|
|
|
In several languages.
Bill Gates is a very rich man today... and do you want to know why? The answer is one word: versions.
Dave Barry
Read more at BrainyQuote[ ^]
|
|
|
|
|
that person can make us pseudo code IDE, SDK everything, he just need some little motivation
|
|
|
|
|
Another bright side: you can harmlessly bypass the call
Function name decoration can also create nice monsters (you can face them when wrapping DLLs), but this is another story.
|
|
|
|
|
This looks to me like a unit testing attempt, similar to the recommendations in "The Art of Unit Testing" : featureundertest_when_expectation
Usually these methods are long, but they are supposed to be read like a sentence.
Make it simple, as simple as possible, but not simpler.
|
|
|
|