• balsoft@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    1 hour ago

    Abstraction, when used well, is actually a tool that produces more simple code in the long run. It separates different concerns into different pieces of code, makes code readable by extracting common logic and giving it a recognizable name, and reduces boilerplate.

    That said, OOP-style inheritance-based abstractions, while useful in some cases, quite often lead people down the complete opposite path - mushing together unrelated logic and then making call sites difficult to understand with a lot of hidden state that has to be kept in mind.

  • CrypticCoffee@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    6 hours ago

    I’d have thought this a mid-level thing. Most seniors know the cost of complexity and KISS (Keep It simple Stupid).

    • Ephera@lemmy.ml
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 hours ago

      In my experience, this happens in two ways. Yeah, sometimes a senior just overdoes it due to a lack of experience or shitty requirements or whatever.

      But it also happens a lot that juniors just don’t understand why the layer makes sense to introduce. For example, juniors will readily intermix IO and logic, because they don’t yet understand that this makes code untestable and adds a load of additional complexity into already complex logic code. From that viewpoint, pulling all the IO code out will look like unnecessary complexity, when it’s not.

  • idriss@lemmy.ml
    link
    fedilink
    arrow-up
    14
    ·
    15 hours ago

    Only some in my experience, in one place a simple API has 7 layers of handlers and managers. I took care of another project that should be in theory way more complex and got on board in a few days as compared to years.

  • JayleneSlide@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    16 hours ago

    Holy hell, I feel this viscerally. I recently inherited an enterprise codebase with a new job and that pic is exactly how I imagine the consulting company reacted after hand-off. The code is actually quite clean and mostly makes sense, but it’s completely undocumented (including a lack of specs and XML comments for endpoints). By and large, it’s mostly SOLID, but there are abstractions on abstractions, handlers for handlers for handlers. Configuring to run locally or against the dev environment is a huge rigamarole that I’m trying to simplify before trying to bring on any more SWEs. The bright spot here is that I’ve been given a long runway to come up to speed.

  • JoeMontayna@lemmy.ml
    link
    fedilink
    arrow-up
    3
    arrow-down
    2
    ·
    16 hours ago

    ha I’ll do that on a very large app because it pays dividends, but small apps I go in the complete opposite direction.