| «« Learning from Mistakes | First Day »» |
|
About
I'm Ryan Lowe, a Software Engineering graduate living in Ottawa, Canada. I like agile software development and Ruby on Rails.
I write this blog in Canadian English and don't use a spell checker. Typos happen.
Projects
» Full-time Ruby on Rails freelancer
» Full-time with Rails since May 2005 » Former committer for RadRails (now Aptana) » I also have a few Rails side-projects in development: 1. wheretogoinTO.com Toronto nightlife 2. Hey Heads Up! TODO list and sharing 3. Layered Genealogy family history research 4. foos for foosball scoring 5. fanconcert for music fans (on hold) Hiring Rails developers? I can telecommute by the hour from Ottawa, Canada »» Email: rails AT ryanlowe DOT ca
BulletBlog
Now hosted on Hey! Heads Up -- check it out!
Syndication
Pings
Recent
Derek Lowe's (Ryan's older brother) words at Ryan's funeral
blog@ryanlowe.ca no more Forging Email Headers: Good, Bad or Ugly? Sarcastic Dictionary (Part 1 of Many) Tags Hierarchies Twisting Rails is Risky Business Risky Business? My Take on Early Alphas Whoa, it's August 2007 Closing Comments A Postscript to "Growth at the grassroots" »» All Blog Posts
Linkage
del.icio.us/ryanlowe
technorati/ryanlowe.ca/blog Aurora Roy Jim Andrew Trasker Travis Kibbee Karen Dr. Unk Ayana Van Bloggers Joel Spolsky Robert Scoble Tim Bray Dave Winer Raymond Chen James Robertson Ruby/Rails Bloggers rubyonrails.org weblog David Heinemeier Hansson Dave Thomas James Duncan Davidson Mike Clark Jamis Buck Signal vs. Noise Tobias Luetke Amy Hoy: (24)slash7 Jeremy Voorhis Eclipse Bloggers Planet Eclipse EclipseZone Luis de la Rosa Eclipse Foundation Kim Horne Billy Biggs Ian Skerrett Mike Milinkovich Bjorn Freeman-Benson Denis Roy
Archives
|
I, rLowe
Jim points out that Robert Cringely says: "Cleaning up code" is a terrible thing. Redesigning WORKING code into different WORKING code (also known as refactoring) is terrible. The reason is that once you touch WORKING code, it becomes NON-WORKING code, and the changes you make (once you get it working again) will never be known. It is basically a programmer’s ego trip and nothing else. Cleaning up code, which generally does not occur in nature, is a prime example of amateur Open Source software.It's obvious here that Cringely has no idea what REFACTORING is and why people do it. Maybe he should spend some time over at XProgramming.com before he formulates an opinion on it. Number one, you cannot effectively REFACTOR without tests. You have tests to prove that your code is working the way you expect it to. You REFACTOR and then run those tests again to prove the code still works. Did I just break the code? No, I didn't. Number two, REFACTORING is used effectively in agile development processes. In those processes developers strive to implement the minimum functionality required to complete a feature. Many times this gives code that cannot be expanded on later, it just does the job it has to do right now to solve the problem. It often does not incorporate a large amount of software design. However, on the next development iteration if the developer needed more from the code and at that time wanted to incorporate more "design", he would have to REFACTOR the code. REFACTORING involves changing the old code so that it can accomodate the new feature. But no new features have been added yet! When all of the tests pass after the REFACTORING you are ready to add the new feature, which by that time is probably a walk in the park. Now, let's call a spade a spade. Developers fiddling with their code because they were on a caffeine high the night before does not constitute REFACTORING. Developers will always do this because most are perfectionist-types. Without proper testing, it is not REFACTORING! Posted at May 04, 2003 at 06:16 PM ESTLast updated May 04, 2003 at 06:16 PM EST Comments
I haven't used refactoring as much as you, but "Cleaning up code" is important and necessary. It's like proofreading someone's essay. They may have got their point across, and got a solution, but it's still not polished and 100%. What's wrong with making things efficient and elegant. Damn straight I'ld tweak my code if I thought it needed it. I myself work in phases, where I know even though I have a solution, I'm going to need to go back and make it a better solution. In math and in life, there are millions of solutions to a single problem. Which one is right? Which one is worth looking at? There's just too many. Which is why looking over solutions and not being arrogant enough to think that the solution you have is not the final say is important. » Posted by: roy at May 5, 2003 03:18 AMBut Cringely is right when he says that you can break your code easily. That's why you need the tests. "If you ain't got tests, don't fix it. Don't matter if it's broke or not." ;) » Posted by: Ryan at May 5, 2003 07:15 AMhahaha... I like that last comment. Don't fix it if you don't have tests, even if it is broken. if (tests > 0)
|