delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/02/19:48:51

From: firewind <firewind AT metroid DOT dyn DOT ml DOT org>
Newsgroups: comp.os.msdos.djgpp,comp.lang.c
Subject: Re: Functions in struct's... possible? How?
Date: 2 Sep 1997 22:37:37 GMT
Organization: Netcom
Lines: 46
Message-ID: <5ui4fh$9gq@sjx-ixn5.ix.netcom.com>
References: <33FCDA5C DOT 2353659F AT execulink DOT com> <5tippg$ci7$2 AT news DOT sendit DOT nodak DOT edu> <5tkq9a$2se$1 AT helios DOT crest DOT nt DOT com> <5tmcai$nuo$1 AT news DOT sendit DOT nodak DOT edu> <340B1E27 DOT 44FAD207 AT alcyone DOT com> <340BF8B7 DOT 69C3 AT stud DOT warande DOT ruu DOT nl>
NNTP-Posting-Host: elp-tx3-15.ix.netcom.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Richard Rensman <rensman AT fys DOT ruu DOT nl> wrote:
> > The original question was, "How do I do X in language Y?"  The answer to
> > the question is never "Use language Z."

> Maybe not on comp.lang.c.

> Answering "If you're going to do X often with language Y you might
> consider using language Z" is perfectly valid here on
> comp.os.msdos.djgpp, however. This is not a C language forum, and djgpp
> is not merely a C compiler. 

> If asked "How do I write a keyboard handler in C", replying "It might be
> easier to write it in asm and link it in" is perfectly valid. It is not
> the *only* answer, but it is equally valid in that it solves the problem
> at hand.

I completely disagree. Presumably, if the poster asked for a solution -in
language Y- he\she wants a solution -for language Y-. Telling the poster to
switch languages is NOT a solution to the question asked! If the question
pertains to language Y, the answer should pertain to language Y. If someone
asks for instructions on writing a keyboard handler in C, I have readily
available example code, that I myself have written, that I can provide.
Telling someone to switch to C++ or asm is the same as telling someone to
switch to Pascal or Ada; sure, it might solve their problem in the long-run,
but simply -does not- answer the question that was -asked-: how to do
something in the language the poster is -using-.

<snip>

> If you find yourself using C++ concepts in C more and more often it
> might not be a bad idea to switch languages. If you find yourself
> stuffing structs with function pointers and copy-pasting portions of
> them to form new, different structs, it is not a bad idea to pick up a
> book on C++ and learn about classes and inheritance. That is advice that
> is never wasted.

Sure. If you want to program in C++, be my guest, I have no objection. It is
entirely out of line, however, to tell a user to switch to C++ when what they
want to do can be accomplished in C.

late\fw

-- 
[- 				 firewind	                            -]
[-   email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work)  -]
[- 	    "You're just jealous because the voices talk to -me-."          -]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019