|
Advice:
Be as much in rage as you like but never forget to delete your curses in code [edit] before checking in[/edit]..
this could lead to some embarassing situations...
|
|
|
|
|
Hopefully, the output was not displayed to an end user, that is when it can get really embarassing.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
what an awful Imagination...
no, it was "only" in code behind...
but it´s really some sort of when a Team mate gives you advice to delete some codefragments because of possible discomfort...
|
|
|
|
|
Oh it's not imagination, I have known coders who thought they had removed some code with embarrassing output, but it made it into production code. Fortunately it was in a rarely accessed part of the code and we found it and got it fixed before end users actually saw it. I now keep telling fellow programmers to not put in in the code unless they want the end users to see it. Inevitably, some of that stuff will make it into production code.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
CIDev wrote: ...code with embarrassing Output...
cursing in code - [edit]but never with Output to the Client Interface[/edit] - is a way for me not to curse out loud..
i do this at home Office when i´m absolutely alone with myself and no one can hear me.
my cursings are definitely not for kid-sister´s ears nor for any others... (i tend to loose my political correctness e.g.)
so the only way for me to avoid instant embarrasing situations is when i curse silently in code...
bad Habit, i know...
|
|
|
|
|
Clodetta del Mar wrote: i curse silently in code...
I always thought that shouting and swearing at some stubborn code which insists on doing what I told it to, not what I want it to, was the only way to make it work!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i once thought that too, but after a short period of time i thought following the above described path would do the trick...
It doesn´t...
|
|
|
|
|
As long as the cursing is limited to the comments it is safe. Unless you show the source code to a client.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
Yes, my opinion, too.
i am convinced, that "distracting" output to the Client can be a reason for instant dismissal...
not good...
edit:
oh,no. as far as i´m concerned, no Client was/is/will be looking into the codebase...
|
|
|
|
|
Clodetta del Mar wrote: i was in rage
I am afraid I must deny this. To be exact, I did not notice anything, but it could be me.
~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
|
|
|
|
|
|
Clodetta del Mar wrote: i can´t even remember writing that class...
Maybe you didn't.
Maybe you left the office without locking the workstation and somebody did it for you. That recently became a tradition in my office.
|
|
|
|
|
|
Well, for me the case is clear: This class translates insults from german to english.. Well, only one, but hey! You can always add some derived classes!
|
|
|
|
|
if (_Framework.DuplexPlatform)
{
Synchronize.Visibility = Visibility.Visible;
}
{
Synchronize.Visibility = Visibility.Collapsed;
} *face-palm*
Software Zen: delete this;
|
|
|
|
|
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.
|
|
|
|
|
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!
Nowadays, about the most I will let myself get away with is:
if (value > maxRange) break; Everything else gets curly brackets
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;
|
|
|
|
|
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.
|
|
|
|
|
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!
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.
|
|
|
|
|
Me too, but a colleague uses different code formatting and he always auto-formats files so the one-line if-statements turn into 2-line if-statements (with no braces).
|
|
|
|
|
Ditto - also I am becoming a firm believer in white space being good in code as it makes it much easier to read.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
modified 13-Sep-13 8:23am.
|
|
|
|
|
That;s not insecurity - that's being a good developer.
I upvoted you just because its nice to find folk coding the same standards as me
MVVM # - I did it My Way
___________________________________________
Man, you're a god. - walterhevedeich 26/05/2011
.\\axxx
(That's an 'M')
|
|
|
|