Hacker News new | past | comments | ask | show | jobs | submit login

"probably" is key Here. this introduces the possibility of typo erros that can even be discovered late. Now you will need a Vet check to make sure that GET, POST etc are written correctly instead of letting the compiler to do it's job. .Get(), Post() get compiler guarantees that they are sending the right Method string.



I agree on principle, but in practice routers rely on arbitrary strings anyway. I don't see why the verb is not just a part of the route.

In my head it's as if we did this:

    http.Segments("foo", "bar", http.Param("barID"), "baz")
instead of:

    /foo/bar/:barID/baz
Is it sliiiightly safer? Yes. Is it insane? Also yes.




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: