hard or soft code and design? that is the question. and welp, there's a reason we call it "soft" ware
the soft in software means that the code and design must be malleable and durable
- malleable code is easy to change/refactor without having to jump many dependency/build/compilation hurdles
- durable code is easy to change/refactor without breaking other parts of the code
the design ninja masters and even doting design stans like myself talk about "good" solid design, and about supple and strategic design (#ddDesign). design that elicits high UX for other devs i.e. DX (@CarlosRucker); regardless of paradigm i #ooDesign #functionalProgramming, etc
good supple design/code is arrangement of software elements, in a way such that
- the code clearly expresses it's intent and corresponding user scenario in the stakeholders' language
- the code is SOFT, i.e. malleable, changeable, durable
the soft supple design/code we wanna produce is achieved through use of modeling patterns like:
- interface revealing interfaces
- side effect free functions
- assertions
- conceptual contours
- standalone classes
- closure of operations
and "beautiful looking code structure, objects/ APIs that are enjoyable to code with come also come out of
- solid, grasp, principles
- gang of four patterns
- kiss, damp, dry, yagni, tda, pola practices
hardness in design and code can manifest as rigidity and or fragility
- fragile code is easy to change/refactor but also easy to break
- rigid code is hard to change/refactor due to constraints with dependencies/build/compilation
being able to name these conditions of hard and software rigidity, fragility, arms you with justifiable motivations for
demanding the time and space needed to produce the code quality you want to; here you know how to concisely describe a situation you want to avoid
appendix: there are more terms that illustrate poor design like immobility, and viscosity
- immobile code, you avoid reusing as it carries too many dependencies or tech baggage
- viscous design is all over the place, without a clear theme or vision, not uniform, hacky
and there is brittleness vs durability which afaik are other qualities that go more into the functional aspect of the system;
but here im more interested in application design/architecture than the runtime aspects
my code used to stink at first. and stink bad. i have produced all manner of rigid, fragile, immobile, viscous, brittle, rotten code in my time.
then i learned about code smells, developed a sense for anti-patterns over time. learned about patterns. and the anti-patterns i was following. and after breaking things, making coding life hard for myself and other devs, now my code is still funky but in the better sense lol 😅
anyways that was another lil ramble for the time being; these are some patterns and principles i practice in my work daily; always a work in progress toward self/craft mastery
ref: the blue book #DDDesign
ref: cvc.uab.es/shared/teach/a…
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.
