cross-posted from: https://programming.dev/post/23442993

Sometimes I create a solution to a simple problem. However instead of making use of the solution, I keep extending it unnecessarily. This is why for this kind of project, I want to systematically restrain my future self from adding new features beyond the initial vision e.g. by actively refusing generic and re-usable code.

What is the search engine friendly term for this approach or at least for this situation? “Ad-hoc programming” may be literally what I’m talking about, but in practice it’s associated with unplanned happenings.

    • TheV2OP
      link
      fedilink
      arrow-up
      1
      ·
      19 hours ago

      Yup, but I struggle to find results about intentional usage of anti-patterns. I mean, it’s actually a good thing, but… :/

  • owenfromcanada@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    20 hours ago

    In my experience, the typical solution to this problem is the opposite of what you suggest–making your short-term projects of a sufficient quality to be extensible if needed. So I’d be surprised if you find much on this (intentionally, at least).

    That being said, if you’re set on locking down a project, I would run the source through some sort of obfuscator and delete the original. This could be converting it to an intermediate format, or just converting all the entity names to random strings.

    • TheV2OP
      link
      fedilink
      arrow-up
      0
      ·
      19 hours ago

      This is the kind of extreme solution I want to discover with a fitting search term. But personally, I still want to be able to fix bugs and update dependencies. I don’t want to lock down the project, but only the features.

      • owenfromcanada@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        17 hours ago

        Unfortunately, I don’t think anything like this really exists, because it violates good programming principles. Not to say you’re bad for considering it, but there probably aren’t a lot of people working toward the same end. You’ll probably have to resort to personal discipline and/or scathing code comments to remind yourself to refactor things before using them. I may or may not have left comments in my own code calling myself an idiot for not refactoring, or apologizing to my future self. Welcome to the club.

      • f43r05@lemmy.ca
        link
        fedilink
        English
        arrow-up
        2
        ·
        17 hours ago

        Then debug and patch it? Though that’s borderline masochistic at that point.