jefflembeck’s avatarjefflembeck’s Twitter Archive—№ 28,080

              1. It's been 6 months that I've been writing PHP professionally and slowly refactoring a legacy codebase written through several versions has taught me a whole lot about how I think about websites and how that has changed over the years. Also, writing it like it's JSX really helps.
            1. …in reply to @jefflembeck
              Step 1 was adding phpunit. All new stuff gets unit tests. Step 2 was adding strict types to all new stuff. Step 3 was adding a templating system so markup and "controller" logic do not live together (on new pages) Step 4 was adding a middleware-like system
          1. …in reply to @jefflembeck
            I hate the whole "I created a variable in X file and now i've included this file so now the variable is available", but like, none of my tools can tell where this comes from _thing_. So, it's on to classes for utility methods/vars
        1. …in reply to @jefflembeck
          Which, then led me to using composer more and customizing it to have PSR-4 style autoloading, so I can use "use" more often.
      1. …in reply to @jefflembeck
        Where I _can_ manage a thing with a dependency, I do and I just figure out what Laravel uses. It seems like the sane approach and as much as I enjoy writing software, I have shit to do and the well-used and well-documented stuff is _fine_ at a minimum. I can do _fine_.
    1. …in reply to @jefflembeck
      I needed something to bring some consistency in. I find linter rules to be arbitrary and to change with time so I went with PSR-12 rules, figuring that's good enough. I don't need nor want stricter. I hope this codebase outlives my time working on it.
  1. …in reply to @jefflembeck
    I'm still wondering when I'm going to make the switch over to just using a damn framework. I don't know the line, yet. mod_php makes it too easy (and I mean TOO easy) to survive without one. Trying to weigh the cost/benefit there, still.
    1. …in reply to @jefflembeck
      It's little stuff. It's "best practices." But mostly it's "Try to fit these things into our estimates while signing on for new features." Bigger architecture ideas and the changes that follow will come over time. Hopefully after my coworker starts in a couple of weeks