Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Line read from csv file with fgets has two characters before the terminating one Date: Thu, 15 Dec 2016 12:58:15 -0800 Organization: None to speak of Lines: 42 Message-ID: References: <457d2715-2a7a-4131-8083-637dc0919fb3@googlegroups.com> <616cc4c3-d560-4146-8f03-93e76bedf1fd@googlegroups.com> <94c39458-6789-4eaa-b773-36bc4d2d9976@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="d13fb784dfa5b4f5223d68f3ab06c5fb"; logging-data="11406"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+69YoYfTx0Tht8h6jEmV5L" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:CRzSa0I4D6dLLktWzqpzLQgKbk4= sha1:06ZLIfYQdnV3FE5D3K2NG00VSfA= Xref: csiph.com comp.lang.c:99569 BartC writes: > On 15/12/2016 19:51, Keith Thompson wrote: >> BartC writes: >>> On 15/12/2016 17:49, Keith Thompson wrote: >>>> BartC writes: >>>>> int main (int nparams, char** params) { >>>> I'll restrict myself to just one question. >>>> >>>> Why did you decide to call the parameters to main "nparams" and >>>> "params", rather than the universally conventional "argc" and "argv"? >>> >>> I keep getting them mixed up, when I can remember them. >> >> argc is "argument count". argv is "argument vector". > > I wouldn't have guessed that last one. And now you don't have to guess. > But, is it that big a deal? Sometimes I have to delve into C code > amounting to tens or hundreds of thousands of lines of code. The exact > parameter names used by just one of thousands of functions - and one > discussed here ad nauseam - is the least of the problems! It's not a very big deal, just the first thing I happened to notice. It's a small problem, but still a problem. It obfuscates the code for not good reason. > I'm sure it wouldn't faze any of the experts. It fazed me. I know exactly what it means, of course, but if I encountered this in a real-world program I'd waste some small amount of time wondering why unconventional names were used, and whether there might be some actual significance. [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"