The VSCode codebase is evidence TypeScript is built to scale further then Javascript.
if (!!process.send
Is there something I'm missing here? Why not just: if (process.send`if (x)` evaluates truthiness of `x` which in Javascript land might behave differently. I don't know how off the top of my head, but I know it's something to be cautious of in this language and its derivatives.
In other words, these are 100% equivalent:
if( anything ) { ... }
if( !!( anything ) ) { ... }
The !! is redundant here, unless there's something relevant that isn't shown in the if statement excerpt in legohead's comment.If there was a linter rule I could turn on to require booleans in if-conditions, I'd enable it.
`!!` might seem silly, but it's a hint that you intended for coercion to happen. A similar but better example would be preferring `if (x > 0)` over `if (x)` even though non-zero is truthy.
There's an even better case for returning `!!x` from a function even though you could return `x` and let the call-site coerce it. The problem with that is that the call-site can build a dependency on the value of `x` beyond truthy vs falsey.
In a weakly typed language like Javascript, I don't think you'll ever regret being a little more explicit.
Is it not good enough for me? Is it failing me in some awful way that I feel compelled to change it? Maybe it should get out of the IDE business if its not good enough? Maybe become a farmer, take a break from technology
General tools like an editor, a decompiler, or even an image editor can be used to modify the software itself. After all, if you're the creator of the tool itself, most likely you feel comfortable using it.
What I always wonder is how people built the first tools. How did people compile the first version of GCC? How did people build the first programming language? How did people built the first OS? I can imagine ways to solve these, but I guess the tale behind how they did it is what makes me wonder.
Generally you start with "something smaller/easier" and build your way up.