HN Reader
New
Top
Best
Ask
Show
Job
Stop Writing `__init__` Methods
15
3
1 day ago
by todsacerdoti
Abandoning traditional constructors and all their strange special-cased rules in favor of regular old class methods that return Self was one of Rust’s best design decisions, I think. Super easy to reason about. Glad to see similar techniques being advocated for other languages.
1 day ago
by dmart
Using @classmethod to create functions that return class instances honestly feels too much like Java and the class factory method pattern.
I don't agree with the blanket policy of banning __init__ methods
1 day ago
by sc68cal