Never knew I was so OCD about code
-
Write some code
public void SomeMethod()
{
// do some things
Method1();
bool valid = Method2();if (valid) { Method3(); Method4(); // valid responses require us to do this Method5(); Method6(); } else { // response was not valid so do these things Method7(); List<string> values = Method8(); foreach(string value in values) { Method8(value); } }
}
It's been a good day :) Derp: Hey, I need to add logic to your code, can I do some refactoring? Me: Sure Derp, just check it in when you're done Derp: *taps away* *checks in*
public void SomeMethod()
{// do some things Method1(); bool valid = Method2(); if (valid) { Method3(); Method4(); // valid responses require us to do this Method5(); Method6(); } else { // response was not valid so do these things Method7(); List<string> values = Method8(); foreach (string value in values) { Method8(value); if(something) Method9(); } }
}
Me: :| :omg: :mad::mad::mad::mad:
-
Write some code
public void SomeMethod()
{
// do some things
Method1();
bool valid = Method2();if (valid) { Method3(); Method4(); // valid responses require us to do this Method5(); Method6(); } else { // response was not valid so do these things Method7(); List<string> values = Method8(); foreach(string value in values) { Method8(value); } }
}
It's been a good day :) Derp: Hey, I need to add logic to your code, can I do some refactoring? Me: Sure Derp, just check it in when you're done Derp: *taps away* *checks in*
public void SomeMethod()
{// do some things Method1(); bool valid = Method2(); if (valid) { Method3(); Method4(); // valid responses require us to do this Method5(); Method6(); } else { // response was not valid so do these things Method7(); List<string> values = Method8(); foreach (string value in values) { Method8(value); if(something) Method9(); } }
}
Me: :| :omg: :mad::mad::mad::mad:
-
Write some code
public void SomeMethod()
{
// do some things
Method1();
bool valid = Method2();if (valid) { Method3(); Method4(); // valid responses require us to do this Method5(); Method6(); } else { // response was not valid so do these things Method7(); List<string> values = Method8(); foreach(string value in values) { Method8(value); } }
}
It's been a good day :) Derp: Hey, I need to add logic to your code, can I do some refactoring? Me: Sure Derp, just check it in when you're done Derp: *taps away* *checks in*
public void SomeMethod()
{// do some things Method1(); bool valid = Method2(); if (valid) { Method3(); Method4(); // valid responses require us to do this Method5(); Method6(); } else { // response was not valid so do these things Method7(); List<string> values = Method8(); foreach (string value in values) { Method8(value); if(something) Method9(); } }
}
Me: :| :omg: :mad::mad::mad::mad:
CTRL+K, CTRL+D, PUNCH+FACE
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
Write some code
public void SomeMethod()
{
// do some things
Method1();
bool valid = Method2();if (valid) { Method3(); Method4(); // valid responses require us to do this Method5(); Method6(); } else { // response was not valid so do these things Method7(); List<string> values = Method8(); foreach(string value in values) { Method8(value); } }
}
It's been a good day :) Derp: Hey, I need to add logic to your code, can I do some refactoring? Me: Sure Derp, just check it in when you're done Derp: *taps away* *checks in*
public void SomeMethod()
{// do some things Method1(); bool valid = Method2(); if (valid) { Method3(); Method4(); // valid responses require us to do this Method5(); Method6(); } else { // response was not valid so do these things Method7(); List<string> values = Method8(); foreach (string value in values) { Method8(value); if(something) Method9(); } }
}
Me: :| :omg: :mad::mad::mad::mad:
"Refactoring", you keep using that word. I don't think it means what you think it means... X|
Visit my blog at Sander's bits - Writing the code you need. Or read my articles at my CodeProject profile.
Simplicity is prerequisite for reliability. — Edsger W. Dijkstra
Regards, Sander
-
Write some code
public void SomeMethod()
{
// do some things
Method1();
bool valid = Method2();if (valid) { Method3(); Method4(); // valid responses require us to do this Method5(); Method6(); } else { // response was not valid so do these things Method7(); List<string> values = Method8(); foreach(string value in values) { Method8(value); } }
}
It's been a good day :) Derp: Hey, I need to add logic to your code, can I do some refactoring? Me: Sure Derp, just check it in when you're done Derp: *taps away* *checks in*
public void SomeMethod()
{// do some things Method1(); bool valid = Method2(); if (valid) { Method3(); Method4(); // valid responses require us to do this Method5(); Method6(); } else { // response was not valid so do these things Method7(); List<string> values = Method8(); foreach (string value in values) { Method8(value); if(something) Method9(); } }
}
Me: :| :omg: :mad::mad::mad::mad:
Most om my collegues would have done:
public void SomeMethod()
{
// do some things
Method1();
bool valid=Method2();
if (valid)
{
Method3();
Method4();
// valid responses require us to do this
Method5();
Method6();
}
else
{
// response was not valid so do these things
Method7();
List values=Method8();
foreach(string value in values)
Method8(value);
}
}
public void SomeMethod2()
{
// do some things
Method1();
bool valid=Method2();
if (valid)
{
Method3();
Method4();
// valid responses require us to do this
Method5();
Method6();
}
else
{
// response was not valid so do these things
Method7();
List values=Method8();
foreach(string value in values)
Method8(value);
}
}They don't care sh*t about organizing the code in logical readable blocks (the missing line feed between method bodies irritates me the most!), and how they manage to NOT have the code formatted with spaces, I can't begin to imagine, because my VS editor fixes that automatically when you terminate the statement with ";" Like:
MyMethod(0,1,2,3,4,5,6);
instead ofMyMethod(0, 1, 2, 3, 4, 5, 6);
I hate having to reformat other peoples code because they are too lazy, but my OCD requires it! :sigh:Anything that is unrelated to elephants is irrelephant
Anonymous
-----
The problem with quotes on the internet is that you can never tell if they're genuine
Winston Churchill, 1944
-----
I'd just like a chance to prove that money can't make me happy.
Me, all the time -
CTRL+K, CTRL+D, PUNCH+FACE
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
One of the best features in VS... The K-D thing, not the face-punching... Though that would be a nice upgrade... Hmm.....
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels) -
CTRL+K, CTRL+D, PUNCH+FACE
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
I use CTRL E+D, the K is too far away!
Never underestimate the power of human stupidity RAH