Coding style

Gerhard Fiedler gelists at gmail.com
Tue Jul 25 18:48:18 EDT 2006


On 2006-07-25 17:59:22, Antoon Pardon wrote:

>> My view is: I ask for help on a public forum. I get what I get... and if
>> I consider that someone who responded with something that's not
>> immediately helpful has a potential to help me better, I try to get in
>> a dialog and address what has been suggested, carving out my real
>> problem in the idiom of that person. This is my responsibility -- after
>> all, I'm the one who wants to learn how that person would solve my
>> problem. Later then I can try to separate what I want to use from that
>> solution from what I consider personal preference of the helping
>> person.
> 
> It all depends. If that person is one of many that responded, I may
> think it is not worth my time to find out how this particular person
> would solve my problem. If he seems to be the only one who has a clue I
> may be more inclined to get that dialog started.

Exactly. If there are people more tuned into your channel, that's where
you're more inclined to go. If not, you tune into some other's channel. 


>> It's like if you want good stock advice from your uncle, who's
>> experienced in the matter but very formal, ask him without using the
>> f*** word. You can use it when asking your other uncle, who's also
>> experienced but doesn't really care about formalities. Tune in if you
>> want a good channel...
> 
> That is one side of the coin. The other side is that if the formal uncle
> is heard a lot without someone contradicting him from time to time, then
> all the newbies will think that formal is the way to go, creating a lot
> more people who are somewhat uptight. causing a lot of time to go into
> getting things formal instead of solving the problem. 

"So what?", I'm inclined to ask <g>  If someone does something without
knowing why, I'm not really bursting of sympathy. In real life, I've found
that there isn't that much I have to invest to get the channel clean, so to
speak. And where I think it's too much, I don't do it. I don't see much of
a difference here. 

You definitely have a point in that some of that is not necessary. But
then... there's so much in a typical communication situation that is not
(objectively) necessary :)


>> To apply that to your example... If there's no particular reason to
>> write "number != 0", then just repost the problem code with "number"
>> instead and you're done. But if there's a reason, try to set up your
>> example code so it shows that reason.
> 
> This goes against the advise that is given here and in other language and
> programming groups: If you have a problem with particular behaviour (a
> bug) reduce your program to the minimal that still produces the trouble
> some behaviour. 

Right... why against that? The minimal and communicable piece of code that
shows the problem. That's what I'm saying. To apply that to the example: if
the difference between the two styles is not relevant and "number" alone is
enough to reproduce the problem, post the code using "number". If "number
!= 0" is necessary to reproduce the problem, add some code that shows /why/
you have to use "number != 0" and can't use the simple "number". It may be
part of the problem.

 
> Sure, but it seems there are people who can tangle the problem without
> knowing whether or not there is a reason. They just look at the code
> and figure out what it does, whithout bothering about how it should
> look like and in the end that is the most helpfull attitude. 

Sometimes. Sometimes digging deeper may be helpful, too. But nobody's
perfect anyway, so just pick up what suits you :)

Gerhard




More information about the Python-list mailing list