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

> You don't need a router when you have pattern matching (just split the url and match on static and dynamic vars however you need)

Web frameworks allow for much more: URL redirections, specific management of append-slash and case-sensitive URLs, complex regex matching, etc.

> Auth is typically DIY in any language, or SaaS like Firebase/Auth0. It's not a language or framework problem, necessarily

False. Django, Laravel, Rails and batteries-included languages have really good auth management. I personally consider it a gigantic mistake in 90% of orgs to outsource auth to external parties.

The ability for experienced web devs to just hit the ground running and have 10 basic CRUDs running in a single day because they don't have to deal with this needless complexity is simply amazing for small businesses.



> URL redirection

Erm, just return a new url after the match? Get fancy with state machine like enums? Rust has everything you need here, not getting why you think this requires a framework.

> Specific management of [...]

again, match for that, map your url parts, whatever - it doesn't need a 10,000 pound gorilla when it can be done in a line or two of code

> complex regex matching

erm, regex crate?

> Django, Laravel, Rails

Yup, those are valid choices. I said it's not a framework problem necessarily.

Not a one size fits all sorta problem.

Wordpress is also a fine choice if your business is knocking out new sites for a new client every month.

But, if you're building a single product over the course of a year or two, it's not the end of the world to spend a couple weeks rolling your own auth and hook it up to transactional emails and everything else. It's just one small problem to deal with, not major in the grand scheme of things. YMMV


> Rust has everything you need here, not getting why you think this requires a framework.

Because you're reinventing a wheel that doesn't need reinvention, and the most likely thing is that you will neither reinvent it nor pick the best library that an opinionated framework with hundreds of eyeballs has.

> again, match for that, map your url parts, whatever - it doesn't need a 10,000 pound gorilla when it can be done in a line or two of code

Sufficiently large and complex websites will have that need.

> But, if you're building a single product over the course of a year or two, it's not the end of the world to spend a couple weeks rolling your own auth and hook it up to transactional emails and everything else. It's just one small problem to deal with, not major in the grand scheme of things. YMMV

No individual problem is large, but it is objectively a dozen little problems, all with a nontrivial chance to blow up into larger problems.

Code reuse and frameworks exist because, unless you've been doing web development for a long time, you _will_ run into issues that have already been solved.


I don't think you get how powerful Rust's pattern matching is, or how to think of it in terms of a router.

From my example above, check out https://github.com/dakom/dominator-workers-fluent-auth/blob/... and follow it through to https://github.com/dakom/dominator-workers-fluent-auth/blob/...

Do you see that you have static and dynamic parts matching, multiple variable capture, etc.?

I'm not talking from a theoretical perspective. I'm showing you an actual example of a fully baked auth system that does everything on the wishlist (and more) and has no need at all for a router because Rust is itself powerful enough to do all that out of the box


> and the most likely thing is that you will neither reinvent it nor pick the best library that an opinionated framework with hundreds of eyeballs has.

Having used Spring has convinced me that framework popularity has no correlation with quality.


Spring is still better than 95% of those microframework users end up reinventing in the wild, and I hate Spring with a passion.




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

Search: