Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: No Hard Tabs in Code

by Jenda (Abbot)
on Jul 01, 2010 at 13:02 UTC ( #847506=note: print w/replies, xml ) Need Help??

in reply to No Hard Tabs in Code

I would say "use spaces or use tabs, but don't mix 'em!" As long as you are consistent, you are fine. It's when you sometimes use a tab and sometimes N spaces when you run into problems. Or rather someone else with different size of tabs runs into problems.

I prefer tabs for indenting code myself.

Enoch was right!
Enjoy the last years of Rome.

Replies are listed 'Best First'.
Re^2: No Hard Tabs in Code
by eighty-one (Curate) on Jul 01, 2010 at 14:03 UTC

    I agree that consistency is important, but I think it's best that consistency extend to an entire team rather than being restricted to an individual coder.

    A problem arrises when working on a team without a set standard. While each individual might have their preference and stick to it, they're usually working on a file that has been through many hands, so you'll have a mix of tabs and spaces. And the space people could have 4 or 8 column tabs. So you wind up with code that's supposed to be on the same level of indentation prefixed with 4 spaces, 8 spaces, or a tab.

    I used to work at a place with defined coding standards - nothing passed review if it had the wrong bracket style, or if you had tabs instead of spaces, wrong variable naming format, etc. I thought it was rather draconian until I went to work for a place that had no standards whatsoever and saw what a mess things were. More that just aesthetic; it was diffictult to follow the code and figure things out when the indentation kept poping back in and out.

    That all being said, I'm a space guy who converted from tabs. For one, a space is a space no matter where you view it. I've got my editor configured to insert four spaces whenever I press tab.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://847506]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2021-10-23 07:26 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (87 votes). Check out past polls.