Re: Ping from C/C++ doesn't work properly using either System() or popen()



Floyd L. Davidson wrote:

"James J. Dines" <james.dines@xxxxxxxxx> wrote:
Floyd L. Davidson wrote:

<*MUCH* back and forth deleted>

Ironically enough, I was thinking more along the lines of C++ and the
possibility that char would be over-ridden originally (recall the original
poster wasn't clear if using C or C++ though his code was "very C"), but I
haven't had time to follow up on that. I would imagine it is something
that cannot be done, and I certainly would never do it if one could, but
as we both know, that won't necessarily stop a lot of people ...

I know you aren't a C++ guy, but do you see where I was originally going
with this when I was viewing the code in a C++ context?


I really would like to encourage you to carefully ask about this in
comp.lang.c and get a more definitive answer from people you can
verify as experts.


No thanks. I have no doubt that you follow it religiously, and are
accurately portraying the general sentiment. Again, reasonable people can
disagree. I believe it is clear that we are both reasonable people. I
have views on what makes good source code, and what makes for bad source
code, and they are opinions, not absolute fact. I have thought about it in
enough detail that Kernighan, Ritchie, or any contemporary C language guru
would not convince me otherwise. Again, to me this is a big picture thing
that transcends implementation detail, and is about good coding practice.
Portable practice, as opposed to portability practice.

My rule of thumb is this: Without exception, be consistent and explicit
except when to do otherwise would obfuscate the meaning of the code,
confuse, mislead, and/or cause unnecessary effort to be expended by the
code reviewer, or cause the function of the resultant binary to behave
differently. As far as I am concerned, source code should be a special
case of compilable documentation in as much as that is possible.

I'd rather have someone say, did you know you could use a 1 there instead of
sizeof(char)? (-and now, thanks to you, I do :-) ... than ... 'it took me
10 minutes to find the function reference and see what that 1 was supposed
to represent in this context.' Many things are a trade-off. Not everyone
will pick the same option when one is presented.

I spread myself too thin to change that approach, and keep track of all of
the exceptions for each language, platform, etc ... It would be a kind of
spaghetti code in my psyche that I don't have the time, inclination, or -
perhaps - ability, with which to deal.

Peace; thanks for your help, your valuable input, and your time!

Jim D.
.



Relevant Pages

  • Re: Javascript Error Meaning
    ... It is an exception thrown by an internal component of Firefox. ... var nativeMethod = Components.lookupMethod(this.mUntrustedObject, ... an interface or an extension, maybe you have used this interface wrong. ... There is no way of telling unless you show some source code (please, ...
    (comp.lang.javascript)
  • RE: Strange LocalDataStoreSlot storage has been freed exception
    ... source code, it is not easy to find the root cause of the issue. ... Visual Studio to debug exception. ... In the Exceptions window, break when Common Language Runtime Exception ...
    (microsoft.public.dotnet.framework.clr)
  • Re: System.Net.Mail.SmtpClient MailClient message. How do u know if it was successful?
    ... Go here and download the source code. ... i'd throw an exception here, else you have no idea it didn't work. ... Can the mail classes be used without having a SMTP server running on ... public void SendEmail(string Sender, string Recipient, string Subject, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Direct3D.InvalidCallException using Summer 04 update
    ... What is your application calling when the exception occurs? ... A call stack trace would help here, as would the source code. ... What is the error string/code provided by the exception? ...
    (microsoft.public.win32.programmer.directx.managed)