Re: VIM config in PEAR files?
| From: | Stig S. Bakken | Date: | Tue, 16 Apr 2002 21:25:41 +0000 |
| Subject: | Re: VIM config in PEAR files? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-5585@lists.php.net to get a copy of this message | ||
On Tue, 2002-04-16 at 17:09, Dave Mertens wrote:
> On Tue, Apr 16, 2002 at 11:26:26AM +0200, Stig S. Bakken wrote:
> > On Tue, 2002-04-16 at 11:01, Dave Mertens wrote:
> > > On Mon, Apr 15, 2002 at 09:06:22PM +0200, Stig S. Bakken wrote:
> > > > On Mon, 2002-04-15 at 11:23, Dave Mertens wrote:
> > > >
> > > > Tabs have variable rendering size, so using spaces only is the only
> > > > predictable way of formatting code. Did you ever see what happens to
> > > > indentation in "cvs diff" output on code that uses a mix of tabs and
> > > > spaces? Or in "less"? Or in any other program using a different tab
> > > > width? It's all messed up, and that's why we have this standard.
> > >
> > > But why is using someone spaces and tabs mixed up?? And in every editor a tab still
> > > is a tab.
> > > I don't program in diff and less is as far i know read-only.
> >
> > printf("%s",
> > $arg);
> > ^^^^^^^
> > This is 7 spaces. That's one 4-space tab and 3 spaces. If displayed in
> > some editor that has 8-space tabs by default, it will look like this:
> Why did you used tabs and spaces mixed up?? That doesn't make sense. Just use 2 tabs or
> better, just 1.
>
>
> > Ditto with tabbed code written in an 8-space-tab editor viewed with
> > 4-space tabs:
> >
> >
> > if (foo &&
> > bar) {
> > }
> >
> > Will look like this:
> >
> > if (foo &&
> > bar) {
> > }
> This one is incorrect. I guess that the second line is a indenting of the if statement.
> That also that line will indent 8 spaces. If the second line is done with spaces you simple
> can't program.
>
> Sorry.
>
> > In an environment like PEAR where people use lots of different editors,
> > using tabs simply doesn't work. People will end up doing whitespace
> > commits fixing rendering in their editor, while breaking it for others.
> > Without tabs it will look the same to everyone.
> Rendering?? I hope most people spend their time on programming and not how it looks in a diff!
>
> >
> > Diff and less are tools that programmers use, so that argument is just
> > bogus.
> I only use diff to see the difference between 2 pieces of code (mostly cvs diff)
> And also than a tab will be display as a tab. And that the codeline it a bit longer or
> continued on the next line that doesn't matter.
>
> All the php files I want to read i do in an editor. Or won't accept VIM a filename?
> b.t.w. What's the difference between VI and VIM?
VIM = "VI iMproved"
> But you can't convince me. I do programming for more than 17 years now. It can't just
> change my coding style. Maybe i write a little script that convert tabs into 4 spaces and backwards.
Nobody is asking you or anyone else to change coding style. I certainly
haven't changed mine because of this, I just have a hook in Emacs that
disables "indent-tabs-mode" when I edit pear files. Most editors have
an option for disabling tab-indenting, if not as flexible as Emacs's.
Are you suggesting that people are doing indentation by hand?
- Stig