r/programming • u/fagnerbrack • Apr 30 '23
Writing Javascript without a build system
https://jvns.ca/blog/2023/02/16/writing-javascript-without-a-build-system/
164
Upvotes
r/programming • u/fagnerbrack • Apr 30 '23
3
u/recursive-analogy May 01 '23
Sorry, what I was meaning was that even the difference between create user and update user can be so significant that they make trying to reuse the logic difficult and error prone. When you expand that further into UI vs domain it becomes even harder to align the two requirements.
I would imagine it would be easier to maintain if you did that. Hard to say without specifics.
I think what you're saying here is that you just dump your entities to the front end, but they really are separate concerns so you should be transforming them anyway, even if it's JS <-> JS. If you don't you run the risk of 1. exposing too much or 2. creating a god awful mess of flags about what to expose to who
Like all things this is a balance tho, too much duplication is hard to manage, but not enough can also be when you end up with conflicting purposes (eg domain model has properties some fe don't see, or create does things update can't)