From: Jonathan de Boyne Pollard on
>
>
> If you file contains real tabstops they better make sure that the file
> looks right when displayed with a standard terminal.
>
"Standard terminal"s, eh? Where in IEEE 1003.1:2004 does it specify how
many spaces a terminal in TAB3 mode actually expands to? Where does it
specify what the default tabstops are when one hasn't run the tabs command?

From: Rainer Weikusat on
ram(a)zedat.fu-berlin.de (Stefan Ram) writes:
> ike(a)localhost.claranet.nl (Ike Naar) writes:
>>Consider the case where a condition does not fit on a single line:
>> if (sscanf(input_buffer, "%d %d %d", &length, &width, &height) == 3 &&
>> sscanf(other_buffer, "%d %d %d", &color, &price, &weight) == 3 &&
>> needs_processing(color)) {
>> compute_volume(length, width, height);
>> compute_something_else(price, weight);
>> }
>
> I use the same rules for parentheses as for square brackets
> and curly braces and thus, format this as follows.
>
> if
> ( sscanf( input_buffer, "%d %d %d", &length, &width, &height )== 3 &&
> sscanf( other_buffer, "%d %d %d", &color, &price, &weight )== 3 &&
> needs_processing( color ))
> { compute_volume( length, width, height );
> compute_something_else( price, weight ); }

This must have been invented by someone who never changes the first
and last lines of a block and who never appends lines to blocks :->.
From: Ian Collins on
Casper H.S. Dik wrote:
>
> Things I absolutely hate in some c-styles are:
>
>
> if(condition)
>
>
> "if" is a not a *function* it shouldn't look like one.

Almost as bad a styles that require parentheses on return; "return" is
not a *function* it shouldn't look like one!

--
Ian Collins
From: Nick on
Ian Collins <ian-news(a)hotmail.com> writes:

> Casper H.S. Dik wrote:
>>
>> Things I absolutely hate in some c-styles are:
>>
>>
>> if(condition)
>>
>>
>> "if" is a not a *function* it shouldn't look like one.
>
> Almost as bad a styles that require parentheses on return; "return" is
> not a *function* it shouldn't look like one!

There's something fundamentally wrong with the contrast between these
two programs as a result of that:

#include <stdlib.h>

int main(void) {
return EXIT_FAILURE;
}

-----
#include <stdlib.h>

int main(void) {
exit(EXIT_FAILURE);
}
--------
--
Online waterways route planner | http://canalplan.eu
Plan trips, see photos, check facilities | http://canalplan.org.uk
From: Kelsey Bjarnason on
[snips]

On Sat, 27 Feb 2010 14:00:44 +0000, Casper H.S. Dik wrote:

>>> The One True Tabstop Width is 8.
>
>>Three, actually. Okay, 8, if you're stuck using output devices from the
>>1960's which didn't allow user-defined tab spaces, but for how many
>>people is this true anymore?
>
> You don't quite understand why a ne True Tabstop Width is 8?

Because, in the 1960's and earlier, devices weren't capable of coping
with user-defined tab stops. Welcome to the new world.

> It is because *other* *people* want to look at your code.

Which they can readily do, simply by setting their tab stops to whatever
their personal preferences are.

> If you file contains real tabstops they better make sure that the file
> looks right when displayed with a standard terminal.

Set tabstop to 2, 3, 4, 5, 8, 179, whatever looks best to your
preferences. Unlike with spaces, where you have no control whatsoever.
Not sure what your point is here... that because tabs allow the user to
control the display layout, it's better to use spaces which don't?

>>Now imagine if they were using spaces. This guy uses two, the next guy
>>uses three, the third guy uses 4, the fourth guy uses 5, some other guy
>>uses 8.
>
>>With tabs, at least just by setting your tab stops, you can get a degree
>>of consistency. Have fun sorting out the nightmare of inconsistency
>>spaces lead to.
>
> No, because you make the file non-portable, unless you save with spaces
> and not with tabstops.

Well, yes, okay, if one is in fact using a device so ancient it can't
handle user-defined tab stops, then we can agree, using tabs is not
"portable" to that device.

I've been in computing for about 30 years now, and offhand, I can recall
precisely _one_ such device I've ever used - a line printer which hasn't
been actually used since about 1975.

First  |  Prev  |  Next  |  Last
Pages: 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
Prev: integer
Next: shared memory question