By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,986 Members | 1,583 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,986 IT Pros & Developers. It's quick & easy.

Bicycle Repair Man usability

P: n/a
Are there any Bicycle Repair Man users here? I recently got PyDev for
Eclipse, which comes with BRM. I am disappointed with what I've seen,
although I'm not sure if I'm using its full functionality. According to
PyDev's documentation, this is what one can do:

-Rename a function/variable
-Block of code --> method and a method call
-Get rid of extra variables by shifting them inline (e.g.:
a=1;b=2;c=a+b --> c=1+2)

I'm not aware of anything else that can be done, as BRM's documentation
is extremely thin. Is anyone else aware of other uses?

It's a shame this project is not active; it seems like such a great
idea.

Rex

Aug 30 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Rex Eastbourne enlightened us with:
Are there any Bicycle Repair Man users here?
I am.
I recently got PyDev for Eclipse, which comes with BRM.
I use it from VIM.
I am disappointed with what I've seen, although I'm not sure if I'm
using its full functionality.
Why would it need more functionality?
-Rename a function/variable
-Block of code --> method and a method call
That seems nice to me.
-Get rid of extra variables by shifting them inline (e.g.:
a=1;b=2;c=a+b --> c=1+2)


This is already excess functionality IMO. If you're programming like
this and you want it to be replaced by 'c=1+2', you need to learn how
to properly write software. No tool will help you in that. But hey,
that's just my opinion. And I think it should be 'c=3' anyway ;-)

Sometimes I use constructs as 'a, b = 1, 2' and 'c = a+b', but that's
intensional. In such a case, 'a' and 'b' are settings that easily need
to be edited, and 'c' is just a calculation on them. In such a case, I
don't want to see 'c = 3' in my code.

I use BRM if I need to rename a function or variable, and that's about
it. I do the rest by hand faster than I can figure out how to use
additional software.

Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?
Frank Zappa
Aug 31 '05 #2

P: n/a

Sybren Stuvel wrote:
-Get rid of extra variables by shifting them inline (e.g.:
a=1;b=2;c=a+b --> c=1+2)


This is already excess functionality IMO.


I don't think that Rex talked about his programming style but about
three and only three refactoring methods survived in BRM from ~30
Fowler described in his book. By the way I can't remember the one you
picked up but I remember the reverse i.e. introducing intermediate
variable names for readability and debugging purposes.

Instead of writing f(g(h(...))) it is sometimes adaequate to write

x = h(...)
f(g(x))

I use this a lot in particular in C++. Optimzing compilers eliminate
runtime penalties. This is of course different in CPython.

In case of BRM I'm not sure why it is particular hard to implement
"Move Method" for instance? BRM is shipped with a lot of testcases
which is good but neither defines requirements nor leads a discussion
about refactoring methods in Python. Needless to say that the code is
not well documented.

Kay

Aug 31 '05 #3

P: n/a
Kay Schluehr wrote:
Instead of writing f(g(h(...))) it is sometimes adaequate to write

x = h(...)
f(g(x))

I use this a lot in particular in C++. Optimzing compilers eliminate
runtime penalties. This is of course different in CPython.


if "x" is a local variable, the penality isn't that huge:

$ timeit "id(len(str(0)))"
1000000 loops, best of 3: 0.911 usec per loop

$ timeit "x = str(0); id(len(x))"
1000000 loops, best of 3: 0.968 usec per loop

globals are slower:

$ timeit -s "global x" "x = str(0); id(len(x))"
1000000 loops, best of 3: 1.26 usec per loop

</F>

Aug 31 '05 #4

P: n/a
Sybren Stuvel schrieb:
I use BRM if I need to rename a function or variable, and that's about
it. I do the rest by hand faster than I can figure out how to use
additional software.


Sounds like "I can walk from Aachen to Cologne faster than figure
out how to drive a car" ;) I don't know BRM nor any other refactoring
tool but for a thorough decision one would have to know the ratio

time(learningTool)/time(doingByHand)

to calculate the break even point in terms of number(doingByHand).

--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
-------------------------------------------------------------------
Aug 31 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.