2021-04-09 09:21:22

I've learned a lot from my adventures in dart land. I want to apply the concepts I've learned to python projects. The main thing I've learned is that separating the UI and business logic code is often a good idea because you are able to change the business logic without having to rewrite the entire project. Is there a python way of managing state and separating UI from business logic such as redux for react?

2021-04-09 16:48:12

To the best of my knowledge, not really.  Let me know if you find something.  The Python UI stuff is at a lower level.  You can do it, but you have to manage individual controls and things like that, rather than relying on  a React-style diffing algorithm, so the answer there is "use normal programming techniques".

Which isn't as bad as it sounds, because a lot of the indirection in the React solutions that you like exists because the React-style rendering algorithms require very specific things to work with respect to what goes into properties, and all of that makes it more complicated than "write a MyBusinessLogic class with methods" because you have to e.g. clone all your data.  WHich isn't to say that manually adding buttons with wx is super fun, just that if you do, you don't need anything particularly special for state.

My Blog
Twitter: @ajhicks1992

2021-04-10 12:46:28 (edited by chrisnorman7 2021-04-10 12:48:30)

@1
Sorry, not going to be really helpful here, but I'm working on some Dart stuff I'd like someone else to hack on. If you're interested, could you drop me an email.

No worries if not, and I hope you get your Python stuff sorted.

-----
I have code on GitHub

2021-04-10 13:21:23

I would be interested. Just sent you an email