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

As a fun exercise, I suggest trying to build a mapper that gets a URL with the `type1/id1/type2/id2/type3` pattern and spits out a set of objects of type3 that have a parent of type2 and id2, under a type1 with id1. Now do that with arbitrary types and depth.

With a good ORM, this is so trivial to write that, most of the time, you don’t even need to: you can rely on decorations or any similar mechanism. I have codebases that have barely any code devoted to implementing that, and that will happily build the query on the fly for any type in the model it’s allowed to use.

Some problems fit ORMs really well. Some don’t, of course, and it’s fine - knowing when to use a tool and when not to is key with any tool.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: