Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Variable argument function as a parameter of a variable argument function

Reply
Thread Tools

Variable argument function as a parameter of a variable argument function

 
 
James Kuyper
Guest
Posts: n/a
 
      11-21-2011
On 11/20/2011 11:18 PM, AikidoGuy wrote:
>>> I asked my simpler issue first.

>>
>> The fundamental problem with taking that approach is that you're
>> assuming that you'll be able to solve X, if Y turns out not to be the
>> right solution.

>
> This is becoming very philosophical.


It's not philosophy; it's hard practical advice about effective
techniques for asking questions.

>> If you know enough about X to justify that assumption, you should first
>> try solving X on the assumption that Y is not the right solution; only
>> ask about Y if not-Y leads you to a dead-end.

>
> My question to the group was about Y. I obtained answers about Y.
> To question whether or not I am able to solve X is to question my
> ability and not to answer my question.


You shouldn't be thin-skinned about that. If you need to ask any
question at all, that implies that there's some things you don't know
about the topic of your question. There's nothing unusual about that, we
all have gaps in our knowledge, just gaps of different sizes and in
different locations. The more elementary the question, the more it
implies that you don't know. This particular question implied a fairly
basic misunderstanding about how functions worked, justifying a
suspicion that there's a fair bit you don't know about C.

It's quite common for people to ask the wrong question; questioning them
to determine what the right question should have been is more helpful
than answering the wrong question that they asked. The particular
question you asked was so bizarre as to strongly justify a suspicion
that this might be one of those cases.

In particular, there's one key disadvantage to your approach that I
didn't address in my earlier comments. What if Y did "solve" your
problem, but was far from being the best solution? I've frequently seen
questions about extremely complicated and elaborate "solutions", that
could, when the questions had been answered, do what they were intended
to do, but were extremely unlikely to be the best solution to whatever
the real problem was.

I've found that the people who ask these questions are almost never
willing to describe the real problem that they're trying to solve, which
makes it difficult to prove that they asked the wrong question. I
suspect that they're embarrassed about something that they would have to
explain - perhaps it's something illegal, or maybe just that they don't
want people to see how bad their coding skills are. A few have claimed
that they had security issues to worry about, which sounds fairly
legitimate - but almost any code that poses security issues can be
rewritten to present the same coding problem without violating security.

>> If you do not know enough about X to justify that assumption, as is by
>> far the most common case, asking about Y could end up drawing you into a
>> long, drawn-out discussion of Y that does nothing to solve your real
>> problem. In my experience on this newsgroup, such useless discussions
>> are by far the most common result of the "XY" approach.

>
> Generalities are certainly nice things to state. And I am not up to
> date on how others discuss their problems. So I apologize for my
> inappropriate behaviour on this newsgroup.


It's not inappropriate behavior; it's an unproductive approach to asking
for help.
--
James Kuyper
 
Reply With Quote
 
 
 
 
Seebs
Guest
Posts: n/a
 
      11-21-2011
On 2011-11-21, James Kuyper <(E-Mail Removed)> wrote:
> It's quite common for people to ask the wrong question; questioning them
> to determine what the right question should have been is more helpful
> than answering the wrong question that they asked.


There is a reason for this.

I start with a problem "A". I try to solve it myself, because I know that
if I can solve it, I am better off doing so than waiting on help. I come up
with a proposed solution, "B". I can't make it work. It is time to go for
help.

.... At which point, I'm *thinking about* B. So I ask for help with B. But
B isn't really my problem; A is.

> In particular, there's one key disadvantage to your approach that I
> didn't address in my earlier comments. What if Y did "solve" your
> problem, but was far from being the best solution?


And note that if anyone thinks your problem is homework, this is fairly
likely to happen. I love to offer "helpful" solutions to homework. It
entertains me.

-s
--
Copyright 2011, all wrongs reversed. Peter Seebach / http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
function argument dependent on another function argument? Reckoner Python 11 01-19-2009 03:31 AM
How to pass a parameter for a function parameter in a function AzamSharp Javascript 2 07-05-2008 12:24 AM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
Function pointers, variable argument functions calling other variable-argument functions (sort of) S?ren Gammelmark C Programming 1 01-07-2005 09:41 PM
How to pass variable argument list to another function w/ variable argument list? Ben Kial C Programming 1 11-15-2004 01:51 AM



Advertisments