The language syntax and semantics are no longer the only part of its interface to the user (=programmer). It is also the IDE with all its syntax highlighting, contextual jumps and lookups, and often inline type annotations. So how understandable a piece of code is depends to a big degree on this kind of tooling. What your ‘this’ or ‘that’ refers to is much easier if you just have to hover over it and the IDE will show you.
Be careful with this, though. Javascript is a strange and complex language, and it’s not very amenable to static analysis.
Most of the time it’s “easy” to determine what this refers to, but sometimes it’s literally impossible, because it’s ambiguous. For example, it might be determined at runtime, and vary from one invocation of a function to another. A good IDE will hopefully say “I don’t know what this is”, when it doesn’t know. But on that boundary between known and unknowable, the IDE is liable to get confused (and who can blame it?), and this is exactly the sort of place in your code that bugs tend to crop up.
All that is to say, take what your IDE tells you with a grain of salt.
The language syntax and semantics are no longer the only part of its interface to the user (=programmer). It is also the IDE with all its syntax highlighting, contextual jumps and lookups, and often inline type annotations. So how understandable a piece of code is depends to a big degree on this kind of tooling. What your ‘this’ or ‘that’ refers to is much easier if you just have to hover over it and the IDE will show you.
Be careful with this, though. Javascript is a strange and complex language, and it’s not very amenable to static analysis.
Most of the time it’s “easy” to determine what
this
refers to, but sometimes it’s literally impossible, because it’s ambiguous. For example, it might be determined at runtime, and vary from one invocation of a function to another. A good IDE will hopefully say “I don’t know whatthis
is”, when it doesn’t know. But on that boundary between known and unknowable, the IDE is liable to get confused (and who can blame it?), and this is exactly the sort of place in your code that bugs tend to crop up.All that is to say, take what your IDE tells you with a grain of salt.