Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am far more confused by hooks than by classes and 'this'.


Also you can't really try to protect JavaScript developers from understanding this. It's a fundamental part of the language.


Disagree. I understand `this`, but I very, very rarely encounter situations where it doesn't mean the same thing as Java's `this`. When you work on a full-React codebase, it just doesn't really happen. We used to have weird `this` behaviour on event handlers, but arrow functions and hooks fixed this.

Not saying it's good or bad, just an observation


Right, but without understanding this one doesn't really understand arrow functions either.


`this.foo = this.foo.bind(this)` and then the new feature of method properties `foo = () => this` vs `foo() { this }` are constant sources of confusion for people who aren't well-established in Javascript/this. Not to mention function() vs arrow functions.

All exist because of the idiosyncrasies of `this` that you may be discounting because of your familiarity and already being over the learning curve that ensnares people daily.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: