Hacker News new | ask | show | jobs
by ivan_gammel 2047 days ago
This is solved by resolution mechanism in template parsers, for which you don’t need properties.
1 comments

The template parsers are typically one way and not native to a language.

A language that supports properties can make this trivial for both the inward and outward binding.

Otherwise you end up with janky stuff like JavaBeans or whatever.

Can you elaborate more on this? Are you familiar with implementation of engines like Thymeleaf or Jackson, for example?

JavaBeans are not the only possible way to go with providing values for templates and definitely one of the worst.

I've implemented two way binding in templates, in a proprietary templating/UI language on the JVM. Thymeleaf, iirc, is one way binding. Don't know anything about Jackson, so I can't really say.

When properties are implemented in the language proper then wiring everything together is much cleaner: find references, etc, all "just work". If not, there is a distinction between the template language and the host language that has to be addressed with tooling, or (usually) ignored.