Win a copy of Fixing your Scrum this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

What is refactoring?

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is Refactoring? I am pretty new to this topic. So please can any one out there throw some light on this.
Thanks in advance.
cHeErS,
John
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at the Refactoring Home Page
http://www.refactoring.com/
Regards
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's basically a set of methods you can use to simplify your code, making it easier to test and maintain. XP suggest that you write a test, code, refactor, write a test, code, refactor, etc. In other words: first define what you want to achieve, get it working next and then make it clean and maintainable.
Refactoring by hand is a chore, a good way to learn it is to get a nice IDE with refactoring support. IntelliJ IDEA, for instance. Here is a list with many refactoring tools.
 
John Mallavalli
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks guys..
ChEeRs,
John
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Wouter Zelle:
It's basically a set of methods you can use to simplify your code, making it easier to test and maintain. XP suggest that you write a test, code, refactor, write a test, code, refactor, etc. In other words: first define what you want to achieve, get it working next and then make it clean and maintainable.


You don't need to use this development cycle to get value from refactoring, though.
Refactoring is accommodating the fact that program design invariably degenerates over time. So if you have to clean up the code regularly if you don't want to end with a "ball of mud".
The "Refactoring" book is showing indications of design problems (so called "code smells") and providing solutions to remove them in tiny little steps. The purpose is to evolve the system to a better state while sustaining its perceived behaviour and having a working system every couple of minutes.
Like the Design Patterns book, it also gives the patterns names (like the "Jealousy" code smell iirc), simplifying communication between developers.
IMO the book is a definite must-have.
 
Wouter Zelle
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You don't need to use this development cycle to get value from refactoring, though.


True, it's just a guideline. I usually just refactor when a smell hits me in the face. The point I was trying to make was that refactoring, coding and testing are strongly related. Refactoring makes your code easier to test and expand with new features. So you should really be doing it while coding.
Don't create seperate tasks in the future where you will be refactoring parts of your code (unless it really is a mess ), do it when you see a problem. Refactoring is coding.
 
You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic