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
-
Not a react developer, but I also like having my types separate from my logic.
It feels cleaner to me. -
Real answer: it's a design pattern. Separation of concerns. Back in the days of classic PHP and ASP, logic inside/ alongside the UI code turned into the ugliest code of all time. It was degrading to maintain. Inhumane.
REAL answer: do you mix your steak and beer together when you have dinner? Sure, they end up in the same place eventually, but you wouldn't want to eat beer-soaked steak or drink steaky beer. -
BordedDev175021h@AlgoRythm Types are defined separate already, so the PHP/ASP analogy doesn't hold. So, like your steak and beer it's already separate but on the same table
P.S. I'm fairly sure there are beer-based BBQ/steak sauces -
12bitfloat1051516hPeople like to come up with stuff then claim it's best practices that will magically make everything better
There are so many patterns that allegedly make your code better and more testable and more future proof and they're honestly all bad in practice
Related Rants
Why do react developers like having a separate types folder/file? (genuine Q)
rant
react