Message from JavaScript discussions
August 2017
— It's not holywar it's just the right way to define variables
My boss just did this:
mounted: function () {
this.background = this.$el.querySelector('.stories-background')
this.stories = this.$el.parentElement.querySelector('.stories')
in a vue component. You can reference $el inside a component, that does not mean it's good. It leads to unwanted behaviors (as it is and that it's why I am refactoring this)
— Oh christ
— YEP
— Infact, when you change route everything explodes
— Two weeks and he produced a 1k lines class with weveryfuckingthing in a single component, no split, no functions
— Wat
— Fucking shite
— Because he can't read a doc it seems
— He also delegated everything in a canvas component to requestanimationframe instead of using computed and use requestanimationframe just for rendering
— And now -> "please refactor it, it's slow"
— I am about to smash my keyboard