home.social

#encapsulation — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #encapsulation, aggregated by home.social.

fetched live
  1. After thought (thought I didn’t plan to put into it), I don’t think "NULL coalescing" and "NULL chaining" needs to be built in to the #ProgrammingLanguage, and here’s why:

    * If you’re getting just one thing, the getter can take an optional default result value. #Python works like this in `getattr`, `.get`, and things of that nature. Having an operator for this is fine, but it seems obvious you don’t **need** the language to do it for you.
    * If you’re walking down a long uncertain chain, I have two arguments:
    * Knowing the path that leads down into the object to the specific thing you want kinda sounds like an #Encapsulation violation. Why do you know so much about the internals of this object. If this deep property is important, maybe it’s part of the interface of the top-level thing. Maybe this is just bad design.
    * Diving deeply involves lots of possibilities: possible defaults, actual methods of finding the named thing (allow inheritance? Is it an attribute? Is it an element of an array? Etc), did you want to just stop or raise an exception?Does saying what you want really come out to a simple, clean, understandable, one-line, expression?

    Maybe I’m biased because I don’t have these operators in my day-to-day language; and also can’t remember hitting this situation. And I can certainly see such operators could be helpful. I’m not a language designer. But from my actual experience, in this case, the juice just isn’t worth the squeeze.

    #NullCoalescing #NullChaining #LanguageDesign

  2. 📜 Behold, a relic from the distant past—2013! Back when "Page Object" was the new black in the world of #testing, because clearly, nobody knew that UIs change. 🤯 Marvel at the revolutionary idea of not frying your tests with a side of HTML spaghetti, as if #encapsulation wasn't already a thing. 🍝
    martinfowler.com/bliki/PageObj #HackerNews #PageObject #HTMLSpaghetti #UITrends #HackerNews #ngated

  3. Dive into the world of #encapsulation in #C++! Discover how to protect your data, create flexible code, and master #OOP. Learn to use access specifiers, private members, and public methods for better software design. #Cpp

    teguhteja.id/encapsulation-in-

  4. Discover the power of encapsulation in C++! Learn how to protect your data, improve code flexibility, and master object-oriented programming. Dive into practical examples and boost your C++ skills. #CPlusPlus #OOP #Encapsulation

    teguhteja.id/encapsulation-in-

  5. #decoupling #encapsulation
    #thatmomentwhen you realize your OOP structure was worth it when you have to replace one class with another*, and when you swap in the new code for the old code... EVERYTHING STILL WORKS.

    * I mean 3. THREE classes.

    #codejoy

  6. Are You tired of Your IT departments blocking essential services(your self-hosted wireguard) on eduroam WiFi? Try encapsulating it with http/websockets !

    sdr.li/post/chisel0/
    sdr.li/post/chisel2/

    #eduroam #firewall #chisel #sysop #admin #encapsulation #wireguard #bofh

  7. People newer to Python often get confused by the statement:

    if __name__ == "__main__":

    That's many underscores ("dunders"), right?

    In essence it lets you put code in your module that ONLY should execute when the module is called directly. So not when you import from it.

    I explain this further with a practical example in this 3 minute video:
    youtube.com/watch?v=ubpFY7_dAW4

  8. It's good to see my favourite WPF feature isn't dead:

    class StamperBase {
      constructor(o) { return o; }
    }
    
    class MyAttachedProperty extends StamperBase {
      #name;
      static getName(o) { return o.#name; }
      static setName(o, v) { return o.#name = v; }
    }
    
    const hostInit = Host.prototype.initialize;
    Host.prototype.initialize = function() {
      new MyAttachedProperty(this);
      return hostInit.apply(this, arguments);
    };
    
    export const attachedNames = {
      get: MyAttachedProperty.get,
      set: MyAttachedProperty.set,
    };

    #JavaScript #encapsulation #pluginDev #shitpost #mildlyCursedCode

  9. Always fun when I get to break out this graphic 😆

    #php #encapsulation

  10. I once was hired as consultant to guide a team who wanted move their monolith to #microservices. We got only halfway. And it was good!

    The route to microservices goes via #DomainModeling, #decoupling, and #encapsulation. Bounded contexts, decoupling and modules was enough to put the team back on track and moving again. We never built a single microservice.

    This week, Ted Neward wrote about this idea in a post that I now no longer have to write:

    blogs.newardassociates.com/blo

    #SoftwareArchitecture

  11. @leonid
    Oh, that's interesting. Please send your former boss my regards!
    I also think that Beta transformation at VW as a whole is not about to happen next year. ;-)
    But here is the good news (so to speak) - and it is manifold:
    - The company is suffering, and has been suffering for years. It needs substantial change
    - Any group like VW consists of many many entities that could do #BetaTransformation, regardless of what the holding does. For this, #encapsulation, is necessary. But it is feasible