Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored the HTML-conversion process
as we enter into algorithm, demands upon concentration increase. find your quiet place, your flow state, your algorithm rhythm. commit goal: begin the real HTML-conversion algorithm. immediate obstacles: the existing `ToHtml()` function already feels overly complicated and deeply-branching. also, if we were to write a new `ToBetterHtml()` function, there would be a lot of duplicated code. duplicated code should be healed, collapsed, into a new function, reusable anywhere. (otherwise: code copies drift out of sync due to human error, leading to a broad class of bugs where human _expectation_ of functional-equivalence collides with a different _reality_. to avoid refactoring is to encourage _more_ such duplication and inconsistency. travel that path long enough, and your problems shall become great enough to earn a name: _technical debt_.) refactoring is holy: seek it always. a refactor _appreciates_ code already set in place, understands exactly what that code achieves, its purpose... then shatters it without mercy, reassembling it into something better. [slow zoom out of fractal into itself again]. demand the right to change. to grow. to break. to prune away, then reach ever further. YOU. now to the problem at hand: refactoring our whitespace-related logic into a new, focused, testable, reusable function. to perform its work, this function must know which character to consider, and (for tabs) the number of characters present in the current line of converted text. it produces an dual output, for clarity and convenience of use; consider `if ( TryFind(x, out y) ) { use y; }` vs. all the nullness in `var y = FindOrNull(x); if ( y != null ) { use y.Value; }`. the function's name, inputs, and outputs are its exterior signature. code written elsewhere can call upon this signature, sending along inputs to receive outputs in return. within this new exterior, however, the HTML-conversion logic (the `switch` conditions and their resulting outcomes) remains the same. with refactor complete, the old `ToHtml()` sheds its shadow, keeping only its unique rainbow-coloring capabilities. the new `ToHtml()` isn't _nearly_ as interesting yet, but is now poised to begin growth. the conversion algorithm shall take root here. _By and Down the River_ has been my song today, and found its way into the work. the song seems broadly aimed at empty, insincere leadership. but it also admonishes internally: give Light unto your work, share of it and benefit, lest it bloat, betray, and decay you. another scale smaller, and it places you as judge of your own plans, paths, and aspirations; which are worthy? which shall rot your soul? and here is that holy recursion, that nested depth-wise repetition, we see it everywhere; it resonates throughout. it feels of universe, and the point was: i feel it also in this music, these words. it feels like Truth. as does [the strain of context]. if everything breaks down _two_, then the challenge is to defy the sharpest oppositional gravities. defy... as in [defy, resist, counter], and _not_ [avoid, provoke, attack]. _not_ [mislead, brainwash, con, confuse]. _not_ [tribes and factions]. _not_ [win or lose]. what feels like Truth is a tapestry of bindings, all-woven from factual, fictional, emotional findings. different perspectives, interconnected, search-and-traversable, social-and-sharable, deeply private-protected. to spike into extreme is to deny our collective-connected binding, to boldly test [the strain of context]. this invites judgement, but not aggression: not all extremes are necessarily bad. Trust in the natural strain, and delight in the refactoring. then Trust the strain will smooth our way through change forevermore.
- Loading branch information