Helping Developers Master PowerBuilder Classic and .NET

Yakov Werde

Subscribe to Yakov Werde: eMailAlertsEmail Alerts
Get Yakov Werde via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

Related Topics: Enterprise Architecture, Enterprise Application Performance

Blog Post

Re-Fact-Orings Of Life

Discovery about the relationship between refactoring and a healthy life style


When I first accepted the assignment to write a tutorial about refactoring code, I was sure that refactoring was something that developers did when ‘extreme' requirements hit their application.  Like when, management wanted to move the entire app to the web or extract the business logic out of the application for use in other applications. 

After all, the focus of the assignment was migration to PowerBuilder 12. 

I perceived refactoring as a bitter pill (radical procedure) that a team had to swallow (perform) when code got too old to stay in its existing form and needed a lobotomy to survive.

Curiously, at about the same time, I was brought in by a client to add functionality to an enterprise scale application whose 2nd set of developers had moved on without leaving a trace of their whereabouts.  The first phase of the application involved modifying sections of the existing code as well as implementing an external workflow processor to interact with an external system.  Being a natural mulititasker and sensing the opportunity, I used my analysis and coding experiences to percolate (brew) (formulate) my knowledge, skills, ideas and thoughts on refactoring in PowerBuilder.

A bit of online research and reading showed me that refactoring was in fact something that I did informally every day to my own code without recognizing it and giving it a formal name.  Once I was aware of what refactoring is I caught myself doing it multiple time a day on my own new code!  I quickly came to the conclusion that refactoring IS one of the seven habits of highly successful programmers <ala steven covey> .  It is necessary to be on the lookout for refactoring opportunities to keep a code base in tip top shape to fight off the forces of software rot - the gradual return to chaos that can happen to any living software system.

I also discovered that much has been written on the subject of refactoring.  Especially comforting was my garnered understanding that well factored code is long lasting maintainable, highly extensible code.  The best part is that refactoring can be applied gradually over the course of time or in a critical situation approached in a special development phase.

Perhaps I am comfortable with refactoring because of my lifestyle.  I'm a health conscious eater and exerciser who embraces the daily overhead of maintaining my lifestyle as an investment toward a brighter long term future.  Bill Opdyke  likens refactoring to health conscious living.  Health conscious people tend to overlook short term discomforts and inconveniences in exchange for long term benefits. ....  As Opdyke concludes, "My experience suggests that as refactoring becomes part of a routine, it stops feeling like overhead. This statement is easy to make but difficult to substantiate. To the skeptics among you, my advice is just do it, then decide for yourself. Give it time, though"

Alas, The PB IDE has no direct support for refactoring.  It is really a time/effort intensive manual task - Because of the nature of the tool and the lack of add on tool support, it's a bit more work to refactor code in PB!. (Please don't make this into an excuse not to refactor!)

My wish list includes tool support for Moving methods up a hierarchy while directly adjusting all descendant code, creating functions from sections of code with parameter declaration support, adjusting variable scope with support for reference modification, relocating methods to different classes, creating data beans from datawindow objects with getter and setter methods

Hey Sybase engineer guys - VS has some native refactoring support: How about adding it the PB.NET IDE - I'd like to write about tool support for this all important software engineering initiative.

There is also a commercial tool - perhaps you can convince them to add Powerscript support.

More Stories By Yakov Werde

Yakov Werde, a 25 year IT industry veteran, is a member of TeamSybase and the newly formed Sybase Customer Evangelist Team. Yakov is a recognized author, speaker and trainer who has been designing and delivering PowerBuilder, .NET, EaServer, Web App Development, and Java training for over 14 years to corporate, military and government developers. Prior to discovering his aptitude as an educator, Yakov worked as an architect, project manager and application coder in the trenches of application software development. Yakov holds a Masters in Education with a specialty in instructional design for online learning from Capella University and a BS in math and computer science from Florida International University. Yakov, managing partner of eLearnIT LLC (www.elearnitonline.com), authors and delivers workshops and web based eLearning tutorials to guide professional developers toward PowerBuilder Classic and .NET mastery. Follow Yakov on Twitter as @eLearnPB