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

In general, this usually results in front-end logic being very tightly coupled with back-end logic. In some of the examples given, you even have database access in the same line that is generating the HTML document.

https://github.com/paveldedik/ludic/blob/main/examples/click...

It's the kind of thing that looks very cool and concise in small examples, but tends to become a nightmare when you are working on larger projects.



> In some of the examples given, you even have database access in the same line that is generating the HTML document.

Python template engines have the exact same problem, just way less obvious.

It doesn't have to be that way. Make all the queries up-front and pass the result the same way as you would pass context to templates. This way, all your components are pure. The difference is explicitness. Much easier to spot where side-effects happen than in templates.


I think the issue is orthogonal. I'm not a huge fan of react but it's an example of an architecture where the structure that is (imposed/encouraged) helps avoid the problem you're talking about.

I don't think the issue is "markup expressed in another language" - I think it's "poor application architecture". I don't dispute there might be a correlation between libraries and frameworks that do poorly on each - but that doesn't mean it's intrinsic.




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

Search: