3 ms·
Please enlighten me here, in the past we were obsessed with design patterns and tried to make code as modular as possible and we were proud if our code worked f
by tuyguntn 5y ago
Please enlighten me here, in the past we were obsessed with design patterns and tried to make code as modular as possible and we were proud if our code worked for 5-10 years.
nowadays, 2 biggest advise I get from articles and books are: (1) make code as readable as possible (2) write code so it is easy to remove the code and re-write. basically advising me to write such methods: StoreUserDataAndFetchDetailsFromOauthProvider, instead of some fancy flows
world is moving very fast and time spent on making code modular with design patterns seems not worth it (I am spending my last 6-8 years in startups).
most of my code is verbose and doesn't contain design patterns, am I that bad developer?
- amackera 5y agoI would think writing modular (decoupled) code would make it easier to remove and re-write, no? I don't see any conflict between those two bits of advice. Readability has a long tradition in programming too, including but not limited to literate programming (1984). IMO nothing wrong with verbosity as long as it serves a purpose (readability is a worthy purpose). I think the perceived trend "developers care more about readability now than they did x years ago" is likely due to the proliferation of click-bait blog posts on the subject. Lastly, if you're asking yourself the question "am I that bad developer", then IMO you by definition aren't that bad developer. Bad developers don't ask this question, or they don't care about the answers. You are self aware!
- tuyguntn 5y ago> would make it easier to remove and re-write, no maybe yes, maybe no. depends on how much engineering effort was spent. if upfront cost of perfect decoupling is high and later we need to delete it, why think about decoupling it at the first place? maybe write verbose, spaghetti code and when code contains all the business logic, then start refactoring slowly, when things became stable?