3 ms·
> "One class per file". Wait. What? Neither Java nor Rust limit class/struct per file. You must mean public class per file. As a fellow Java dev, no it doesn'
by Ygg2 2y ago
> "One class per file".
Wait. What? Neither Java nor Rust limit class/struct per file. You must mean public class per file.
As a fellow Java dev, no it doesn't look like Java at all. Maybe it looks a bit like Kotlin, but only superficially.
I wrote Rust on and off for 5 years, by that time you internalize the borrow checker.
- raxxorraxor 2y agoI did mean one public class per file. I didn't mean syntax or core lib to be similar, I just generally meant that both languages impose restrictions on themselves which might seem sensible at first.
- Ygg2 2y agoJava isn't that restrictive. Rust's type system is much more restrictive and customizable. That said, a good way to think about programs is a series of restrictions, i.e. invariants. Truth be told, only Ada Spark so far really embraced invariants.