Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
In weakly typed languages like JS I switch to TypeScript instead. And if that's not possible then, well, hope the change isn't too comprehensive and then run a lot of tests hoping you don't get "can't access xyz of undefined" or something like that.
Maybe I'm overlooking something but I don't get it either. Good typing is just such a big help. -
nebula18703ydoes not always work for retarded reflection or when you work with string literals instead of property names eg.
refactoring is great but there are traps - even in strongly typed languages -
That’s not even really refactoring as I see it, more like restructuring. Refactoring is a process encompassing a series of structured well defined small steps where the code is at no point in time at a broken state. If you get errors at any point, you are doing it wrong.
If you do refactoring right, it should be really manageable and non-threatening regardless of language. -
@craig939393 not really, because the kind of changes that I am talking about would also require changes in the test code to adopt to the new requirements.
And, without a strict type system, you would need to make these changes very cautiously.
Tdd is not a solution here. It is a further victim of weak typing. -
Crost41083y@Lensflare 1101100 or w/e comment about true refactoring relies on tests is what I meant
And strong types don't replace tests btw
Related Rants
What I absolutely love to do is refactoring. With strongly typed languages, I often just remove or change something and then follow the compiler errors to finish the refactoring by fixing them.
It‘s not just a matter of renaming something. I will reliably get all the places in code which are affected by the change.
How do you handle that with weakly typed languages like JS? I can only imagine how horrible of an experience refactoring would be.
question
refactoring