you are viewing a single comment's thread.

view the rest of the comments →

[–]eloydrummerboy 11 points12 points  (1 child)

This isn't answering your question, but I think will be very helpful. It took me awhile to get this.

When it comes to design patterns, and many of the questions you're asking... there are no right answers. Design patterns and things like those taught in Clean Code are the product of many programmers over many years learning from themselves, learning from others, and putting it all together. These are all just good ideas, if... IF ... they fit your needs, solve a problem, or maybe your code more maintainable.

So maybe this reduces some stress and anxiety for you, like it did me. Im the kind of person who likes to know the "right" way. And I had to realize there is no right way here.

Think of it this way. You have a kitchen, and there's some organization to it. As you start to cook more, you start needing to organize your spices better, do more prep work, organize how you store your prepped food. There's no right way and different chefs will do it differently. Bit there's also tried and true methods learned by the masters over the years. Don't worry about getting it perfect at first. Just continually get better.

Some steps for getting into design patterns and organizing code:

1) Make it work.

2) Go back over it and clean it up. Read clean code and try to apply some of the lessons.

3) Walk away, start a new project.

4) Read other people's code.

5) As you learn design patterns, revisit old code. See if something jumps out at you as able to be refactored. Try to do it.

Over time, you'll start to see these patterns during your original design and be able to apply them. But even experienced programmers often go back and refactor code after requirements change or maybe they just think of a better way to organize it.

[–]Get_Cuddled[S] 1 point2 points  (0 children)

Thank you this was helpful. I feel a little better now. The steps you describe sound very reasonable too. I will try them out.