4
Geoxion
4y

Me: Keep the abstractions in check. Go too far and you'll end up with something called 'thing' or 'object'!

C#: Hold my beer 🍺🍺🍺

Comments
  • 2
    I mean, it has its benefits to think of *anything* as an object, that has a ToString method
  • 0
    Suddenly JS has its benefits or what?
  • 0
    @petergriffin lol how often do you get the error Object[object] in JS. It’s a prototyped language, as abstracted as they come...in theory.
  • 0
    @jeeper more often than you want. Especially if you have to use shitty libraries or react+redux without typescript and proper abstraction.

    Also, you often use the raw prototype objects in TS when you use something like decorators.
  • 0
    reflection:
    class beerClass = getClass("beer")
    obj beerObject = newInstanceOf(beerClass, null)
    met holdMet = getPublicMethod(beerClass, "hold", null)
    result = invokeMethod(beerObj, holdMet, null)

    Yup. OOP is fun!
  • 0
    @magicMirror Why are you calling reflection methods with string literals?
    The only excuse for reflection is if you want to represent structure with OOP but apply it on runtime data, and even then you'd probably be better off generating marshal methods.
  • 0
    @homo-lorens
    bc that is the way to use reflection in Java an Go?
    Does it make sense? no. But who cares?
Add Comment