Talk:C date and time functions: Difference between revisions

Content deleted Content added
Line 33:
 
: I agree with all your points. I would add that indentation isn't only a personal thing - Wikipedia prefers consistent style. If we look around, we will see that most of the examples use the original indentation style. So I'd support reverting the changes to the indentation too. [[User:1exec1|1exec1]] ([[User talk:1exec1|talk]]) 23:49, 11 March 2012 (UTC)
 
:: As for indentation, it isn′t about consistency on Wikipedia, but is about conforming to the common style of the industry. [[Special:Contributions/213.131.238.28|213.131.238.28]] ([[User talk:213.131.238.28|talk]]) 09:38, 12 March 2012 (UTC)
 
: That anonymous editor was me. First, I′m a C expert and as such am aware that C is a free-form language, allowing both spaces and tabs as whitespace (along with a few other characters); I never claimed tabs to be the ''sole'' delimiter — that′s why I wrote “UNIX-''style'' indentation”, alluding to mere stylistic nature of the matter. It isn′t important whether to use spaces or tabs in such code snippets, the indentation part of my edit was purely aesthetical, made in accordance to my personal (and quite popular) views:
 
:* Tab is more flexible, because most text editors allow you to set the tab width, allowing for quick indentation adjustments without any changes to the actual code.
:* Tab is far more common as an indentation character and is used extensively throughout the industry — this is why your industry comment is false — industry uses tabs with tab width set to either 4 or 8 (never odd, like 3), you can easily see that for yourself by examining source code (quick examples: Solaris, IRIX, Linux, and FreeBSD kernels.) I am myself part of this industry, being a C programmer for Cadence Design Systems, Inc. You are, on the contrary, either an amateur or most likely not a C programmer at all, which is easily deduced from your comment on industrial usage of tabs — apparently you never even read any source code of operating systems, drivers, or system software, otherwise you wouldn′t make that erroneous statement. This is why my professional opinion holds a much higher value.
:* Tab is more practical, because it takes less bytes to represent a string of tabs compared to a string of spaces of the same visible width.
:* Tab is ''very'' handy for automated code editing by scripts (regular expressions become ten times simpler, compared to equivalents written for space-indented code) — the technique used extensively throughtout the industry for large spanning source trunks and branches.
 
: By using tabs for indentation of example code snippets on Wikipedia we promote a reasonable, practical, and just handy coding technique, which, in common sense, ''is'' a virtue to be chased. Moreover, I noted UNIX because it is the origin of the C programming language, its source code therefore can and should be taken as a reliable source of good C programming practices, including the style.
 
: Second, I never claimed the void cast to be required — I wrote ''should'', indicating its optional nature. Such void casts are deemed to be a good practice, because just by glancing at code you can easily tell which calls′ return values are ignored. It is a heavily used (by industry, yeah) convenience technique of the same order as prefixing struct/union member names with struct/union′s shortened name, for example:
<source lang="c">struct iovec {
void *iov_base;
size_t iov_len;
};</source>
: But okay, your point here is reasonable, so let′s keep the cast out and leave it to industry. I agree with your compilation and invocation point too — I tend to forget that non-UNIX operating systems exist, my bad.
 
: Resume: you twisted every single bit of my edit′s explanation message, reading “required” instead of “optional” and not undestanding the stylistic nature of tab usage. You aren′t even a professional C programmer. Why do you edit C-related articles when you aren′t knowledgeable enough?
 
Au revoir. [[Special:Contributions/213.131.238.28|213.131.238.28]] ([[User talk:213.131.238.28|talk]]) 09:38, 12 March 2012 (UTC)