What's missing?
-
I'm one of those insecure types who always uses braces, unless the
if()
fits on a single line.Software Zen:
delete this;
So am I, because I got caught before, back in my early C days...and it took ages to work out what the heck I had done wrong! :-O Nowadays, about the most I will let myself get away with is:
if (value > maxRange) break;
Everything else gets curly brackets :laugh:
This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
-
So am I, because I got caught before, back in my early C days...and it took ages to work out what the heck I had done wrong! :-O Nowadays, about the most I will let myself get away with is:
if (value > maxRange) break;
Everything else gets curly brackets :laugh:
This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
Do you fully parenthesize too? I'm lazy, and never want to remember the precedence rules.
Software Zen:
delete this;
-
Do you fully parenthesize too? I'm lazy, and never want to remember the precedence rules.
Software Zen:
delete this;
Not always: I'm happy with
if (a == 1 && b == 2)
But I'd use em for
if (a == 1 && (b == 2 || c == 3))
Or
if ((a == 1 && b == 2) || c == 3)
Just to make it obvious what I meant.
This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
-
if (_Framework.DuplexPlatform)
{
Synchronize.Visibility = Visibility.Visible;
}
{
Synchronize.Visibility = Visibility.Collapsed;
}*face-palm*
Software Zen:
delete this;
Mandatory code fix post - Why you not do inline:
Synchronize.Visibility = _Framework.DuplexPlatform ?
Visibility.Visible : Visibility.Collapsed;:-D
speramus in juniperus
-
Mandatory code fix post - Why you not do inline:
Synchronize.Visibility = _Framework.DuplexPlatform ?
Visibility.Visible : Visibility.Collapsed;:-D
speramus in juniperus
I posted a summarized fragment.
Software Zen:
delete this;
-
:laugh: I have gone the other way too many times, relying on the indentation...
if (_Framework.DuplexPlatform)
Synchronize.Visibility = Visibility.Visible;
Synchronize.Visibility = Visibility.Collapsed;This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
A colleague of mine is rather fond of not using {} - even over several levels, i.e.
if (...)
if (...)
for (...)
if ()
doSomething();
doSomeOtherthing();That's why I use the
Edit - Advanced - Format Document
feature of Visual Studio very often... -
A colleague of mine is rather fond of not using {} - even over several levels, i.e.
if (...)
if (...)
for (...)
if ()
doSomething();
doSomeOtherthing();That's why I use the
Edit - Advanced - Format Document
feature of Visual Studio very often...You threw me there for a moment - I use CTRL+K, D (which does the same thing) :laugh:
This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
-
A colleague of mine is rather fond of not using {} - even over several levels, i.e.
if (...)
if (...)
for (...)
if ()
doSomething();
doSomeOtherthing();That's why I use the
Edit - Advanced - Format Document
feature of Visual Studio very often...wow, that's... that's horrible
-
I'm one of those insecure types who always uses braces, unless the
if()
fits on a single line.Software Zen:
delete this;
-
A colleague of mine is rather fond of not using {} - even over several levels, i.e.
if (...)
if (...)
for (...)
if ()
doSomething();
doSomeOtherthing();That's why I use the
Edit - Advanced - Format Document
feature of Visual Studio very often...Seen a couple of those in an older code base :) Wasn't always a happy debugging experience :)
-
A colleague of mine is rather fond of not using {} - even over several levels, i.e.
if (...)
if (...)
for (...)
if ()
doSomething();
doSomeOtherthing();That's why I use the
Edit - Advanced - Format Document
feature of Visual Studio very often...That's really awful! In our company we altogether made a programming styleguide and {} has to used everytime (and it has to follow the structure and shall not be places on the next line). I like this styleguide! We have good readable code everywhere now. :rolleyes:
SharePoint Consultant and Developer at acocon Author of Primary ROleplaying SysTem I'm the ninth in a row of seven!
-
That's really awful! In our company we altogether made a programming styleguide and {} has to used everytime (and it has to follow the structure and shall not be places on the next line). I like this styleguide! We have good readable code everywhere now. :rolleyes:
SharePoint Consultant and Developer at acocon Author of Primary ROleplaying SysTem I'm the ninth in a row of seven!
ihoecken wrote:
shall not be places on the next line
Philistine! Allman style[^] is the only way to go. ;P And while we're at it, it's tabs every time. Anyone who uses spaces to indent their code shall be shot.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
ihoecken wrote:
shall not be places on the next line
Philistine! Allman style[^] is the only way to go. ;P And while we're at it, it's tabs every time. Anyone who uses spaces to indent their code shall be shot.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Richard Deeming wrote:
Philistine!
And proud about it!
Richard Deeming wrote:
Allman style[^] is the only way to go.
Eh. In my eyes it's ridiculous. Thousand lines between the code that make it unreadable. X|
Richard Deeming wrote:
And while we're at it, it's tabs every time. Anyone who uses spaces to indent their code shall be shot.
Agree! :thumbsup:
SharePoint Consultant and Developer at acocon Author of Primary ROleplaying SysTem I'm the ninth in a row of seven!
-
Not always: I'm happy with
if (a == 1 && b == 2)
But I'd use em for
if (a == 1 && (b == 2 || c == 3))
Or
if ((a == 1 && b == 2) || c == 3)
Just to make it obvious what I meant.
This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
-
if (_Framework.DuplexPlatform)
{
Synchronize.Visibility = Visibility.Visible;
}
{
Synchronize.Visibility = Visibility.Collapsed;
}*face-palm*
Software Zen:
delete this;
Now I see: it is a ";" - and nothing else:
if (_Framework.DuplexPlatform) ; // <= here the ; was missing
{
Synchronize.Visibility = Visibility.Visible;
}
{
Synchronize.Visibility = Visibility.Collapsed;
} -
A colleage of mine always does if ((a == 1) && (b == 2)) while I always do if (i < (n - 1)) Fortunately regarding other styles we use the same format.
The good thing about pessimism is, that you are always either right or pleasently surprised.
Fortunately C# cured me of that one - it won't let you write
if (1 && 2)
Because that applies a boolean operation to two integers, so there is no confusion possible with
if (a == 1 && b == 2)
But in C and C++, I used to use the brackets as well! :laugh:
This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre. Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
-
Now I see: it is a ";" - and nothing else:
if (_Framework.DuplexPlatform) ; // <= here the ; was missing
{
Synchronize.Visibility = Visibility.Visible;
}
{
Synchronize.Visibility = Visibility.Collapsed;
}:laugh:
Software Zen:
delete this;
-
if (_Framework.DuplexPlatform)
{
Synchronize.Visibility = Visibility.Visible;
}
{
Synchronize.Visibility = Visibility.Collapsed;
}*face-palm*
Software Zen:
delete this;
What else would be missing? :-\
Keep Clam And Proofread -- √(-1) 23 ∑ π... And it was delicious.
-
if (_Framework.DuplexPlatform)
{
Synchronize.Visibility = Visibility.Visible;
}
{
Synchronize.Visibility = Visibility.Collapsed;
}*face-palm*
Software Zen:
delete this;
-
A code review ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus Do not feed the troll ! - Common proverb
Given that this product consists of over 1.2 million lines of code (that was the count two years ago), it's a variant of four products built from the same code base, and they're all maintained by the same group of six overworked developers, who has time for code reviews? The good news is our testers found the problem.
Software Zen:
delete this;