From: Kelsey Bjarnason on
[snips]

On Mon, 01 Mar 2010 01:06:04 -0800, Nick Keighley wrote:

> one difficulty with embedded <tab-chars> as the only layout character is
> that you lose fine control.
>
> void pippo (int n)
> {
> if ((n == PHOTON) ||
> (n == LEPTON) ||
> (n == HADRON))
> {
> send_msg ("claim nobel!");
> }
> }
>
> I don't see how this layout can survive spaceless layout or variable tab
> stops. Presumably you don't require layout like this.

Frequently. Here's a tip: indent the ( to a tab stop. All lines up -
and allows the individual viewer to work to his own preferences.

>> >> Contrast that to hitting delete on a line which uses spaces instead
>> >> of tabs.  All this does is mess up the formatting, as the editor is
>> >> almost certain to treat a space as a _space_, as it should, not as a
>> >> tab, which it _shouldn't_, because the character involved is not a
>> >> tab, but a space.
>>
>> > get a better editor
>>
>> I have a better editor.
>
> :-)

Indeed. The whole spaces-vs-tabs thing is one of those "Obviously, my
way is superior, you heathen (heathfield?) infidel!" issues.

<snicker>


>> One that understands the difference between spaces and tabs.  One that
>> does *not* do something as brain-dead as deleting _multiple_ characters
>> when I press delete once.  Any editor which deletes multiple items on a
>> single delete simply cannot be trusted, it's liable to destroy
>> something.
>
> no. My editor (this is actually a configurable option) only does this
> for spaces. I assure you it works well in practice.

I wouldn't trust any editor, regardless of configuration, which deleted
multiple characters on a single "delete" keypress. Too freaking
dangerous to be used on anything more important than "to do" lists.

> If I want to insert <tab-chars> (eg. for the dreaded make file) I have
> to change an option on my editor. Normally I do not want to insert
> <tab-chars>

Wait, you have to _reconfigure_ your editor to insert tabs when you hit
tab, because by default, pressing tab doesn't give you a tab, it gives
you spaces? What does spacebar give you? Ampersands? Lemme guess:
"enter" activates "close file without saving". And delete nukes anything
from zero to 8 characters.


>> But then you're on my side of the
>> fence, with spaces being defective by design for indent.
>
> this is phrasing it rather strongly. There are plenty of people who have
> a different opinion from you.

Yes, well, obviously, their opinion is wrong and silly-headed.

(grin, duck, run)


>> If they weren't
>> defective by design, you wouldn't be using tab instead of space.
>
> is that <tab-char> or <tab-key>?

Yes. The tab key puts in tabs. The spacebar puts in spaces. Enter puts
in enter, 'Q' puts in 'Q' and so forth.

> [it's getting repetitive]

Shall we do emacs versus vi next? ;)

>> If your editor - and the notion of spaces for indentation - weren't
>> defective by design, you wouldn't need to use a special key to insert
>> spaces; that's why you have a space bar.  The fact you have to resort
>> to something entirely different, the tab key, is prima facie evidence
>> the whole notion of spaces to indent is as defective as it appears.
>
> this is opinion masquerading as fact.

Aren't all such "debates"?

The issue of "stylistic conventions", in the realm of C, is one of those
cases where, beyond a few basic rules of thumb - all-upper-case for
macros, for example - there are no universally agreed upon approaches,
each with its adherents and detractors, each with its benefits and
drawbacks.


>> Now, if your editor worked properly, using tabs instead of spaces, with
>> the tab key inserting tabs as it should, then when viewed on someone
>> else's display, rather than yours, it would show the code as *they*
>> prefer to view it, rather than as *you* have decided is the only true
>> way which everyone should be forced to view it in.
>
> I like finer control over my layout than you do apparently

Quite the contrary. I like delete to delete _one_ character, tab to
insert a tab, and so forth. Not quasi-random side-effects.

>> Really, isn't this just a case of imposing your own layout conventions
>> on others, rather than using a common sense approach which actually
>> lets everyone view the code in their own preferred manner?  Without
>> having to defeat the needless additional complication of converting
>> some godawful arrangement you happen to like into something actually
>> manageable?
>
> but you also require others to agree to your conventions.

Not really; at least my approach allows them to layout their code to
their visual preferences, without mucking it up for everyone else.


> I bet you'd hate this approach
>
> Code laid out like this with 4 character indent xxxx
> yyyy
> zzzz
> wwww
>
> and using S and T to represent the "layout charcaters" actually looked
> like this
>
> xxxx
> SSSSyyyy
> Tzzzz
> TSSSSwwww

