Trouble maker and Problem solver ⚙️🔧
Loves simplicity, hates bullshit 💩.
Productivity obsessed, avid learner 🖥🚀
Sport and outdoor freak 🧗⛰
Metalhead 🎸🤘 Father of 2 👨👩👦👦
Opinions are my own
We use typescript in some of our projects. so this opnionated statement comes from direct experience.
I am not denying that TS is useful, I am stating that it makes code too verbose - and long.
We as devs, have to find a balance between the clarity that comes from typization and the readability of the code itself. When i read code quickly to do a review, or to debug something, i want to be able to quickly read and grasp the underlying logic - TS is too me, too often, simply longer to read.
The thing is, if you do TS correctly, you don't type that much, you generally just type something when that something can't be inferred. For example this is perfectly valid TS:
constadd=(a=0,b=0)=>a+b;
You don't need to do this at all:
constadd=(a:number=0,b:number=0):number=>a+b;
All that is inferred ... so you only type when the compiler can't infer the type, which usually also means that you as a developer reading that might need that type to understand what the function is taking or what is returning. Is almost like just adding comments when the code is actually hard to follow.
Trouble maker and Problem solver ⚙️🔧
Loves simplicity, hates bullshit 💩.
Productivity obsessed, avid learner 🖥🚀
Sport and outdoor freak 🧗⛰
Metalhead 🎸🤘 Father of 2 👨👩👦👦
Opinions are my own
Agree. This is what I mean. We don't have to explicitly type everything. Most of the time devs do that though, making the code less readable. (of course that is a problem of how ts is used rather than of ts itself).
What I find annoying is just when you are passing around objects and starting out with my implementation and ts can't really infere much yet and start nagging about missing or invalid props. Then instead of going on with the implementation, you have to fix typing issues..
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This can only be said by someone who doesn't actually use TypeScript. Although I agree that code in TypeScript is often much harder to read.
We use typescript in some of our projects. so this opnionated statement comes from direct experience.
I am not denying that TS is useful, I am stating that it makes code too verbose - and long.
We as devs, have to find a balance between the clarity that comes from typization and the readability of the code itself. When i read code quickly to do a review, or to debug something, i want to be able to quickly read and grasp the underlying logic - TS is too me, too often, simply longer to read.
The thing is, if you do TS correctly, you don't type that much, you generally just type something when that something can't be inferred. For example this is perfectly valid TS:
You don't need to do this at all:
All that is inferred ... so you only type when the compiler can't infer the type, which usually also means that you as a developer reading that might need that type to understand what the function is taking or what is returning. Is almost like just adding comments when the code is actually hard to follow.
Agree. This is what I mean. We don't have to explicitly type everything. Most of the time devs do that though, making the code less readable. (of course that is a problem of how ts is used rather than of ts itself).
What I find annoying is just when you are passing around objects and starting out with my implementation and ts can't really infere much yet and start nagging about missing or invalid props. Then instead of going on with the implementation, you have to fix typing issues..