Thursday, February 11, 2010

Agile Best Practices : Refactoring

Yesterday, 10th Feb 2010, i was invited to speak at a Techies UG event, here in Dubai, UAE.

I started off the discussion with defining the practice of refactoring and i quoted Martin Fowler's blog as following


•Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior.

•Its heart is a series of small behavior preserving transformations.

•Each transformation (called a 'refactoring') does little, but a sequence of transformations can produce a significant restructuring.



After this we moved on to the best practices for refactoring classes. Following is a list that we discussed:-

  • Comments
  • Long Method
  • Long Parameter List
  • Duplicate Code
  • Large Class
  • Type Embedded In Name
  • Un Communicative Names
  • Inconsistent Names
  • Speculative Generality

The session was very intense with everyone chipping in with their comments and i thoroughly enjoyed hosting it. Towards the end Anton and I wrote couple of code snippets to check the Andrew idea of using Interfaces (more on it later on). Rolf also chipped in with his comments and critiques. Notable absentees were Ron and Zubair and it would have been much more fun had they attended the event.



ps: watch out this post for snaps from the event.

Edit#1: Rolf's blog post on the event is live http://techiesleaders.spaces.live.com/Blog/cns!50531D3D6442376A!214.entry

6 comments:

Zubair.NET! said...

This looks like an interesting discussion, too bad I missed it, hopefully I'll join in the next one InshaAllah

vishal said...

EASY EARNING MONEY IN ONLINE NEVER BEEN THIS EASY AND TRANSPARENT.YOU WOULD FIND GREAT TIPS ON HOW TO MAKE THAT DREAM AMOUNT EVERY DAY.SITTING IN THE HOME EARN AROUND $100 PERDAY. SO GO AHEAD AND click here FOR MORE DETAILS AND OPEN FLOODGATES TO YOUR ONLINE INCOME.

ALL THE BEST

THANQ

Inventory Management Software said...

Thanks for sharing your post and it was superb .I would like to hear more from you in future too.
Regards: http://www.blackitsoft.com/inventory-pos-software.aspx

Cabinet Roll Towel said...

I am quite sure they will learn lots of new stuff here than anybody else!

Anonymous said...

I would like to thank you for sharing your thoughts and time into the stuff you post!! Thumbs up




web Design

CCTVkarachi said...

Great post, I admire the writing style :) A little off topic here but what theme are you using? Looks pretty cool.

Security Equipments