DEV Community

Discussion on: 7 Tips For Clean Code

Collapse
 
srikanth597 profile image
srikanth597

Ok, I may not be good JS dev as you,
Let me brief an example for you.

Accessing a prop on a nested object let's say obj.data.hasMyRecognitions which could always be array or object or array of objects I don't know them if I go with your Proper JS Road, I would most likely endup being atleast one error which any JS developer experience. i.e Can't read property of undefined.
We don't always want go and check that fix all over again.
In the end we all want time we want to spend on writing and debugging should be kept at minimum and send faster results.
I think TS is great, it definitely does improve DX.