10
nitwhiz
8y

Used ES6 classes 'cus I really like doing things the classy way..

...nice shit you can do there...

...

FOR FUCKS SAKE WHO THOUGHT IT IS A WICKED IDEA TO SPECIFICALLY NOT IMPLEMENT PRIVATES IN THAT SHIT.

Comments
  • 2
    Because it's syntactic sugar. You couldn't do it the old way of doing classes, and you can't do it now
  • 0
    @iam13islucky dafuq. The old way doing classes just cries for using their scope for privates.

    But the old ways didn't have nice ways for extends and stuff.
  • 0
    @iam13islucky I guess you only know about the Shit.prototype.thing way, eh?

    You could actually just misuse a function as class, by setting props into its this and returning its this and get the instances via new Func().
  • 0
    horrible code, of course, but the Prototype thing wasn't any better. And now you got all sorts of vars dangeling around in yo instance. Not better at all.
  • 0
    @daintycode let is block scoped, so it'll act private. Dunno what else to tell you
  • 2
    Use Typescript. :)
  • 0
    @Chefren all these typescript, flow things actually seem more and more nice from day to day tbh.
Add Comment