|
I do it the same. Since I'm missing exactly this answer option I vote here.
|
|
|
|
|
I'm wading through a sea of crap due to this policy. Or maybe they got cold feet and decided to keep it just in case.
|
|
|
|
|
Funny you should mention it... I read this poll while I was in the process of commenting out some code. Once I've written the new stuff (and it works), the old stuff will be promptly deleted.
The United States invariably does the right thing, after having exhausted every other alternative. -Winston Churchill
America is the only country that went from barbarism to decadence without civilization in between. -Oscar Wilde
Wow, even the French showed a little more spine than that before they got their sh*t pushed in.[^] -Colin Mullikin
|
|
|
|
|
I keep dead apps, early versions that didn't make it past POC stage, apps that made it into production a decade ago and have since been retired. I still have old VB6 apps hanging around somewhere. I certainly have a bunch of VB.net apps in a folder on the current machine and all c# stuff is actively searched for functionality I know I have written just not which app
As for active code, like DaveAuld, I comment and delete only after stability of the new code is proven.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I comment out code regularly if I feel it will be required in the future.
However, if it no longer serves any purpose, I'll remove it.
I like to comment my code too, which helps other programmers and myself understand what is going on.
Did you hear about the thief that stole the salt and pepper?
Apparently he was a seasoned criminal.
|
|
|
|
|
DanielSeal wrote: I like to comment my code too, which helps other programmers and myself understand what is going on
As for commenting code (adding text to describe what's going on) when I see too many comments I'm scared.
If who developed the thing felt like he needed to explain a lot usually is because the implementation itself is a mess.
IMHO, Code should be clear to read and generally commented.
|
|
|
|
|
I tend to first comment it out, then if it stays commented for a while, I delete it. And of course, everything is under source control, so if I need to recover it, theoretically I can. Theoretically, not because of a failing of source control, but because I may not either remember that I wrote it, or how to find it. Yes, I am one of those people that started writing a whole chunk of functionality once, only to remember, as I was going about it, that I had written that functionality a year or so before. And, amusingly, I was implementing it in a completely (and worse) different way!!!
Marc
|
|
|
|
|
True and sincere. I'm on the same side.
|
|
|
|
|
...deleting a few thousand lines of unused code. If it's database tables it's even better (ok, this implies that I've followed some procedure of quarantine, because you cannot recover data from the source control :P)
|
|
|
|
|
I would be happy to delete any code I've commented over 4 hours ago
And in case there's some code I'm not sure about, I use the famous:
// TODO: Delete when you grow up
// void myUselessOldCode()
// ...
Then every now and again I do CTRL+F on "TODO:" and handle it.
Keeping old code longer than this process not in source control, is rather silly.
Never underestimate the difference U can make in the lives of others.
∫(Edo )dx = Tzumer
∑k( this.Kid) k = this. ♥
|
|
|
|
|
You don't need to CTRL+F if you're on Visual Studio.
On the Task List view you'll see all your TODO's.
Also supported natively are HACK and UNDONE but you can even define your own tags under Tools > Options > Environment > Task List
Cheers!
|
|
|
|
|
pffff, after all these years
I'd 5 you again if I could!
Tnx Alex
Never underestimate the difference U can make in the lives of others.
∫(Edo )dx = Tzumer
∑k( this.Kid) k = this. ♥
|
|
|
|
|
Source Control.
"Bastards encourage idiots to use Oracle Forms, Web Forms, Access and a number of other dinky web publishing tolls.", Mycroft Holmes[ ^]
|
|
|
|
|
amen
you want something inspirational??
|
|
|
|
|
Saw this survey and thought it was about code hoarding as in directories 10 levels deep full of collected source code zip files from around the web. *inhales* Turns out it is just about comments in active projects. I am definitely a code archive hoarder. Seeing how a lot of example code out there does not have version control. (I'm looking at you code project) So as for the survey answer, I chose remove old code, except I don't. Use git you'll feel better in morning. Branching is stupid fast with it, in fact, I create branches on a whim to test changes to a single file.
|
|
|
|
|
Deus ex Machina wrote: Use git you'll feel better in morning.
I loathe Git. Biggest Rube Goldberg POS I've come across in a while.
Marc
|
|
|
|
|
Marc Clifton wrote:
Biggest Rube Goldberg POS I've come across in a while.
No offense but that gave me a good laugh. To each their own I guess. I like it though, mind you it does have its drawbacks. git merge is very picky for example. I never liked Subversion with its bandwidth intensive commits. I'm in the Kansas City Area so eventually I will have Google Fiber then it won't matter. I've never really used anything else and I haven't needed to. I can only fit so much stuff in my brain at a time. Whoops there went Java.
|
|
|
|
|
Deus ex Machina wrote: No offense but that gave me a good laugh. To each their own I guess.
None taken - while I have strong opinions about Git, I know I'm the outlier, and so I approach my opinions with humor!
Marc
|
|
|
|
|
For me was a matter of start using it properly.
Before that I didn't even understand why people were so devoted to it.
And the raw you handle it, the better it becomes.
I used to be a TFS user and an SVN lover.
Now for me, TFS is gone and SVN is legacy.
But just to make it clear, is MHO.
Cheers,
Alex
|
|
|
|
|
Step 1: comment
Step 2: run for ages to make sure nothing broken by this
Step 3: delete
|
|
|
|
|
It's not so much so that I'm sure nothing is broken (I do testing to verify that); but more so that when I look at the code in a month's time I have a visual reminder that things in this bit no longer work the way they used to. I don't have any written specs from my main client, it's mainly coded "on the hoof" and sometimes the client will ask about functionality. If I have to refer to the code and see old code commented out (with a date, of course!) I can say "until such-and-such a time it did that, now it does this". I could get that detail from source control but it's much faster if it's right there in the code, rather than having to check back in multiple old versions in TSVN. When the change is fully internalised (into my brain) and the client has got used to the new behaviour too, then I'll delete it. Of course the original, and commented, versions will still be in TSVN should I ever need to refer to it or check the date of the change.
|
|
|
|
|
Have to agree. That is way I do it.
|
|
|
|
|
Agreed.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Agreed. I routinely comment out a block of code, rebuild and retest, and then remove it later after the new block is proven reliable.
It generally depends on the complexity of the code being replaced. The more complex the logic, the more likely I am to keep the commented-out stuff around. That way I can easily compare the new and old code in place. I know you can do this with source control, but for smaller code snippets of a few dozen lines, using source control is cumbersome.
Software Zen: delete this;
|
|
|
|
|
Agreed on this.
Sometimes there's no better place to put a reminder than within the code as to why something was disabled.
No single raindrop believes it is to blame for the flood.
-irresponsibility@Despair.com
|
|
|
|