Today I Learned - Rocky Kev

Tagged “oop”

  1. TIL Why is TextEncoder a class

    My assumed answer - it was for extension. What does reddit commenters have to say about it?

  2. TIL Adapters, proxies, and decorators

    An adapter provides a different interface to the object it adapts. A Proxy provides the same interface as its subject. A Decorator adds one or more responsibilities to an object.

  3. TIL super()

    When you use super(), it's like you're telling the new object to copy everything from the old object first, and then add or change anything else that's different.

  4. TIL the difference between Factory Pattern and Builder Pattern

    The factory method pattern requires the entire object to be built in a single method call, with all the parameters passed in on a single line. It may evolve into a builder pattern. A builder pattern is a wrapper object around all the possible parameters you might want to pass.

  5. TIL Open-Closed Principle in OOP

    In object-oriented programming, the open–closed principle (OCP) states 'software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.'

  6. TIL about switching out of JS Classes and into JS Modules

    A classes are just blueprints for creating objects. A class encapsulates data and functions that manipulate data. A module is a file that exports features, such as variables, objects, and functions, that can be used elsewhere.

See all tags.