Hacker News new | ask | show | jobs
by theshrike79 297 days ago
Because I need to have a controller that does CRUD operations.

It has a specific amount of code I need to write just to add the basic boilerplate of receiving the data and returning a result from the endpoint before I can get to the meat of it.

IIRC there are no languages where I can just open an empty file and write "put: <business logic>" and it magically knows how to handle everything correctly.

2 comments

That's why we have snippets and code generators for those. And even in the absence of that, I usually copy code from some other place and gut it out to make place for the new logic. This can be done in 30 seconds or less if the code is organized.

> IIRC there are no languages where I can just open an empty file and write "put: <business logic>" and it magically knows how to handle everything correctly.

Are you sure it's done correctly? Take something like timestamps, or validations: It's easy to get those wrongs.

Does the "<business logic>" part involve a bunch of irreducible boilerplate too or something? What's it like?

If it doesn't, then I feel like even in the JavaScript world of 2015 you could write "app.put("/mypath", business_logic)" and that would do the trick, and that was a very immature language ecosystem.