<p>What is a good challenge to improve your skills in object oriented programming?</p>

<p>The idea behind this poll is to provide an idea of which exercises are useful for learning OOP.</p>

<p>The challenge should be as language agnostic as possible, requiring either little or no use of specific libraries, or only the most common of libraries. Try to include only one challenge per answer, so that a vote will correspond to the merits of that challenge alone. Would also be nice if a level of skill required was indicated, and also the rationale behind why it is a useful exercise.</p>

<p>Solutions to the challenges could then be posted as answers to a "How to..." question and linked to from here.</p>

<p>For example:</p>

<ul>
<li>Challenge - implement a last-in-first-out stack</li>
<li>Skill level - beginner</li>
<li>Rationale - gives experience of how to reference objects</li>
</ul>

[{'answer_id': 60120, 'author': 'Luke', 'author_id': 327, 'author_profile': 'https://Stackoverflow.com/users/327', 'pm_score': 1, 'selected': False, 'text': '<p>Certainly a good challenge, although less accessible than a "start from scratch" assignment, is to refactor some existing code that either doesn\'t use inheritance or doesn\'t use very much of it to make greater use of inheritance.  The process of refactoring will expose a lot of the benefits and gotchas of oop, as it certainly has for me on my most recent project.  It also pushed me to understand the concepts better than past projects have where I\'ve created my own object oriented designs.</p>\n'}, {'answer_id': 60131, 'author': 'busse', 'author_id': 5702, 'author_profile': 'https://Stackoverflow.com/users/5702', 'pm_score': 3, 'selected': False, 'text': '<p>Challenge: Write a wrapper for your web site/service API of choice in your language of choice, that doesn\'t already exist (ex. a <a href="http://www.zendesk.com/api" rel="noreferrer">ZenDesk API</a> wrapper written in C#).  Release the wrapper as open source for others to use.</p>\n\n<p>Skill Level: Beginner to Intermediate</p>\n\n<p>Rationale: To learn how to extrapolate a 3rd party web service API into a meaningful set of objects/classes, making the reuse of that API easier in your chosen language.</p>\n'}, {'answer_id': 63425, 'author': 'killdash10', 'author_id': 7621, 'author_profile': 'https://Stackoverflow.com/users/7621', 'pm_score': 2, 'selected': False, 'text': '<p>After you have learned the basics, study the "Gang of four" design patterns book.</p>\n\n<p><a href="https://rads.stackoverflow.com/amzn/click/com/0201633612" rel="nofollow noreferrer" rel="nofollow noreferrer">http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1221488916&amp;sr=8-1</a></p>\n\n<p>This is a classic, and a must read for any coder who wants to understand how to use OO to design elegant solutions to common coding problems.  </p>\n'}, {'answer_id': 77089, 'author': 'Bill K', 'author_id': 12943, 'author_profile': 'https://Stackoverflow.com/users/12943', 'pm_score': 0, 'selected': False, 'text': '<p>A given task has very little to do with being "OOP", it\'s more in how you grade it.</p>\n\n<p>I would look at the Refactoring book, chapter 3, and make sure none of the bad code smells exist in the solution.  Or, more importantly, go over ones that do apply.</p>\n\n<p>Most importantly, watch for the existence of setters and getters (indicating that you are operating on values from a class and not asking the class to operate on it\'s own values)--or using "extends" without applying the  Liskov Substitution Principle, stuff like that.</p>\n'}, {'answer_id': 83498, 'author': 'petr k.', 'author_id': 15497, 'author_profile': 'https://Stackoverflow.com/users/15497', 'pm_score': 2, 'selected': False, 'text': '<p>Take a procedural-style written piece of code and try to transform it into OOP based solution. During the process, consult a book on refactoring and design patterns. A friend of mine was able to make a huge step forward in understanding object oriented concepts exactly this way. As with anything, this might not work for everyone.</p>\n'}, {'answer_id': 83739, 'author': 'swamy', 'author_id': 16042, 'author_profile': 'https://Stackoverflow.com/users/16042', 'pm_score': 2, 'selected': False, 'text': '<p>I have found <a href="http://c2.com/doc/oopsla89/paper.html" rel="nofollow noreferrer">CRC cards</a> to be quite effective in learning, teaching and building good OO design.</p>\n'}, {'answer_id': 86817, 'author': 'Paweł Hajdan', 'author_id': 9403, 'author_profile': 'https://Stackoverflow.com/users/9403', 'pm_score': 4, 'selected': False, 'text': "<p>Write a challenging program <strong>from scratch</strong>. Try to get some people (around five, that should be doable) to use it. Respond to their change requests.</p>\n\n<p>Adapt your program's design. Start small, then watch it grow. Manage this growth. <strong>This is hard.</strong> You will also have to fix bugs and maintain the thing over time, which for me was a very valuable lesson.</p>\n"}, {'answer_id': 857012, 'author': 'Craig Angus', 'author_id': 15352, 'author_profile': 'https://Stackoverflow.com/users/15352', 'pm_score': 7, 'selected': True, 'text': '<p><a href="https://www.itmaybeahack.com/homepage/books" rel="nofollow noreferrer">Building Skills in Object-Oriented Design</a> is a free book that might be of use.</p>\n<p>The description is as follows:</p>\n<p>&quot;The intent of this book is to help the beginning designer by giving them a sequence of interesting and moderately complex exercises in OO design. This book can also help managers develop a level of comfort with the process of OO software development. The applications we will build are a step above trivial, and will require some careful thought and design. Further, because the applications are largely recreational in nature, they are interesting and engaging. This book allows the reader to explore the processes and artifacts of OO design before project deadlines make good design seem impossible.&quot;</p>\n'}]
['https://Stackoverflow.com/questions/60109', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4120/']