From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,86fd56abf3579c34,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-16 16:38:44 PST Path: bga.com!news.sprintlink.net!cs.utexas.edu!swrinde!gatech!udel!news.mathworks.com!newshost.marcam.com!charnel.ecst.csuchico.edu!waldorf.csc.calpoly.edu!isnews.calpoly.edu!hertz.elee.calpoly.edu!wbrooks From: wbrooks@hertz.elee.calpoly.edu (Bill Brooks) Newsgroups: comp.lang.ada Subject: Re: Should internet support software be written in Ada? Date: 17 Mar 1995 00:24:51 GMT Organization: Cal Poly State University Distribution: usa Message-ID: <3kaksj$iur@isnews.calpoly.edu> NNTP-Posting-Host: hertz.elee.calpoly.edu NNTP-Posting-User: wbrooks Date: 1995-03-17T00:24:51+00:00 List-Id: In article <2F5B780E@SMTPGATE2.STRATCOM.AF.MIL>, Bennett, Chip (KTR) ~U wrote: > [...stuff deleted..] > >Point 2: I going to make a huge leap here and assume that httpd is written >in C. [...stuff deleted..] > Comments? > >Chip Bennett Yep. Here's a representative sample of the code that comes with NCSA's httpd (everything including the formatting is from the original): ----------------------- start paste -------------------------- */ if (strchr(mapname,'/')) { strcpy(conf,getenv("PATH_TRANSLATED")); goto openconf; } if ((fp = fopen(CONF_FILE, "r")) == NULL) servererr(strcat("Couldn't open configuration file:", CONF_FILE)); while(!(getline(input,MAXLINE,fp))) { char confname[MAXLINE]; if((input[0] == '#') || (!input[0])) continue; for(i=0;isname(input[i]) && (input[i] != ':');i++) confname[i] = input[i]; confname[i] = '\0'; if(!strcmp(confname,mapname)) goto found; } ----------------------- end paste --------------------------- In the rich tradition of discussing good software engineering practices in c.l.a(regardless of language) I'll ask: is this good coding style? Keep in mind that this code was written under the auspices of one of the top 5 schools in CS in the United States. -- "Bright young men of disheveled appearance, often with sunken glowing eyes...their fingers, already poised to strike, at the buttons and keys on which their attention seems to be riveted as a gambler's on the rolling dice." -Joseph Weizenbaum on "compulsive programmers"