IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Spaces! Tabs! Vim! Emacs!
--

Drew
New unalias vi
always look out for number one and don't step in number two
New Heh
It's like two relics from the 80s arguing over whether Flock Of Seagulls or Shriekback is the best.
New I agree with him
On the other hand I prefer vim over an emacs.
New Re: Spaces! Tabs! Vim! Emacs!
-Mike

@MikeVitale42

"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
- Benjamin Franklin, 1759 Historical Review of Pennsylvania
New Neat.
That's some heavy-duty (compared to things I've seen) data crunching. 16s for 133GB?!?

But surely if someone is a Tabs Zealot or Spaces Zealot then the files would be exclusively one or the other, no? At least the non-commented part of the code. Would it change the results - I assume not?

Cheers,
Scott.
New When I work on someone else's code I don't reformat the whole thing
Mixed styles means multiple authors.
--

Drew
New Ah, excellent point.
New +5, Useful.
I have had a couple of colleagues over the years actually appreciate the subtly different formatting styles in use because it was obvious which parts had been touched. And to some extent, even who (and it's often faster than git annotate or svn blame).

Wade.
New Never mind that
It fucks the diffs.
New You mean ... ?
"Fixing" the formatting causes diff and blame to show the reformatter as the author of every line. You lose history of real changes.
--

Drew
New Exactly so.
New Ooh. That's evil.
You mean a "diff" tool these days isn't smart enough to understand non-critical differences in formatting (not things like tabs in python code)? That's pretty bad.

So what are professional teams supposed to do these days? Is it standard to have a "This is How We Write Code Here and You Better Do It This Way Or Else" rule for new hires? Is there a "Style Gateway Check" rule before code is checked into the repository?

I think NASA and "Our Code Has To Be Correct and Audited to Be Correct or People Will Die" places have rules like that, but is it common elsewhere?

Should it be? Would code jockeys put up with it? Do universities teach the importance of things like this for teams?

Thanks.

Cheers,
Scott.
New Yes and no
Diff tools can ignore whitespace, so that helps. Modern dev tools can apply standard formatting when you save or check in.

Most shops will have local style, it's up to time and determination to enforce it. Mature developers know that matching local style is more important than your personal preferences and adapt.
--

Drew
New Most proper software shops...
...have a Coding Standards document that says how you format your code, amongst other things.

If you go through and reformat code, things change. If you touch it, the risk of breaking it increases by 100%, compared to not touching it. And it's not just whitespace - changing brace style moves characters from one line to another - like :


void myfunc(char * thing)
{
....stuff();
}

vs

void myfunc(char * thing) {
....stuff();
}


(full stops substituted for spaces, which get eaten by the post parser thinger)

I can't speak for other companies, but not following the Coding Standards in our gaff is the software equivalent of coming to work whenever you like, wearing dirty underpants as a hat, eating fried fish at your desk, and peeing in a bucket in the corner of the office.

Point being: it's not just your code.
New Definitely comes down to standards.
Our standards are still evolving in some sense, however, so the rule is typically:

If you're touching a file, you should reformat the things you're changing. If you find a file that needs wholesale changes (very rare: we all install PEP8 linters in our editors), make them in a separate commit.

As an example of evolution, we now use an import style that puts multiple imports from the same module on separate lines. Adding a new import only changes one line, and reordering the imports if someone hasn't done so doesn't really confuse things.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New My solution for mutlple authors...
I put "artistic style" in the make file. No matter how you set your tabs, spaces, bracket convention, etc., when it compiles the output is put in a standard agreed upon format. It's open source, free, easy to use. I get the author of the changes from rev control logs. If I have to track the author down through code style and personal idiosyncrasies, I'm likely to murder him when I find him. This is much easier and less likely to get me talked about.
My group uses vim in a linux environment that does not have run level 5 (no GUI). There's an upper limit to how fancy we can get.
"Religion, n. A daughter of Hope and Fear, explaining to Ignorance the nature of the Unknowable."
~ AMBROSE BIERCE
(1842-1914)
New Command line Emacs is pretty fancy... ;-)
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New True...
However the sysadmin wanted to know why I wanted to put a second operating system on just to edit files. This bunch has been doing pretty much the same thing the same way for 18 years. I go with the flow.
"Religion, n. A daughter of Hope and Fear, explaining to Ignorance the nature of the Unknowable."
~ AMBROSE BIERCE
(1842-1914)
New "Just edit files"
Well, there's your problem. ;-)

That said, it depends on how seriously you are editing files. The modules I have installed in my Emacs do an awful lot of productivity-enhancing stuff.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New I notice you didn't dispute "second operating system"
--

Drew
New UNIX is a subprocess that runs under Emacs.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Oh, I know...
I've used it quite effectively elsewhere. If I tried to introduce new ways in my current location, I'd get the "you're not from around here, are you?" sort of thing.
They pay the piper, they call the tune. I'm way past pissing into the wind at this point.
"Religion, n. A daughter of Hope and Fear, explaining to Ignorance the nature of the Unknowable."
~ AMBROSE BIERCE
(1842-1914)
New :-)
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Silly.
Use Emacs and it will change your tabs into spaces for you. Duh.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
     Spaces! Tabs! Vim! Emacs! - (drook) - (24)
         unalias vi -NT - (boxley)
         Heh - (pwhysall)
         I agree with him - (crazy)
         Re: Spaces! Tabs! Vim! Emacs! - (mvitale) - (19)
             Neat. - (Another Scott) - (18)
                 When I work on someone else's code I don't reformat the whole thing - (drook) - (17)
                     Ah, excellent point. -NT - (Another Scott)
                     +5, Useful. - (static)
                     Never mind that - (pwhysall) - (6)
                         You mean ... ? - (drook) - (1)
                             Exactly so. -NT - (pwhysall)
                         Ooh. That's evil. - (Another Scott) - (2)
                             Yes and no - (drook)
                             Most proper software shops... - (pwhysall)
                         Definitely comes down to standards. - (malraux)
                     My solution for mutlple authors... - (hnick) - (7)
                         Command line Emacs is pretty fancy... ;-) -NT - (malraux) - (6)
                             True... - (hnick) - (5)
                                 "Just edit files" - (malraux) - (4)
                                     I notice you didn't dispute "second operating system" -NT - (drook) - (1)
                                         UNIX is a subprocess that runs under Emacs. -NT - (malraux)
                                     Oh, I know... - (hnick) - (1)
                                         :-) -NT - (malraux)
         Silly. - (malraux)

But it makes such great fish bait!
83 ms