Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I would put it as "when it isn't too tricky to do so write your program such that data flows one way".

When data flows downwards it's often simple to have the top layer own and then pass down references.

But if you start running into lots of issues doing that it's probably a fundamental issue with your architecture. So you need to either rethink it or give up and try a different kind of approach. Both are valid, but I think people who try to muddle through without either dramatic option are the ones who end up very frustrated with Rust.



I split my time between our hardware products (C and Rust) and our software product (JS everywhere, node in the back, React in the front).

Reading your comment I had two simultaneous thoughts....

1. <squinting appreciatively> Clever, cool way to think of it... ...and if you need information back at the top level, send it back via a Result....

2. <brows raised in horror, shuddering in React> State management hell!

:->




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: