Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: How has your coding style changed over the years?

by LanX (Saint)
on Aug 07, 2022 at 16:18 UTC ( [id://11145998]=note: print w/replies, xml ) Need Help??


in reply to Re: How has your coding style changed over the years?
in thread How has your coding style changed over the years?

> Oh, and I do care a single * about leading tabs or spaces even if you mix them. I don't see them. My editor does the right thing

If someone is using an indentation different to 4 you'll get ugly results. (That's actually a running gag in code sections posted here, because browsers still default to tab=8)

The only right thing your editor can do is reindenting all the code, which will result in a full diff when checking into version control.

And even with indent 4 calling untabify (or whatever it's called in vim) will cause unwanted diffs.

My strategy is to commit the untabified version first. But doing this everytime a colleague touched the file might get annoying.

So this question is of relevance when working in a team, IMHO. (And yes certainly YMMV)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^2: How has your coding style changed over the years?

Replies are listed 'Best First'.
Re^3: How has your coding style changed over the years?
by Anonymous Monk on Aug 08, 2022 at 12:58 UTC
    (That's actually a running gag in code sections posted here, because browsers still default to tab=8)

    this seems to have been fixed in the CSS or at least for Chrome

    for my $x (@a) { print; # 1 tab print; # 4 blanks }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 06:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found