Style is a subtle thing...
-
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers? -
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?Nemanja Trifunovic wrote:
would you rather have "beautiful" code or good relationship with your coworkers?
I'd sort of like to have both. :) I don't think I'd change the first guy's code if he was still in the company. I might add a comment,
// a sane person would write:
// p_member->p_member->p_member->memberand let the chips fall where they may.
BDF People don't mind being mean; but they never want to be ridiculous. -- Moliere
-
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?We have a nice understanding to more or less observer conventions. That's why I'm not allowed to use 'var' in our C# code wherever ReSharper suggests I do. ;P If I came across something out of sorts, I would quickly discuss it with the 'perp', who would inevitable be newer than me to have done it, and explain the reasons for our very loose conventions.
-
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?Nemanja Trifunovic wrote:
I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?
I'd go for the relationship and then try to sway them to a more preferred approach over time.
Sovereign ingredient for a happy marriage: Pay cash or do without. Interest charges not only eat up a household budget; awareness of debt eats up domestic felicity. --Lazarus Long Avoid the crowd. Do your own thinking independently. Be the chess player, not the chess piece. --Ralph Charell
-
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?Nemanja Trifunovic wrote:
would you rather have "beautiful" code or good relationship with your coworkers
I'd rather have "beautiful" coworkers. My relationship with my code is a very complex thing, and this is neither the time nor place to discuss it.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?They are both crappy code. :|
This signature was proudly tested on animals.
-
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?It depends. In this case it's not worth the hassle. Sometimes "beautiful" code is more than just aesthetics, and if it affects maintainability, etc, then I might push back a little. Luckily I don't have to deal with crap like that anymore! :)
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Oh
-
They are both crappy code. :|
This signature was proudly tested on animals.
Absolutely. My first thought would be why on earth do you have something like that in the first place.
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Oh
-
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?Style should be standardised across a code base. So, I'd discuss if I did not agree with the style, then stick to whatever was decided.
Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
-
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?Nemanja Trifunovic wrote:
I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?
The relationship with my co-workers depends upon their sex, age and willingness to get drunk at the Xmas party and fool around in the stationery cupboard. The beauty of any code lies in the eye of the beholder, and code, having all the attibutes of a woman, has needs, wants and a particular inner beauty that is at once obvious and indescribable.
___________________________________________ .\\axxx (That's an 'M')
-
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?Bah! The
->
operator is merely syntactic sugar; only weak developers use it. -
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?beautiful code.
cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP
-
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?Neither they are both train-wreck. Anyway, IMHO the styling should be one thing which should be standardized so that people don't argue on it. There is no right or wrong way so argument is useless. That is why I like StyleCop so much.
-
They are both crappy code. :|
This signature was proudly tested on animals.
Maximilien wrote:
They are both crappy code
Hell, I agree - this is not a point, and the original code probably didn't even look like that. The opinion I am seeking is - would you risk the relationship with your coworkers to enforce the coding style you like?
-
beautiful code.
cheers, Chris Maunder The Code Project Co-founder Microsoft C++ MVP
Chris Maunder wrote:
beautiful code.
:~ I wouldn't expect such answer from a good manager, to be honest.
-
Neither they are both train-wreck. Anyway, IMHO the styling should be one thing which should be standardized so that people don't argue on it. There is no right or wrong way so argument is useless. That is why I like StyleCop so much.
Rama Krishna Vavilala wrote:
Neither they are both train-wreck.
Irrelevant for the discussion :) The point is that dev 1 considers sample 1 to be "better" than sample 2, and dev 2 is willing to compromise his work environment to change it to sample 2.
-
Maximilien wrote:
They are both crappy code
Hell, I agree - this is not a point, and the original code probably didn't even look like that. The opinion I am seeking is - would you risk the relationship with your coworkers to enforce the coding style you like?
I ask the person who did the change, just for the sake of curiosity, why the change; maybe there's something in version A that cause some risks vs. version B. If we see together that there is no added risk to the code either by using A or B, then I would just let it go.
This signature was proudly tested on animals.
-
Nemanja Trifunovic wrote:
I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers?
The relationship with my co-workers depends upon their sex, age and willingness to get drunk at the Xmas party and fool around in the stationery cupboard. The beauty of any code lies in the eye of the beholder, and code, having all the attibutes of a woman, has needs, wants and a particular inner beauty that is at once obvious and indescribable.
___________________________________________ .\\axxx (That's an 'M')
Maxxx_ wrote:
The relationship with my co-workers depends upon their sex, age and willingness to get drunk at the Xmas party and fool around in the stationery cupboard.
That's gotta be the best response ever! Though I'm not sure HR would approve...unless of course HR looks like Salma Hayak, and has a serious sex addiction! :)
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Oh
-
A recent StackOverflow discussion got me thinking... Apparently somebody did something like:
*(*(*(p_member).p_member).p_member).member
and the other guy said "WTF" and changed it to something like:
p_member->p_member->p_member->member
and offended the guy No. 1 who prefers his own style. Now, I don't want to steal the SO thread and discuss what is better - most if not all of us will agree with the guy 2 that operator
->
is the preffered approach here. But would you make a change like this and start a war with someone you work with? I mean, the code is still correct, even if ugly, and the customers will never notice any difference. On the other hand, if you turn the development team into a bunch of people who hate each other, everybody is going to suffer. I guess my question is: would you rather have "beautiful" code or good relationship with your coworkers? -
Maxxx_ wrote:
The relationship with my co-workers depends upon their sex, age and willingness to get drunk at the Xmas party and fool around in the stationery cupboard.
That's gotta be the best response ever! Though I'm not sure HR would approve...unless of course HR looks like Salma Hayak, and has a serious sex addiction! :)
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Oh