3 ms·
Unity is nothing like react.
by adamnemecek 6y ago
Unity is nothing like react.
- johnfn 6y agoAgain, I'm talking about the engineering culture fostered by the two projects. I'm not literally comparing a game engine to a web rendering library.
- deleted 6y ago[deleted]
- adamnemecek 6y agoRight however Unity is much more complex so it's not a fair comparison.
- johnfn 6y agoWhy 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/
- iaml 6y agoActually, AFAIK react event loop is based on game engines, so at least a bit of similarity should be there.
- adamnemecek 6y agoNot all event loops are the same.
- iaml 6y agoSpecifically, it looks like doom 3 engine https://www.youtube.com/watch?v=x7cQ3mrcKaY#t=1196 https://www.youtube.com/watch?v=x7cQ3mrcKaY#t=1196
- nottorp 6y agoYou mean react renders the UI at high FPS needlessly, regardless of any changes?