|
Posted by Steve on 08/29/07 18:22
"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:WN2dnS1uY4uAOkjbnZ2dnUVZ_ternZ2d@comcast.com...
| Steve wrote:
| > "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
| > news:W5idncnku_TD10nbnZ2dnUVZ_g6dnZ2d@comcast.com...
| > | Steve wrote:
| > | > "Michael Fesser" <netizen@gmx.de> wrote in message
| > | > news:cng0d3dhkhm507nvjtg590i1gs1bl605ta@4ax.com...
| > | > | .oO(Jerry Stuckle)
| > | > |
| > | > | >But if you change the function name, parameter list and/or return
| > value,
| > | > | >you have to change all of the code calling it. This is NOT
| > refactoring.
| > | > |
| > | > | http://en.wikipedia.org/wiki/Rename_Method
| > | > |
| > | > | http://www.refactoring.com/catalog/renameMethod.html
| > | >
| > | > apparently, i'm not up on my lingo.
| > | >
| > | > so what if i change an interface with optional parameters? i then
don't
| > need
| > | > to change *any* calling code, yet i've changed the interface. is
this
| > now
| > | > refactoring? further, most php is not written in OOP but with
| > proceedural
| > | > code. so, the 'interface' would be a browser, in most cases.
| > technically, i
| > | > could change any and all code yet not be mucking with the
'interface'.
| > and
| > | > so that we're all clear...an 'interface' *only* exists as a
| > communication
| > | > point between a caller and an *OBJECT*. functions alone and of
| > themselves
| > | > are NOT interfaces.
| > | >
| > |
| > | OK, I should have clarified - you can't change the interface except to
| > | *extend* it. Adding optional parameters would be extending the
interface.
| > |
| > | In this case, the "interface" wouldn't be the browser - the browser
has
| > | nothing to do with PHP. Rather, it would be the common function
calls.
| > | Interfaces existed long before OO programming! For instance, fopen()
| > | is an interface to the file system.
| >
| > well, the op was regarding best programming practices in gereral. either
| > way, the user interface is very much a part of any language whether it
is a
| > command-line or gui. in general, especially in case of the command-line,
it
| > is equally effected by such changes (think of argument changes or
command
| > name changes). i understand the difference between what we're talking
about
| > and this idea, but the two don't always have a black/white distinction.
the
| > main point i was trying to make is that functions are not interfaces,
and if
| > they are - such as fopen being an 'interface' to the file system - then
so
| > too are the methods a user interacts with in an application - their
(caller)
| > way into accessing a set of features ('interfaces'). such an equation
| > doesn't help in distinguishing development tasks.
| >
|
| Actually, functions have always been defined as interfaces. Even before
| OO programming came along, it was common to build a library of functions
| to perform a set of actions - similar to the file calls in PHP and C.
all fine lines i suppose. i'm thinking of dll's here. i've always thought of
libraries as precursors to oop encapsulation...hence, really object-like.
but i do see your point.
| And yes, the methods a user interacts with an application is an
| interface - widely known as the "user interface".
thus my allusion of 'gui'. ;^) but i digress...
| > | > as far as i'm concerned, when i 'refactor', i'm doing whatever needs
to
| > be
| > | > done to existing code to make it better for no other reason (new
| > | > enhancement, new logical/business requirement, etc.) than to make it
| > better
| > | > (easier to maintain, bring it under standards of practice, make it
| > faster,
| > | > etc.). imo, it's not worth splitting hairs over. i suppose it is a
good
| > | > thing that when my boss and i talk about 'refactoring' some code, we
| > | > understand each other...which is the whole point of a word.
| > | >
| > |
| > | Then how do you differ between "refactoring" and "rewriting"? There
is
| > | a difference!
| >
| > besides symantics, what is the superior definition and use of
'refactoring'.
| > anytime you 'refactor' code, you 'rewrite' it. i'm fine, as an employer,
| > when a developer says, 'i redid/willdo this to do/behave/help with
this...it
| > impacted (will impact) this/these things.' THAT is more meaningful than
| > EITHER term. moreover, i just don't thing 'redid' and 'willdo' would
have
| > sounded very 'extreme' and hence was not included in the book(s). ;^)
| >
|
| Yes and no. Refactoring typically is more limited - for instance,
| recoding a function, set of functions, class, etc., without having to
| change code which calls those functions or class members.
right. when i do use 'refactoring' in conversation, my boss knows i mean
that i'm not adding an enhancement and am usually just bringing shitty
coding practices into our standard...reformatting, consolidating code where
it is obvious some yahoo got the first bit working and then pasted it
elsewhere and maybe just changed on thing about it. hell, i did that this
week...some dumbass had 1,000 lines of billing validation for a 'current'
table, pasted that code right below and only changed the 'current' to
'history'. and the 1,000 lines where shit to begin with. i bettered the
query and got it to 200-ish. sorry, had to vent.
| > when discussing changes that need to be made in code with a client, i
don't
| > use either term. i talk about things he understands like speed,
flexibility,
| > longevity, scale, and costs (both long and short-term). when discussing
| > changes with my boss, i talk about strategy and architecture. and with
my
| > employees, i talk about what i need done specific to all of the
above...and
| > if in the course of their changes, they see a pattern, potential
problem, or
| > oportunity that should be addressed, we get down to *specifics*...not
lingo.
| >
|
| I do the same. I don't even talk about "rewriting" the code. I don't
| even talk about architecture, and the only strategy is that which has to
| be in place to get the job done. Rather, I talk about the benefits he
| will receive from whatever I'm going to do.
which is all they want to hear anyway. that, and that you'll have the new
features in place yesterday.
| > but that's just me. everything is a rewrite...or an origination. what
| > benefit is it to anyone to split hairs over a term that is itself,
already
| > controvertial and unclear?
| >
|
| It's fun? :-) But you're right, it's not really worth splitting hairs
over.
lol.
| > don't get me wrong, jerry. i think saunders kaufman has his head
squarely up
| > his ass, which explains why he's 'in the dark' on this topic. however,
i've
| > done all the 'extreme' stuff including paired programming, bidding,
etc.. as
| > i've said, it comes from common practices in other fields all the way
back
| > to the early 1900's. ain't nothn' 'extreme' about it as far as
programming
| > is concerned. as for the lingo associated with it, may it forever be
limited
| > to the context of the book that espoused it. for me, i use specifics
when i
| > need someone else to understand what i'm doing or what they need to do.
| > 'refactoring' is not specific enough.
| >
|
| I think Sanders is just being honest when he says he's in the dark about
| it. I think most programmers are.
well, it's painfully obvious he doesn't. however, those other 'most'
programmers don't put down anything they know they don't know
about...especially with the fervor that he does.
keep 'em truck'n.
Navigation:
[Reply to this message]
|