3 ms·
I beg to differ. Refactoring is not merely rearranging code statements. Refactoring is restructuring of the code starting from the architectural and abstract g
by systemvoltage 6y ago
I beg to differ.
Refactoring is not merely rearranging code statements. Refactoring is restructuring of the code starting from the architectural and abstract goal and then looking at how pieces of existing code would fit. Sometimes, that requires writing new code and tests. Refactoring by definition also means not breaking the user space.
I've never heard of any serious writer printing out their prose and cutting it and rearranging it. That just sounds absurdly unnecessary to me.
- hinkley 6y ago> code starting from the architectural and abstract goal you are either using a different definition of architecture or this is wrong. Refactoring is bottom up construction. Most of the time when I see people frustrated or struggling (including myself) it's because they have forgotten this and need to take a break.
- systemvoltage 6y agoI am using the standard architecture difinition. More information here: https://en.wikipedia.org/wiki/Code_refactoring https://en.wikipedia.org/wiki/Code_refactoring There are many goals in refactoring, specifically this section: > Potential advantages of refactoring may include improved code readability and reduced complexity; these can improve the source code's maintainability and create a simpler, cleaner, or more expressive internal architecture or object model to improve extensibility. Another potential goal for refactoring is improved performance; software engineers face an ongoing challenge to write programs that perform faster or use less memory. I was addressing OP's analogy to cutting pieces of written prose and rearranging.
- hinkley 6y agoA bad paragraph does not get the point across because it is doing things in the wrong order, or taking to long to get there. Hoisting code can be removing repetition, performance... So many things. Rearranging or deleting code so that a piece is not trying to do three things at cross purposes, for one. Code is meant to be read by humans and only incidentally by computers. A lot of architecture is just being clear about what is intrinsic complexity and what is accidental, be it cognitive or computational.
- IggleSniggle 6y agoI’ve definitely heard of doing this when plotting something out, ie at compile time instead of runtime to stretch an analogy.
- systemvoltage 6y agoI think you can buy a box full of words: https://magneticpoetry.com/ https://magneticpoetry.com/
- johnfn 6y ago> I've never heard of any serious writer printing out their prose and cutting it and rearranging it. Writers definitely do this. Maybe not at the prose level, but for sure at the plot level and chapter level.
- thyrsus 6y agoI've found myself doing this in e-mail recently. I naturally try to set the stage/explain the situation, then ask for something (opinion/resources/prioritization/...). But I've been advised to lead with the request, and then explain. It often takes a minor rewrite to make it work, but I've become convinced it helps motivate the reader to read the explanation.