Programmer Humor
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
It's a good way to get started, and then incrementally type as much as you can, preferably everything.
Later on, or if you start a new project with TypeScript, it's a good idea to turn on noImplicitAny
and only allow explicit any
in very specific framework level code, unit tests or if you interface with an untyped framework.
The hassle really pays off later.
this is terrible advise - you should be using unknown
. using any
you're basically disabling TS and will be under the false assumption that your code is ok while it's most likely missing a lot of runtime checks
an any
But it’s “a colon any” 🧐
I knew my any key would be useful one day.
Why not use assembly ?
Typing < type hinting
Nah this isn't the way, friend. Instead of adding a bunch of useless anys all over the place, start typing in one part of the application and exclude the rest using a path pattern. Or simply allow .js and only change the extension for files you've typed. Doing this is just wasting time and creating false assurances of type safety.
It's not that hard to define correct, meaningful types. Often vscode already has implicitly determined them for you; just mouseover the variable.
I wish I did that, at this point my TypeScript template errors are as long as C++'s ._.