http://www.perlmonks.org?node_id=781744


in reply to Nothing is forever (repost from my blog)

To use the scaffolding metaphor more completely, I'll just make some notes about actual construction scaffolding that can be applied to the discussion. Scaffolding is usually something designed to be easily built up, torn down, reconfigured, and reused on future projects. Sometimes, though, a project is outside the norm by so much that custom scaffolding is required. The custom scaffolding is still cheaper and makes the job easier than working without it. If there's no need to reuse it then it's sometimes cheaper to make the scaffolding a one-off than to make it reusable and reconfigurable for the next job. The materials can at least be recycled.

In code, your reconfigurable, reusable scaffolding might include things like test suites, IPC code, and commonly used modules. Some custom libraries might be bolted on here and there, and then those can be binned once this project is through with them. Perhaps some parts of those custom bits can be salvaged, but there's no reason to engineer them for indefinite reuse like the rest of the scaffolding because chances are your next job or the next phase of your current job will require something completely different. For the parts that really make sense to make reusable and generic, go ahead and do that piecemeal as those bits get used. For the parts that don't, don't bother with the up-front investment for very little return. Just do what gets you to the next part of your current project, and save notes on any really innovative bits in case you do need to replicate them. Tear down the scaffolding when you're done and the project is self-contained, and keep around the truly globally applicable bits on your truck.

If it makes sense for your project to contain an exact copy of some of your scaffolding upon completion, leave it in there. If not, just use the scaffolding to support you while you build something more permanent. Sometimes you want to build something grand that stands the test of time, but sometimes you just need to assemble a place to stand while you build that.

I've written this whole thing thinking about using scaffolding in construction and remodeling. If it sounds like programming, that's just the strength of zby's choice of metaphor. :-)

  • Comment on Re: Nothing is forever (repost from my blog)

Replies are listed 'Best First'.
Re^2: Nothing is forever (repost from my blog)
by planetscape (Chancellor) on Jul 20, 2009 at 20:45 UTC
    For the parts that really make sense to make reusable and generic, go ahead and do that piecemeal as those bits get used. For the parts that don't, don't bother with the up-front investment for very little return. Just do what gets you to the next part of your current project, and save notes on any really innovative bits in case you do need to replicate them. Tear down the scaffolding when you're done and the project is self-contained, and keep around the truly globally applicable bits on your truck.

    [emphasis added]

    Excellent advice which I felt should be highlighted. I'm always (it seems) struggling with this part, not so much because I don't create the notes, but because I have trouble locating them later.

    HTH,

    planetscape
Re^2: Nothing is forever (repost from my blog)
by zby (Vicar) on Jul 20, 2009 at 20:16 UTC
    Thanks! To be precise the scaffolding metaphor not mine - it is taken from Rails - I only observed that it can be used more broadly than for code generators.

    I am now thinking about writing Catalyst packages (code name CatalystX::Elements - playing the chemistry metaphor) that would add simple features to Cat apps. This has been tried many times - but now I'll try to make them really simple implementing only that much as to satisfy the basic needs - and leave ways to replace them.

      Please remember to use the CatalystX namespace or pick another name entirely once you pick a real name the code will inhabit.

        Ah - sure - just fixed in my post above.