Comment by sc68cal

2 days ago

It's interesting to see that they let you mix markup with logic directly in rust, but I have worries about maintainability. I remember the bad old days of PHP where you'd mix markup with logic directly, even when doing OOP with classes and it really made things more difficult long term.

It’s not a rust thing. Custom markup is usually implemented in rust frameworks using macros. If mixing macros and logic becomes a problem, we can change how the macros are implemented.

  • Yes, I saw that's it's via macros, but my point is that it reminded me of some web development practices from a much earlier era, and why we moved towards doing templates and separating app logic from presentation

    • The trend has been to move back to this style in general (see most modern JS frameworks). The main point is less about combining code and view, but breaking up the page into many small components and pushing data loading down into where it is needed vs up front.

      Doing that enables a bunch of performance tricks like starting to steam the page before data i loaded and concurrently render components.

      If you have to split your page into many small components, a separate view file for each becomes tedious.