3 ms·
> Rust is not a language for lazy developers. I am one, and Rust absolutely can be. > Lazy developers won't fight with the borrow checker. You don't fight th
by echelon 2y ago
> Rust is not a language for lazy developers.
I am one, and Rust absolutely can be.
> Lazy developers won't fight with the borrow checker.
You don't fight the borrow checker when writing web code. The request flow is well suited for rarely, if ever, testing the borrow checker.
> Instead, think more critically about why a Rust developer would need a web framework
The same reason anyone would need a web framework. Anything ranging from bullshit hack to high SLA service.
I'm finding Rust to be a drop-in Go and Python replacement for HTTP. It's really good at this use case, and it's certainly something you can be very lazy about with modern Rust web frameworks.
- maximilianburke 2y agoAs someone who has written a fair bit of web service code in Rust over the last 5 years or so, this is all correct.
- Thaxll 2y agoIt's absolutely not true, the moment you're out of http hello word, and you have more serious logic about data that you need to manipulate / modify you will fight the borrow checker, that's why a lot of people do a lot of rc / arc refcell. And then the async implementation.
- drogus 2y agoHave you ever written a web app in Rust? Most of the code is in a form of handlers that receive data, process the data and give some data back. There is rarely need to think about lifetimes or borrowing in these scenarios.
- steveklabnik 2y agoI’m writing a web app at work and I have one Arc and no Rc or RefCell.
- jfuawdfas 2y agoGot zero because I cheated with Box::leak
- steveklabnik 2y agoHaha!
- osigurdson 2y agoI would have thought async would be the biggest problem.
- echelon 2y agoIf you're in a web framework, all the handlers are async already. You have literally no work to do.
- echelon 2y agoShow me what you find to be hard, because I don't believe you. None of what you've described is hard. It's quite approachable, and an IDE with an LLM practically autocompletes everything for you anyway. If you can write Java or Go, you can absolutely write Rust.