3 ms·
Why not? It's easy to learn from the things that React does right and compare to see if Unity also does them right, or not. For example, React has a principle
by johnfn 6y ago
Why not? It's easy to learn from the things that React does right and compare to see if Unity also does them right, or not.
For example, React has a principle that components can freely be removed from the render path of their parents[1], since React (in the general case) does not allow parents to imperatively call methods on their children. Unity has no such prevention, so if you remove a child component you could be triggering a bunch of bugs when GetComponent<> calls fail to find the component you deleted.
It seems clear to me that the way that React guides the user towards avoiding writing bugs is a good strategy.
Why would we NOT compare these two? Why would we NOT say, "aha, it looks like React has a smart design that allows engineers to write code without unintentionally creating bugs, and so we should consider if something like that is possible, or perhaps think of a different way to solve this problem." Putting our heads in the sand and refusing to make comparisons between these two projects to see the similar issues that both projects run into means that Unity developers are doomed to repeat the same problems that React engineers have already solved.
[1]: https://overreacted.io/what-are-the-react-team-principles/ https://overreacted.io/what-are-the-react-team-principles/