www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/12/17:30:32

From: sparhawk AT eunet DOT at (Gerhard Gruber)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: A very basic question about C programming... diary of a newbie Part 1
Date: Wed, 12 Aug 1998 21:28:00 GMT
Organization: EUnet Austria
Lines: 38
Message-ID: <35de05c5.2889448@news.Austria.EU.net>
References: <SS9A1.434$vq2 DOT 881313 AT newse2 DOT tampabay DOT rr DOT com> <1998081206211700 DOT CAA19663 AT ladder03 DOT news DOT aol DOT com>
NNTP-Posting-Host: e162.dynamic.vienna.at.eu.net
Mime-Version: 1.0
NNTP-Posting-Date: 12 Aug 1998 21:29:06 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Destination: malcolmj7 AT aol DOT com (MalcolmJ7)
From: Gruber Gerhard
Group: comp.os.msdos.djgpp
Date: 12 Aug 1998 06:21:17 GMT:

>first off, prototyping isn't the most useful thing in the world.  When you
>prototype you just declare the function before actually writing it.

Prototyping is very important for a readable code. First, you have the
prototype in an includefile so you can easily look up the arguments and second
you can use it as a documentation by using good arguments in the prototype.

int function(int, int, int);

isn't very helpfull and after a while you have to look up the code to know
which parameter has what meaning.

int function(int X_Axis, int Y_Axis, int Z_Axis);

provides the same information to the compiler and helps to document the code
without much work.

I'd recommend to protoype all functions that you want to use more often then
just for a quick and dirty hack.
--
Bye,
   Gerhard

email: sparhawk AT eunet DOT at
       g DOT gruber AT sis DOT co DOT at

Spelling corrections are appreciated.

- Raw text -


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