Sign in to follow this  

Design Patterns : How much time should I Invest in them?

This topic is 4308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a rough idea of what design patterns are but never really had to deal with them or tried to use them. I was wondering to what extent are they useful and used in today's software industry? I know I'll take a quick look on the subject in the upcoming weeks and was wondering how much efforts I should pu on it?

Share this post


Link to post
Share on other sites
Learning design patterns is a useful endevor that will never cease throughout your career as a software engineer. I would suggest putting in the effort now to begin to understand what DPs are and how they are used in modern software, as it will help you to see the patterns that are emerging from your own software (we hope).

Learning design patterns is really a many part process. Patterns aren't a fixed thing. You will find some in your software that others haven't discovered, and you will find ones that are quite common. Much like birds, there are the rare ones, and there are the common ones. Of course, not all code can be broken down into patterns (that are usefull). Learning the common ones is typically a good idea, as long as you keep into perspective that there is a time and place for each of them. Patterns aren't always applicable to a problem, however it is common for those who are new to patterns to attempt to apply them to...everything. Don't. On the other hand, a great many of the problems you will encounter in SE can be solved through the application of an appropriate set of patterns. Learning the less common patterns is really not worth it in the end. You'll find that if you apply decent development processes, like testing and refactoring, that your code will evolve torwards various patterns irregardless of if you designed it with that in mind or not.

The idea that patterns will emerge from your code through refactoring isn't a new one (and I've covered it in my journal as have many programmers far far better than me), but it certainly is an interesting facet of SE. The question of course becomes: Are these patterns that emerge the best solutions to the problem at hand. A naive answer would be yes. In reality the answer is: Sometimes. The real question isn't the one that was asked, but more one of: were our tests and refactorings accurate enough to reflect the environment in which we expect our code to be used. A comprehensive set of acceptance tests will tend to restrict the interface to one that is the most useful, assuming your acceptance tests are sufficiently well fleshed out and designed with the feature in mind (customer feedback is important here). Assuming that, then most probably the patterns that have emerged from your code would be optimal choices (although possibly not the optimal, choice if there is such a thing).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you continually ask yourself: "How can I make this better than the obscure code it is now?", you will often find youself studying design patterns at that time. I tend to not study patterns until that time comes up. It saved me a lot of time doing it that way, but some people's minds don't work that way.

If you always study what you are interested in at the time, you can't go wrong (or at least terribly wrong).

(How do you like that for overusing 'time' in a response? Here: Time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time time ... wouldn't want to underdo it!)

Share this post


Link to post
Share on other sites
As a hobbyist, I've found them to be invaluable. They provide at least some small insight to more formal theory, and document some of the experience gained by discussion with classmates/coworkers; both of which are largely unavailable to me.

Share this post


Link to post
Share on other sites
Agreed. Design patterns can be useful in so many ways. You will find yourself using them all over the place once you become familiar with them. They are in existance for good reason, and to not use them is simply bad practice (unless, of course it would be bad practice to use them in a given scenario).

Share this post


Link to post
Share on other sites
Design patterns are much more important once you get to the point where programming syntax is not an issue and you move up from "writing c++" to "programming". That is, knowing the language and knowing how to program are two different things :-) They are also usefull in working with larger programs with many "moving parts". If you are just trying to bang out a utility script, they won't be of much use.

If you get a chance to read the book Design Patterns, i strongly urge you to do so. Then read it again, and then again a third time. Buy it, don't just get it from the library or something. As you program more, you'll find that some of these things come up naturally as you work on your own projects. Some of them you may already be using without necessarily knowing it. Regardless, it's always helpfull to know how other people solve problems that come up all the time.

Share this post


Link to post
Share on other sites

This topic is 4308 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this