3 ms·
I find a lot of value in using a different programming language for backend and frontend code. The context switch between the languages brings with it an awaren
by mariusandra 10y ago
I find a lot of value in using a different programming language for backend and frontend code. The context switch between the languages brings with it an awareness of the security implications of everything you write.
Plus you are a first class citizen in each world.
Thus:
* Ruby code = private methods that nobody else can see
* Javascript code = public methods that everybody can peek into
Once you solve the "how do I pass data from ruby to javascript and vice-versa" question, this mental model holds up quite well.
(My own solution to this question is this project: https://github.com/mariusandra/kea-on-rails https://github.com/mariusandra/kea-on-rails , featuring server rendered react views (via react-on-rails) and seamless passing of data back and forth... but it might not be the best approach for your projects)