Blech. Why do that? Use tabs for indent, the way they're intended.

> the worst or all possible worlds!

No, the worst of all possible worlds would be having to be a maintenance
coder for Jeff Relf's magical news client. :)

From: Richard Bos on
ram(a)zedat.fu-berlin.de (Stefan Ram) wrote:

> Eric Sosman <esosman(a)ieee-dot-org.invalid> writes:
> >double rx, ry, rz; /* position */
> >double vx, vy, vz; /* velocity */
> >double ax, ay, az; /* acceleration */
> >... is, to my eye, a lot more readable than
> >/* position */
> >double rx;
> >double ry;
> >double rz;
>
> You can have your cake and eat it, too:
>
> double rx; double ry; double rz; /* position */
> double vx; double vy; double vz; /* velocity */
> double ax; double ay; double az; /* acceleration */

Yes, there's always _someone_ who prefers the worst of both worlds.

Richard
From: bartc on

"Kelsey Bjarnason" <kbjarnason(a)gmail.com> wrote in message
news:m7ydnd62sLPnuRDWnZ2dnUVZ_tAAAAAA(a)giganews.com...
> On Mon, 01 Mar 2010 01:06:04 -0800, Nick Keighley wrote:

>> If I want to insert <tab-chars> (eg. for the dreaded make file) I have
>> to change an option on my editor. Normally I do not want to insert
>> <tab-chars>
>
> Wait, you have to _reconfigure_ your editor to insert tabs when you hit
> tab, because by default, pressing tab doesn't give you a tab, it gives
> you spaces? What does spacebar give you? Ampersands? Lemme guess:
> "enter" activates "close file without saving". And delete nukes anything
> from zero to 8 characters.

On my typewriter, Tab moves the carriage up to the next tab-stop. Backspace
moves the carriage back, one space at a time.

So Tab is just a kind of macro on that machine.

To emulate the same behaviour in an editor, you don't want or need to store
actual tab characters, you just need the ability to quickly skip forward or
back to the next tab-stop position.

But one problem is ensuring the same set of tab-stops are used across
editors, or even across files in the same editor.


> Yes. The tab key puts in tabs. The spacebar puts in spaces. Enter puts
> in enter, 'Q' puts in 'Q' and so forth.

Printable characters tend to be inserted into the text. Non-printable chars
and special keys could do anything. I suppose Esc puts in escape characters
and F1 puts in 'F1' characters?

--
Bart

From: Branimir Maksimovic on
Nick Keighley wrote:
> On 2 Mar, 09:11, Branimir Maksimovic <bm...(a)hotmail.com> wrote:
>> Nick Keighley wrote:
>>> On 27 Feb, 16:39, Rich Webb <bbew...(a)mapson.nozirev.ten> wrote:
>>>> On Sat, 27 Feb 2010 08:30:16 -0800 (PST), Nick Keighley
>>>> <nick_keighley_nos...(a)hotmail.com> wrote:
>>>>> On 27 Feb, 08:39, James Harris <james.harri...(a)googlemail.com> wrote:
>
>
>>>>>> [...] what do Windows
>>>>>> users use to enter and edit source code?
>>>>> the IDE, ConText, emacs, Word
>>>> vi! Nowadays likely in its gvim incarnation, of course.
>>> VI VI VI!
>>> the editor of the beast
>> Well, when I used VI it was because there wasn;t anything
>> better on machine. Who said: VI editor that beeps and corrupts you
>> files?
>> Once I encrypted my source code by accident with that thing.
>
>
> "The Real Programmer wants a "you asked for it, you got it"
> text editor--complicated, cryptic, powerful, unforgiving,
> dangerous. TECO, to be precise."
Heh, I prefer Joe Allen's editor and using it for development ;)

http://joe-editor.sourceforge.net/index.html

Best editor out there IMO! ;)

Greets

From: Kelsey Bjarnason on
[snips]

On Tue, 02 Mar 2010 15:13:46 +0000, Stefan Ram wrote:

> So it is not possible to align characters of a line that are not the
> first non-tab character of a line using tabs in such a way that they
> will be aligned for every tab width.

And thus, we have a conclusive argument for using spaces, which are
guaranteed never to work for any setup but the original author's, *and*
fail in a way virtually impossible to recover from?

Missed a step there, I think. :)

First  |  Prev  |  Next  |  Last
Pages: 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
Prev: integer
Next: shared memory question