Stop giving code examples in TypeScript
steverydz.com
steverydz.com
I don't understand this argument. TypeScript is just JS + type annotations — you should be able to boil away any fluff and be left with functioning JS. Whereas jQuery has actual runtime logic that would need to be reworked if you wanted a $-free solution.
The author goes on to say:
> This was even worse when the question was along the lines of “How do you do (jQuery thing) in JavaScript?”.
When would anyone ask "How do you do (TypeScript thing) in JavaScript"?
In regards to the jQuery comparison, I'm not suggesting that someone would ask such a question of TS. All I'm saying is that there was an expectation that everything should be done in jQuery at the time.
> Bear in mind I'm talking about someone trying to learn something. If they don't know TS you're expectng them to boil code they don't understand down to its essence.
I agree with this, but only for people who are new to the JS language, and the content targeting them.
People using JS regularly should be able to separate out TS noise, and asking the world to avoid TS for _every_ piece of knowledge content sounds like hyperbole.
> In regards to the jQuery comparison, I'm not suggesting that someone would ask such a question of TS. All I'm saying is that there was an expectation that everything should be done in jQuery at the time.
Then why include it in your argument?
I have worked with junior developers who struggle with this. I am not suggesting that all knowledge has to avoid TS, only that which isn't related to it. People who are new to the language want and need to learn _actual_ JS.
It's easy to not see this as a problem when you already know TS. Yes, it is clear what TS is once you know it. Imagine not knowing TS or the concept you are trying to learn about. What part of this is TS? What part of it is the information I am trying to find?
> Then why include it in your argument?
I was simply illustrating that there can be a tendency to assume knowledge which isn't relevant to the problem being solved.
This pathological drive in the JS dev community to pretend the language they're working with doesn't exist is counterproductive - what happens when no one in the javascript development community actually knows javascript, and the standard tool for generating javascript moves on to something other than typescript?
Does TS have a steep learning curve, or just a steep config curve? I personally feel that once a project has TS up & running, the actual use of it can be straightforward. Inference is so good these days, you shouldn't see many actual types at all in your code.
Have I just been using it too long, and I've forgotten the initial pain?