Thank you for the video. but here are my points: when django and laravel which are of the biggest api frameworks out there are using dynamic types, why do we even have to use types with js? besides, if anybody likes to use ts in client side, they can use angular instead of react. ts prevents rapid development specially for already-complex apps. think about a scenario when both sides of your ajax app are doing some complex stuff and suddenly you decide to make a quite huge changes to api which also demands changes to client side. You will have to double the time and energy to make those changes just because of unnecessary types which makes developer burn-out a real threat in an ongoing project. there are a lot of situations that not only ts does not help catch the bug but also makes it harder to do so for example by cluttering the codes and making them less readable. ts specially for monolith apps is totally an overhead.
@Svish_8 күн бұрын
I'm sorry, but your points are actually great examples of the opposite. TS helps _a lot_ with complex apps. If you have a client-side app, and make changes to the API demanding changes in the frontend, how will you know where to make those changes? How will you know _for sure_ that you have caught _all_ use-cases? It has to be a lot faster to simply change the type of your API response and run a type check to see every single place you need to update immediately, than having to go through your non-ts code manually and just guess and hope you have caught everything. We additionally use `zod` to runtime parse and validate that the API responses we get from the backend _actually_ are what we expect them to be. In these cases the types are inferred directly from the schema definitions as well, which is very helpful. There are certainly bugs that TS does not catch, but it does catch all the type of bugs that it can catch, and I experience that on a regular basis. I change some code, check that it runs fine, create a PR, and the build very helpfully fails because I missed an edge-case in a totally different component or piece of code. TS does not clutter code or make it less readable. If you feel like it does, it just means you need to read more TS code. It's the same with any programming language or syntax. I remember when for example C# added lambda expressions and LINQ, there were people who hated it because it looked messy or ugly. I feel the same about the syntax for lambdas and streams in Java. The truth is simply that I haven't been reading enough Java for my brain to get used to parsing it. If you work more with TS, I'm pretty certain that your brain will get used to it soon enough and parse it just as efficiently as you do JS now.
@gg.martins7 күн бұрын
In what world do you change API and consequently their types, and have no change to make in your JS client?
@md.redwanhossain62887 күн бұрын
dynamic types are the biggest mistakes in programming world. Both python and php are bringing types in their implementations. types are your friend, not enemy. If you think types making you slower, you are abusing the standards and your code can break anytime in runtime.