Discover the best of the web!
Learn more about Digg by taking the tour.
Messy Code? Stumped? Submit it to be refactored @ refactormycode.com
refactormycode.com — Have you got a method that you're dying to simplify? A class that's growing out of control? Or an algorithm that you just can't get working? Submit it to the new, awesome web app Refactor My Code, and have it refactored.
- 939 diggs
- digg it
- leontes, on 10/10/2007, -22/+3I wish I knew what the hell this article was talking about. I doubt it would make any sense of any code I'd write. I dunno... Does it do BASIC? Cause, man, I was mess back then.
- xJudahx, on 10/10/2007, -1/+25 REM Digg Rocks
10 PRINT "give up all hope" - AdHaR, on 10/10/2007, -1/+2There WAS an article?
- Pritchard, on 10/10/2007, -1/+1XML Parser Written in BASIC: http://copy-pasta.com/pasta129
Particle Adjustments in BASIC: http://copy-pasta.com/pasta731
Old (6+ months old), but I'd like to refactor it anyways ;p
- xJudahx, on 10/10/2007, -1/+25 REM Digg Rocks
- canuq, on 10/10/2007, -5/+1MIrror: http://mirror.canuq.com/3600015/refactormycode.com ...
- Xanadude, on 10/15/2007, -1/+78SO many people misuse the term "refactoring." If your algorithm doesn't work, it still won't work after you refactor it.
- ypSami, on 10/11/2007, -11/+7Indeed. Refactoring is for optimization; changing the code to run more efficiently, but with the exact same functionality.
- smackjer, on 10/24/2007, -0/+13No, refactoring is not for optimization. Refactoring is improving the design of code without changing its behavior.
Tuning for performance can be done as a refactoring, but refactoring is usually done for reasons other than performance. For example, to break a large method up into smaller methods (which will probably negatively affect performance a tiny bit), or to break a class that does 2 distinct things into 2 separate, cohesive classes.- phaed, on 10/10/2007, -7/+1Methods? 90% of my fellow Computer Science classmates think in Java too. The other 10% who call them functions will find a job.
- wentwj, on 10/10/2007, -1/+390% think in java
5% call them functions, are pricks, and think "method" is exclusive to java
5% don't really care what they are called in digg comments.
You do know that 'method' is used in languages beyond java as the terminology? Such as Ruby- nakani, on 10/10/2007, -1/+2Isn't a method just a function that belongs to a class? It's OO terminology
- Pritchard, on 10/10/2007, -0/+2Methods tend to come with automatic overloading, an implicit this, and follow the class encapsulation rules. You might as well start saying that Operators aren't Operators, just Functions, so stop being so (insert every language) like!
- smackjer, on 10/10/2007, -1/+0Yes, methods. http://en.wikipedia.org/wiki/Method_(computer_scie ...
By the way, aren't a good chunk of programming jobs in Java? Are you planning on getting a job doing VB for a living? Have fun with that!
- rzalegend, on 10/10/2007, -2/+2ypSami you are clueless.
- smackjer, on 10/24/2007, -0/+13No, refactoring is not for optimization. Refactoring is improving the design of code without changing its behavior.
- xJudahx, on 10/12/2007, -0/+30This is digg. we just pretend to be computer scientists
- Smills, on 10/10/2007, -0/+3I play the rich guy at parties.
- stoanhart, on 10/10/2007, -0/+1According to the description, this isn't about algorithms, it's about cleaning up code.
- spectre_25gt, on 10/10/2007, -0/+1Actually, if you read the description, it is.
"...Or an algorithm that you just can't get working?..."
- spectre_25gt, on 10/10/2007, -0/+1Actually, if you read the description, it is.
- ypSami, on 10/11/2007, -11/+7Indeed. Refactoring is for optimization; changing the code to run more efficiently, but with the exact same functionality.
- Dested, on 10/10/2007, -6/+7It seems to be down but unless its automated or something you're better off reading a tutorial on refactoring. Most decent IDE's contain functionality to refactor (things like extract methods, change variable names). Refactoring is one of the most powerful things I've learned as a professional developer. If you cant refactor get out of the game.
- dbr_onix, on 10/10/2007, -4/+4Most applications with the ability to edit text have the functionality to refractor...
- donte, on 10/10/2007, -7/+1I'm personally a big fan of just "get the code right the first time" and then you don't need a refactoring tool.
- spectre_25gt, on 10/10/2007, -0/+2Well, I applaud you for achieving perfection. For those of us still here in the real world, however, refactoring is a necessary part of coding.
- petdance, on 10/11/2007, -0/+1Nothing interesting or worthwhile is ever done right the first time.
- verifex, on 10/16/2007, -2/+40Awesome, now I can outsource my coding skills for free to the community. Thanks internet!
- tobias1482, on 10/10/2007, -0/+2you're very trusting then of the quality of the result...
- verifex, on 10/10/2007, -1/+1 I really doubt many people are really going to trust a social programming site for mission critical code. I wish them well, but the site kinda looks like junk.
- Napoleone, on 10/10/2007, -0/+1Have you got a method that you're dying to simplify? A class that's growing out of control? Or an algorithm that you just can't get working? Submit it to the new, awesome web app Refactor My Code, and have it refactored.
- verifex, on 10/10/2007, -1/+1 I really doubt many people are really going to trust a social programming site for mission critical code. I wish them well, but the site kinda looks like junk.
- petdance, on 10/16/2007, -0/+2You've always been able to do that. Mailing lists, Usenet, online communities have all been around for decades.
- funpet, on 10/16/2007, -0/+1But now you can do it anonymously!
- tobias1482, on 10/10/2007, -0/+2you're very trusting then of the quality of the result...
- Subterfug, on 10/10/2007, -2/+10It was dead when I got here.
- WolverineBlue, on 10/10/2007, -3/+27Yet another similarity between the hooker in my closet and this web app.
- Subterfug, on 10/10/2007, -6/+1Yet another similarity between you and I.
- capiCrimm, on 10/10/2007, -0/+3The hookers are temporary, read the note on the fridge.
- tobias1482, on 10/10/2007, -0/+1Not unless they're dead.
The things you do to clean up the ol'e neighborhood...
- tobias1482, on 10/10/2007, -0/+1Not unless they're dead.
- capiCrimm, on 10/10/2007, -0/+3The hookers are temporary, read the note on the fridge.
- tdous, on 10/10/2007, -0/+4It's good that you left her there though. It's what she would have wanted.
- Subterfug, on 10/10/2007, -6/+1Yet another similarity between you and I.
- WolverineBlue, on 10/10/2007, -3/+27Yet another similarity between the hooker in my closet and this web app.
- TheLastFreeMan, on 10/10/2007, -15/+2Oh that's useful. **nudge nudge wink wink CoughMicrosoftCough**
- Dested, on 10/10/2007, -2/+6=/ You have some kinda twitch?
- TheLastFreeMan, on 10/10/2007, -0/+1No its yo mama choking on my ding dong.
- adolfojp, on 10/10/2007, -2/+9Your comment doesn't make any sense whatsoever.
- TheLastFreeMan, on 10/10/2007, -0/+1Learn some ***** english hoe
- ypSami, on 10/10/2007, -5/+4How cute; A blatant display of pseudo intellectualism.
- TheLastFreeMan, on 10/10/2007, -5/+3No, it was a joke, it would have easier to just digg down and move on instead of being an arrogant prick about it.
- shawnz, on 10/10/2007, -1/+5yeah, but it's more fun being a prick about it.
- TheLastFreeMan, on 10/10/2007, -1/+1Go suck ypSami's dick bitch
- shawnz, on 10/10/2007, -1/+5yeah, but it's more fun being a prick about it.
- tdous, on 10/10/2007, -2/+7Hehe. Was the "pseudo intellectualism" crack an attempt at irony, given that the original post wasn't such and your reply definitely was?
- TheLastFreeMan, on 10/10/2007, -5/+3No, it was a joke, it would have easier to just digg down and move on instead of being an arrogant prick about it.
- Dested, on 10/10/2007, -2/+6=/ You have some kinda twitch?
- mik0r, on 10/10/2007, -3/+4Many times -as we do I'm sure- I come across these sorts of articles and I have the thought "Blah, I hate when people spam their own sites", and 9/10 times I don't even read more than half of it, nor visit the site...
- ypSami, on 10/10/2007, -1/+23They ought to submit their own site for refactoring based on the performance.
- Desimat0r, on 10/10/2007, -1/+8Based on the amount of Ruby code on the site, I'm willing to wager that it's running on Ruby on Rails.
- smackjer, on 10/10/2007, -2/+0Twitter handles 10k transactions per second and it runs on Rails.
The problem isn't Rails.
- smackjer, on 10/10/2007, -2/+0Twitter handles 10k transactions per second and it runs on Rails.
- Desimat0r, on 10/10/2007, -1/+8Based on the amount of Ruby code on the site, I'm willing to wager that it's running on Ruby on Rails.
- PoVRAZOR, on 10/10/2007, -4/+9And the solution to broken code/algorithms: Delete the contents. Infinite optimization. O(n) time.
- PoVRAZOR, on 10/10/2007, -3/+7oops... meant to put O(1), but meh... the joke's lame anyways.
- InvisibleKid, on 10/10/2007, -1/+2They should add Microchip assembler, that would rock
- gd007, on 10/10/2007, -1/+2there goes my job!
- shortarabguy, on 10/10/2007, -2/+2Your job clearly sucked. Don't feel too bad.
- Napoleone, on 10/10/2007, -0/+1Have you got a method that you're dying to simplify? A class that's growing out of control? Or an algorithm that you just can't get working? Submit it to the new, awesome web app Refactor My Code, and have it refactored.
- shortarabguy, on 10/10/2007, -2/+2Your job clearly sucked. Don't feel too bad.
- Desimat0r, on 10/10/2007, -1/+2Why isn't C++ available on this site? Only C and C#.
- IllBeBack, on 10/16/2007, -3/+2Because Linus hates C++? I dunno.
- QuickeningYak, on 10/16/2007, -3/+15Because real C++ programmers solve their own ***** problems.
- OrangeTide, on 10/10/2007, -9/+2What's C++? Is that one of those stupid OO fad languages of the 90s? I'll stick with C, thanks.
- nitsuj, on 10/10/2007, -0/+11Yes, because OO was just a fad and didn't catch on...
- WhereAmI, on 10/10/2007, -1/+1I've got some assembly I want to submit.
- elhaf, on 10/10/2007, -0/+1Because parsing C++ requires a real parser.
- davideparker, on 10/10/2007, -2/+0Sample request on the site: "How do I refactor this?"
2
3
4
5_=0;c(q){q_++%6&1?"Y_Zdfghbak":"X\"
"c[e^`ij]")[q]-99);}main(){while(_- dbr_onix, on 10/10/2007, -0/+4Wonder if anyone could refactor the following code for me:
http://guessthecode.pastecode.com/36997
I wrote it almost a year ago, and no one has worked out what it does yet..- c0ldfusi0n, on 10/10/2007, -0/+1I love the var names. You, my friend, code with style.
- Ademan, on 10/10/2007, -0/+1Uh yeah, this is perl, lol, anything that can spawn the 99 bottles program was MEANT to be obfuscated lol.
- 0gleth0rpe, on 10/10/2007, -0/+1Didn't you hear? The last person who knew Perl died 10 years ago.
- c0ldfusi0n, on 10/10/2007, -0/+1I love the var names. You, my friend, code with style.
- khmer42, on 10/16/2007, -0/+6Isn't that the Perl "Hello World" tutorial?
Sorry, just couldn't help myself.
- dbr_onix, on 10/10/2007, -0/+4Wonder if anyone could refactor the following code for me:
- antdude, on 10/16/2007, -0/+17Maybe someone should refactor Digg's comment system. ;)
- QuickeningYak, on 10/11/2007, -6/+4So it's an API for the "solve my problems for me so I don't have to" code design idiom. Great.
- vincherona, on 10/17/2007, -5/+0so easy a caveman could do it?
- baalzebub, on 10/10/2007, -1/+9coding is as much an art as it is a science/technology, sometimes when i hit a wall i just take a step back & go drink a cup of coffee or shot glass of whiskey (depending on the time of day), then i can look at it from a different perspective, or let it go for the day. and the next day a solution most of the time is found, never rush code when you can not find a clean & elegant solution or it will end up being a kludge, "never rush code can not be said enough times"...
- avisotin, on 10/10/2007, -8/+1Why is it then no matter how many days I leave my code, I can never find the solution in the end?
Dugg down as innacurate- QuickeningYak, on 10/10/2007, -0/+1Why is it that no matter how many times you stop trying, the code never just happens?
Dugg down as retarded.- Napoleone, on 10/10/2007, -0/+1coding is as much an art as it is a science/technology, sometimes when i hit a wall i just take a step back & go drink a cup of coffee or shot glass of whiskey (depending on the time of day), then i can look at it from a different perspective, or let it go for the day. and the next day a solution most of the time is found, never rush code when you can not find a clean & elegant solution or it will end up being a kludge, "never rush code can not be said enough times"...
What?
- Napoleone, on 10/10/2007, -0/+1coding is as much an art as it is a science/technology, sometimes when i hit a wall i just take a step back & go drink a cup of coffee or shot glass of whiskey (depending on the time of day), then i can look at it from a different perspective, or let it go for the day. and the next day a solution most of the time is found, never rush code when you can not find a clean & elegant solution or it will end up being a kludge, "never rush code can not be said enough times"...
- QuickeningYak, on 10/10/2007, -0/+1Why is it that no matter how many times you stop trying, the code never just happens?
- avisotin, on 10/10/2007, -8/+1Why is it then no matter how many days I leave my code, I can never find the solution in the end?
- mihkeltt, on 10/10/2007, -11/+4someone at microsoft should submit windows source code - and what he gets in return ? - linux source code.
- aaronm67, on 10/10/2007, -0/+1About a dozen other people have made similar comments already...and yet none of you seem to understand what refactoring means.
- leighmac, on 10/10/2007, -2/+2It's like photoshop tennis for code.. it's a brilliant idea.
- macournoyer, on 10/10/2007, -6/+8Hey all, I'm the stupid guy who created that site!
thanks for the comments!
Did it went down? It's up now ?! Sorry for that!
I used the term refactoring because I'd like it to be for refactoring indeed, not solve-my-problem-for-me.
Let me know if you got any problem with the site! Hope you like it and find it useful in some way- avisotin, on 10/10/2007, -5/+6Die in a fire
- smackjer, on 10/10/2007, -3/+0It sounds like it could be useful, but it's definitely down.
- smackjer, on 10/10/2007, -3/+0It sounds like it could be useful, but it's definitely down.
- ruscoe, on 10/10/2007, -1/+1All navigation is currently returning 404s.
- Napoleone, on 10/10/2007, -2/+1"Hey all, I'm the stupid guy who created that site!
thanks for the comments!
Did it went down? It's up now ?! Sorry for that!
I used the term refactoring because I'd like it to be for refactoring indeed, not solve-my-problem-for-me.
Let me know if you got any problem with the site! Hope you like it and find it useful in some way"
All of it.
- DroogInPhoenix, on 10/10/2007, -1/+6refactormyserver
- vulcanius, on 10/10/2007, -0/+3I prefer my Bicycle Repair Man.
- JernejL, on 11/10/2007, -2/+2No pascal?
- gernblansted, on 10/11/2007, -4/+2Yes, lets submit our possibly proprietary or otherwise protected source code to an unknown site. Good Idea.
- 0gleth0rpe, on 10/10/2007, -0/+2Hey, people are giving away login/pw to all kinds of ***** for facebook, why not this one? ;)
- kenwestin, on 10/10/2007, -2/+2Need to refactor their website for the Digg effect.
- SEJeff, on 10/10/2007, -3/+2Every single Link is a 404. Buried for being a lame broken site.
- tnoy, on 10/10/2007, -0/+2" Sorry my poor site went down due to the very very heavy traffic!
For now, I'm keeping this static page to show you what it look like, none of the links will work.
Make sure you bookmark the site and come back later when I change hosting provider.
Sorry for the inconvenient.
- Marc-Andre "
Burried you for your failure to read.
- tnoy, on 10/10/2007, -0/+2" Sorry my poor site went down due to the very very heavy traffic!
- Ademan, on 10/10/2007, -0/+1Alright alright, who's got access to Vista's source code?
- GreedKills, on 10/10/2007, -0/+1learn to code, dont ask others to do all your work, seems thats what the site really is about, a few people on it have posted like 12 different refactor posts
- echolyean, on 10/10/2007, -2/+25 Clicks.... 5 404s... Buried.
- Auxon, on 10/10/2007, -0/+1Great idea, too bad the poor architecture brought the site down. Of course good architecture includes choosing the right host to meet your demand, but let's see if they can turn this site around and into something useful.
- ellisgl, on 10/10/2007, -0/+1I would prove how sloppy coding can make for slowing debugging - but we can not use the pre tags.
- macournoyer, on 10/10/2007, -0/+3Seems like it's back up with more caching then ever! I'm really sorry it went down. But like all my side projects it's hosted on my DreamHost shared hosting account. This is not a company, team project, it's a 1 person side project I'm doing for fun. I never, in my wildest dreams (not the ones about Scarlett Johansson), expect it to be that popular.
Thanks for all the good comments, I'm glad lots of you share my view on how the site should be used. It's not for solving the problem on your behalf, it's for improving the inner structure and beauty of a function or small program (huh that's almost the definition of refactoring).
We all know how to solve every problem with code, but sometime someone else can help you improve your code in a way you never though about.
Thank you all, that was an amazing ride!- Napoleone, on 10/10/2007, -1/+1"Thanks for all the good comments, I'm glad lots of you share my view on how the site should be used. It's not for solving the problem on your behalf, it's for improving the inner structure and beauty of a function or small program (huh that's almost the definition of refactoring)."
Who are you talking to? - symen, on 10/10/2007, -0/+1I liked reading it ;)
You can learn a lot from reading different solutions to the same problem.
- Napoleone, on 10/10/2007, -1/+1"Thanks for all the good comments, I'm glad lots of you share my view on how the site should be used. It's not for solving the problem on your behalf, it's for improving the inner structure and beauty of a function or small program (huh that's almost the definition of refactoring)."
- AgentPeay, on 10/10/2007, -1/+2This site is my find of the month! It's hard for me to believe so many people can trash it... it's up, and I'm moving in. I could see this concept creating a new boom in open source development, or even the linux kernel (in time)...
Digg is coming to a city (and computer) near you! Check out all the details on our