If statement in one line?

especially that code from the matrix, that stuff doesn't even follow a pattern ek se!
 
I'm far from being an expert on .NET, but doesn't using master pages have a negative SEO affect, or is there a way to change the meta tags per page?
 
I couldtell you the story of the "experienced" guy who used a temp database table to sort a stringlist but it would make you cry.
 
Starting a thread with the worst code you've ever seen will help millions of coders improve their skill and developing style!

I vote for the idee! :D
 
I couldtell you the story of the "experienced" guy who used a temp database table to sort a stringlist but it would make you cry.
lol, looks like I got some competition with the most wack code ever!
 
^^ i was trying to show first variable will the true part, after ":" is the false part. But yes, should have probably wrote it out.
 
In C/C++ you don't need to assign a result. So this is valid as well:
Code:
//C/C++
int x=5, y;
x>10 ? y = 3 : y=2; //Don't assign this to anything

//C#
y = x>10 ? 3 : 2

And then y would be 2. The results don't even have to have the same type. This is OK as well:
Code:
//C/C++
x>5 ? y = 3 : printf("Hello"); //Sometimes an int, other times just Hello

//C#
//Not allowed

You can do all sorts of crazy stuff with just ? :, I guess that's why C# doesn't allow it.
 
Top
Sign up to the MyBroadband newsletter
X