I write Dumb/Disposable code
Write Dumb/Disposable Code (WDC)

I write Dumb/Disposable code

"Every line of code is written without reason, maintained out of weakness, and deleted by chance." Jean-Paul Sartre's Programming in ANSI C.

I strive to write dumb code. Or, at least, easily disposable. Easily disposable code has no or minimal dependencies—coupling. The most destructive force in software is tightly coupled code. Most, if not all, so-called design principles exist to mitigate it. While many are proposed, perhaps one principle is adequate: Write Dumb/Disposable Code (WDC).

Code that is easily disposable is loosely coupled and more easily refactored—a necessary act of strength for code health, where deletions are by choice, not chance—when code is easy to reason about. Excellent, but software must do something to be interesting; it must alter some essential dependency.

Dependencies are intrinsic or extrinsic. But this distinction is irrelevant; what's key is whether they are proper. While tightly coupled code is bad, improper dependencies are pure evil; they lurk in code not directly related to altering software's essential dependency.

Improper dependencies arise when we fail to see that in software, things belong on one of two piles: 1) things responsible for behavior and 2) things responsible for structure—things that mutate state and things that don't. Mixing these two is almost always a bad idea and pure evil—a recipe for coupling.

While blasphemous to disciples of the DRY (Don't Repeat Yourself) principle (which includes me), it, more than any other principle, is guilty of introducing such recipes—it is okay to repeat yourself to avoid an improper dependency.

"Smart data structures and dumb code works a lot better than the other way around" Eric s. Raymond.

For more rants, check out my article, "Software is Evil."

Ivan Valiente

Staff Software Engineer at GRUBBRR

1 年

Good rant! :)

要查看或添加评论,请登录

Glenn Puchtel的更多文章

  • Cyborg - (bio)Cybernetics Group

    Cyborg - (bio)Cybernetics Group

    To all interested subscribers. If you'd like to engage in an interactive discussion (debate), please join my group:…

  • Periodic Table of Cybernetics

    Periodic Table of Cybernetics

    Good news, bad news. First the bad news.

    1 条评论
  • Software as a Game [SaaG]

    Software as a Game [SaaG]

    Software as a Game [SaaG] A game is a rule-based system with a quantifiable but variable outcome (value). Each outcome…

    1 条评论
  • I'm writing a book

    I'm writing a book

    The August edition of my newsletter on 'oscillation' is (sadly) postponed as I'm writing a book instead. The book…

    1 条评论
  • Bio-Cybernetic Patterns

    Bio-Cybernetic Patterns

    This month's (upcoming) article is on 'oscillation'; however, not till mid-August as I am still writing it. In the…

    4 条评论
  • Temporality

    Temporality

    Cause and effect. Two core pillars of cybernetics.

    1 条评论
  • Software is Evil

    Software is Evil

    Software is evil—it has two faces: composition and behavior. One reflects the author's view of how best to structure…

    1 条评论
  • Biological Models of Reactionary Networks

    Biological Models of Reactionary Networks

    Note: newsletters are progressive; each augments the previous. Reading them in chronological order is suggested for…

    1 条评论
  • Reaction Networks

    Reaction Networks

    Note: newsletters are progressive; each augment the previous. Reading them in chronological order is suggested for…

  • Patterns of Behavior

    Patterns of Behavior

    Note: newsletters are progressive; each augment the previous. Reading them in chronological order is suggested for…

社区洞察

其他会员也浏览了