stefanbund / cis155

3 stars 5 forks source link

Week 12/13 Discussion #18

Open kayvee opened 8 years ago

kayvee commented 8 years ago

I would like for you to reflect upon how constructing classes in the way you have been has aided your stock market. What facets of each class has led you to success ( or complication, if it's the case), when composing this large project?

Success: I believe, as mentioned before, that classes make the project much more approachable. You can compartmentalize the different 'parts' and aspects to a program and try to have them link together to solve problems and accomplish what the program needs to. Rather than trying to tackle an entire program at once in a functional way, sometimes it is good to know certain aspects already work and can be integrated in another fashion.

Complications: Something I am still having trouble understanding, not in concept but in practice, are instances. When I randomly create new stocks, how are they accessed? What holds the reference? How do I utilize all the moving parts when they exist and use them in a 'moving' program like a simulation.

stefanbund commented 8 years ago

Great question here on multiple instances of classes. I try hard to get students to experiment with the notion of building a multitude of classes, within a collection known as the array list. This means that within the array list, there are references to a multitude of objects. Hence when you iterate, or traverse that array list, you get a reference to each of those objects.

This is a very important professional programming skills, as each day you will find there are situations where an object, customized for your purposes, can add up to create interesting collections. Once you have a collection of interesting objects, you have the ability to work with each one, and its specific details.

You are absolutely correct in your first comment about having the ability to customize a class, specific to your purpose. Once you make several small classes, which mirror real world things, or mechanisms which you require, it is easy to code them. This is because each class is highly legible, and easy to remember how they work. Thus when you use custom objects you seem to be creating your own version of the Java language, specific to your programming objectives.

Thanks again for this great comment this week.

From Stefan

On Apr 24, 2016, at 6:29 PM, Kaveh Varjoy notifications@github.com wrote:

I would like for you to reflect upon how constructing classes in the way you have been has aided your stock market. What facets of each class has led you to success ( or complication, if it's the case), when composing this large project?

Success: I believe, as mentioned before, that classes make the project much more approachable. You can compartmentalize the different 'parts' and aspects to a program and try to have them link together to solve problems and accomplish what the program needs to. Rather than trying to tackle an entire program at once in a functional way, sometimes it is good to know certain aspects already work and can be integrated in another fashion.

Complications: Something I am still having trouble understanding, not in concept but in practice, are instances. When I randomly create new stocks, how are they accessed? What holds the reference? How do I utilize all the moving parts when they exist and use them in a 'moving' program like a simulation.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

forrestbennett commented 8 years ago

This first thing that comes to mind when thinking of how to answer this question is your analogy of programming being a recipe. The stock market app, though seemingly straightforward and undemanding, is relatively complex and multifaceted. Creating individual classes takes these intricate facets and allows you to construct and debug them into their own clean ingredient for the overall recipe.

forrestbennett commented 8 years ago

@kayvee compartmentalization is a great way to describe creating classes. I like that

stefanbund commented 8 years ago

The stock market problem is an MIT classic-you learn how digital stock markets work by trying to build one of your own.

Classes proved invaluable in this task. They must be designed to mirror and reflect the properties of real world entities. But in order to match the requirements of the simulation, we have to design classes thoughtfully.

The real value of the exercise is not following along, but seeing how Java classes can be made simply, and with great effect.

From Stefan

On May 2, 2016, at 9:33 PM, forrestbennett notifications@github.com wrote:

This first thing that comes to mind when thinking of how to answer this question is your analogy of programming being a recipe. The stock market app, though seemingly straightforward and undemanding, is relatively complex and multifaceted. Creating individual classes takes these intricate facets and allows you to construct and debug them into their own clean ingredient for the overall recipe.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

stefanbund commented 8 years ago

Nice to have you all participating and sounding off

From Stefan

On May 2, 2016, at 9:36 PM, forrestbennett notifications@github.com wrote:

@kayvee compartmentalization is a great way to describe creating classes. I like that

— You are receiving this because you commented. Reply to this email directly or view it on GitHub