in reply to Re^3: Refactoring technique?
in thread Refactoring technique?
how do you parameterize x, y and z anyway. You have a lot of something.x and somethingelse.y.
I'm still getting to that, but it seems that in JS, any place you can write o.x you can also write o['x'], so, I'm hoping that by extension, instead of:
function doStuff( x, y, z ) { ... oo.x.thing = p.y.max * qq.z.min; ... }
I can also write:
function doStuff( a, b, c ) { ... oo[a].thing = pp[b].max * qq[c].min; ... }
I'm still cleaning up and refactoring other parts, so I haven't tried that yet; but from what I read, and a couple of small tests, I think it will work.
If any JS guys are following along and can verify that (or not), I'd be grateful.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Refactoring technique?
by jeffa (Bishop) on Apr 24, 2015 at 22:04 UTC | |
by BrowserUk (Patriarch) on Apr 24, 2015 at 22:36 UTC | |
|
Re^5: Refactoring technique?
by hdb (Monsignor) on Apr 24, 2015 at 21:31 UTC | |
by BrowserUk (Patriarch) on Apr 25, 2015 at 00:59 UTC |