Hacker News new | ask | show | jobs
by blueblahvlah 1262 days ago
W.r.to boilerplate - I have no reference point/comparision to other frameworks.

When the project grows with more contexts, components and forms, one will end up with a bunch files which differ only in Module.func_names.

Phoenix < 1.7, View files which are required for controllers are boilerplate which contain 3-4 lines. In the end there will be a folder with view files which don't will have similar content unless any view specific functions are added.

1 comments

It seems like essential complexity to me. I think maybe there's some ceremony around explicitly casting, validating, etc. with Ecto, but it would be hard to hide that without 'magical' assumptions and making it more inflexible. But I agree View files always felt a little redundant for many use cases where the template doesn't really need to make any function calls – and from memory, function calls in LiveView templates is not performant and causes the whole DOM to be regenerated when values change.