Learn this great software design pattern (but don't use it in production)

Learn this great software design pattern (but don't use it in production)

LividJay

Member
Local time
16:40
Joined
Feb 16, 2020
Messages
61

It's something I see very often in my research. I will read through many books, online articles, and code repositories as I strive to learn about a software design pattern, (e.g., Domain Driven Design, Microservices, CQRS). I'm always met with the same dilemma: "This code has been simplified for demonstration purposes. You shouldn't use this in your production environment."

sigh

I'm not the type that learns from just reading a book. I need to be able to see code. I need to be able to step through code to understand what it's doing. I most certainly want to see what people consider production-worthy code when they write up these things. Instead, I spend even more time researching. I recently read through a long book on CQRS (Command Query Responsibility Segregation) and often times, people like to tie that in with Event Sourcing. I was not surprised that the code I was reading throughout the book isn't something that I should use in production. Particularly, the code for Event Sourcing. It's easy to understand why. Event Sourcing uses a series of events to bring the current state of an object. You want this to be accurate and efficient.

Anyway, do the rest of you come up on this problem often? What do you do to overcome it?

 
Last edited:

Adam

Mr. Webwide
Administrator
Local time
21:40
Joined
Sep 24, 2019
Messages
1,243
Pronouns
he/him

There should be a website that tags GitHub projects by code style/topic that can be used as learning materials!

 

Sharkie

🦈
Gold Member
Local time
17:40
Joined
Feb 14, 2020
Messages
133
Pronouns
She/Her

There should be a website that tags GitHub projects by code style/topic that can be used as learning materials!

Would be one hell of a project to maintain, but would be an absolutely amazing resource!

 

Pandemix

MD developer
Gold Member
Local time
15:40
Joined
Feb 13, 2020
Messages
28

I'm always met with the same dilemma: "This code has been simplified for demonstration purposes. You shouldn't use this in your production environment.".........I most certainly want to see what people consider production-worthy code when they write up these things.

Hi, would you like some overly simplified code examples with your unclear documentation? — The Current State of Web Documentation

In all seriousness, finding the balance between creating documentation beginners can understand and experts can refer to is no easy task. The best documentation combines dummy proof explanations with functional and maybe even slightly more advanced code examples—not also dummy code. More advanced code can be easier to decipher than nonexistant code, at least.

Anyway, do the rest of you come up on this problem often? What do you do to overcome it?

All you can do is break it down one concept at a time, analyze that piece against your theory, and hope something clicks. Otherwise I hedge my bet that somebody at Stack Overflow has already done the deep dive. 😅

 

LividJay

Member
Local time
16:40
Joined
Feb 16, 2020
Messages
61

More advanced code can be easier to decipher than nonexistant code, at least.
I think we can attribute the lack of advanced code to laziness. We all know developers are lazy :D
All you can do is break it down one concept at a time, analyze that piece against your theory, and hope something clicks. Otherwise I hedge my bet that somebody at Stack Overflow has already done the deep dive.
The problem with Stack Overflow is that a lot of these topics involve in-depth discussion and abstract topics, which doesn't fit their "Q/A" style. Unless they have some hidden forum somewhere...

 
Top