Comment

Comment by AdityaSanthosh

So cool. I love rust and my day job is in Python.

But I have a question. I'm a junior dev(gimme some leeway here).

I don't really understand how important these design patterns are because in the programs I write, I usually write the classes and call them in runtime myself. I think usually we write the servers and client ourselves.

Let's take the different client types example. You are making an assumption that users can call close on a closed client. Is it so hard to just follow the sequence

` client = Client()

client.connect()

client.authenticate()

client.send_message()

client.close() `

Aren't they overengineering? Perhaps I have not worked in a large code bases to understand the problems TypeState Pattern or more generally these design patterns solves.

I understand that these patterns are elegant and make the future modifications or enhancements easier but I have never seen the tangible value enough in real life

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton