News for hackers. Stuff that matters.
Re:OS X 10.10 – Source Code by themartorana on Thursday October 30, 2014 @10:51PM (#8537072)
You have no idea. I know git is supposed to mean I can delete code without fear of losing it.

Still...

Re:OS X 10.10 – Source Code by knodi123 on Thursday October 30, 2014 @11:06PM (#8537103)
When I comment out code, I add a timestamp of when I disabled it. Then, when I come across commented code with a timestamp more than 6 months old, I go ahead and delete it. Best of both worlds!
Re:OS X 10.10 – Source Code by philbo on Friday October 31, 2014 @04:34AM (#8537815)
This is a similar to an idea that David Schnepper talked about at Velocity Ignite this year.

It's only a five minute presentation but it blew me away and I'm keen to give it a try for real at some point. Video here:

https://www.youtube.com/watch?v=29UXzfQWOhQ

Re:OS X 10.10 – Source Code by lewispb on Friday October 31, 2014 @05:23AM (#8537938)
I like this alot, would anyone be keen to collaborate on a simple ruby gem to implement this 'tombstone' method?
Re:OS X 10.10 – Source Code by kcorbitt on Friday October 31, 2014 @07:37AM (#8538244)
great idea, I would definitely throw it into all of my ongoing projects.
Re:OS X 10.10 – Source Code by lewispb on Saturday November 01, 2014 @01:00PM (#8543730)
I put this together today, would value any feedback and/or contributions:

https://github.com/lewispb/tombstone

Re:OS X 10.10 – Source Code by dj-wonk on Friday October 31, 2014 @11:24AM (#8539208)
This is thought provoking; I shared my reactions here: http://djwonk.tumblr.com/post/101423057084/tombstones-as-a-w...
Re:OS X 10.10 – Source Code by thebouv on Friday October 31, 2014 @09:42AM (#8538662)
Wow, simple and short, but has already given me a ton of ideas. Saved and shared with our IS department too.
Re:OS X 10.10 – Source Code by robomartin on Friday October 31, 2014 @11:30AM (#8539251)
I wonder how they tombstone CSS.
Re:OS X 10.10 – Source Code by ionforce on Friday October 31, 2014 @11:00AM (#8539071)
Funny how this is kinda Halloween-ish.

Great share, thank you!

Re:OS X 10.10 – Source Code by madeofpalk on Thursday October 30, 2014 @11:21PM (#8537142)
Oh lord.

Best demonstration of Poe's Law right here.

Re:OS X 10.10 – Source Code by dshap on Thursday October 30, 2014 @11:58PM (#8537235)
Doesn't "git blame" take care of your timestamps for you?
Re:OS X 10.10 – Source Code by gcb0 on Friday October 31, 2014 @01:30AM (#8537466)
no. vc will only take care if you have the history and know what you are looking. if you publish a final version only like this all that is lost. if you run a interpreted language you can't find the place of the old code while debugging at runtime.

there are many reasons to leave code comments besides neglect. though in this case it's neglect :)

Re:OS X 10.10 – Source Code by tempodox on Friday October 31, 2014 @04:26AM (#8537807)
You still can put one on top of that, like this:

    #if 20141031     // Date as a valid number != 0
      // Active code
    #else
      // Inactive code
    #endif
Helps documenting experimental alternatives, even without SCM.
Re:OS X 10.10 – Source Code by gpvos on Friday October 31, 2014 @09:14AM (#8538539)
This is really terrible practice. You should only do this if you really have no SCM available.
Re:OS X 10.10 – Source Code by tempodox on Friday October 31, 2014 @10:43AM (#8538983)
I'm talking about experimental alternatives. This is not for production code. And it's still better than just out-commenting code to deactivate it.
Re:OS X 10.10 – Source Code by johnmaguire2013 on Friday October 31, 2014 @11:39AM (#8539311)
Glad to hear this isn't an odd concept. When I see others have commented out code in our codebase, I do a quick git blame (Sublime Git ftw!) and if it's from the previous year I'll just delete it.
Re:OS X 10.10 – Source Code by akirk on Friday October 31, 2014 @10:39AM (#8538962)
I would be awesome if there were a plugin (for your favorite text editor) for that. It should be easy to add automatically and remove when you uncomment it.
Re:OS X 10.10 – Source Code by dj-wonk on Friday October 31, 2014 @11:35AM (#8539284)
Perhaps not a bad idea. One advantage to David Schnepper's suggestion (in the video above) is that the tombstone is executable code, which can lead to metrics and even automated code removal. Buyer beware!
Re:OS X 10.10 – Source Code by phkahler on Friday October 31, 2014 @09:45AM (#8538676)
I like that idea. I remove commented code when it's "old enough" but know how long it's actually been could be really helpful.
Re:OS X 10.10 – Source Code by agumonkey on Friday October 31, 2014 @03:25AM (#8537683)
Hmm what a nice extension idea for emacs comment-dwim.
Re:OS X 10.10 – Source Code by rjbwork on Friday October 31, 2014 @12:48AM (#8537369)
We aggressively delete code. Hg/git will have it if you ever need it.

We never have.

Re:OS X 10.10 – Source Code by Groxx on Friday October 31, 2014 @01:11AM (#8537424)
This. Though I do often wonder how often I re-type the same thing, because I can't simply uncomment, simply because it's easier to type it out than it is to go hunting through the history. Maybe I should try to make a Git history "redone undos" script or something.

When I actually think about it I realize it's probably very nearly never. But it's hard to shake the suspicion :)

Re:OS X 10.10 – Source Code by NietTim on Friday October 31, 2014 @04:08AM (#8537766)
It's just more convenient to keep the code in, otherwise you'll have to look it up again which takes more time... (and effort, we're developers after all)
Re:OS X 10.10 – Source Code by danudey on Friday October 31, 2014 @03:09PM (#8540531)
When you put a lot of time and effort into adding code in all the right places to provide for functional, helpful debugging, tearing it all out afterwards is just going to make you add it back in again when debugging something else down the road.

Even if you tear it out, it's way more work to try to pull it all back out, line by line, and re-implement it than to comment it out and leave the actual debugging statements in #ifdef blocks that the pre-processor will pull out anyway.

Re:OS X 10.10 – Source Code by calinet6 on Friday October 31, 2014 @09:59AM (#8538731)
This was the one thing that my CS professors drilled into my head most: you have source control, why would you comment?

You only make your source control more valuable by not commenting out code; since you can then search for its presence more easily. Good advice, all around.

Re:OS X 10.10 – Source Code by budu3 on Friday October 31, 2014 @01:36PM (#8539992)
I think it's genetic :) Some people are "code pack rats". They're afraid to delete anything.