Re: What Refactorings Would you Like for C
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Thu, 27 Mar 2008 11:14:12 +0000
pingu219 said:
Hi I'm currently a student working on an honours-level project to
create a visual tool which will be able to represent C project files
and code as well as allow the user to perform high and certain low-
level refactorings.
At the moment I'm compiling a list of refactorings which are
applicable to C that people who program alot with structured
programming languages find useful.
So far I've got (some I got from someone else's post on another google
group):
- Rename variable/function
- Move variable/function
- Reduce scope of variable
- Publish function (make it public, put a declaration in the .h file)
- Perish function (make it static, remove it from the .h file)
- Add/Remove parameter from function
- Reorder function arguments
- Remove unnecessary includes
All of those look reasonably possible (which is no doubt why you're
considering them) but, to my eyes at least, none of them look like
refactoring.
To me, the most important aspect of re-factoring is that of identifying big
lumps of functionality that are duplicated, or near-duplicated, in several
parts of the code, and moving things around so that the duplication is
reduced or eliminated. If I can take a mathematical analogy, it's as if
you're given 2x^2 + xy - 6y^2 and find some way or other to reduce it to
(x + 2y)(2x - 3y). Hence "re-factoring".
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- References:
- What Refactorings Would you Like for C
- From: pingu219
- What Refactorings Would you Like for C
- Prev by Date: Re: thread status
- Next by Date: Re: What Refactorings Would you Like for C
- Previous by thread: What Refactorings Would you Like for C
- Next by thread: Re: What Refactorings Would you Like for C
- Index(es):
Relevant Pages
|