Answers.Body: <p>I read through most voted questions tagged <strong>object oriented</strong> on <em>softwareengineering.stackexchange.com</em> and <em>stackoverflow.com</em>. I feel some questions on  softwareengineering site are quite common when learning OOP while questions on stackoverflow are more related to practical programming questions that are more likely asked by professionals.</p>
  <p>So I listed some questions from softwareengineering site,</p>
  <ol>
  <li><a href="https://softwareengineering.stackexchange.com/questions/154228/why-is-it-good-to-split-a-program-into-multiple-classes">Why is it good to split a program into multiple classes?</a>. This question was indeed asked by a high school student.</li>
  <li><a href="https://softwareengineering.stackexchange.com/questions/288990/do-objects-in-oop-have-to-represent-an-entity">Do objects in OOP have to represent an entity?</a>. My students do ask me this question.</li>
  <li><a href="https://softwareengineering.stackexchange.com/questions/120019/whats-the-benefit-of-object-oriented-programming-over-procedural-programming">What's the benefit of object-oriented programming over procedural programming?</a> this one is somewhat related to the &quot;manage software complexity&quot; question in my question and I do discuss with my colleagues another interesting question that was asked on quora <a href="https://www.quora.com/How-does-Linux-maintain-such-a-large-code-base-when-C-isnt-an-object-oriented-language-Is-the-code-base-all-messed-up" rel="nofollow noreferrer">How does Linux maintain such a large code base when C isn't an object oriented language? Is the code base all messed up?</a></li>
  <li><a href="https://softwareengineering.stackexchange.com/questions/7618/does-oop-fulfill-the-promise-of-code-reuse-what-alternatives-are-there-to-achie">Does OOP fulfill the promise of code reuse? What alternatives are there to achieve code reuse?</a> I am not sure if students will ask this question and I have my own double to the question too.</li>
  <li><a href="https://softwareengineering.stackexchange.com/questions/257885/when-writing-object-oriented-code-should-i-always-be-following-a-design-pattern">When writing object-oriented code, should I always be following a design pattern?</a>. This site also has a question about design pattern, <a href="https://cseducators.stackexchange.com/questions/5417/how-bad-is-a-computer-science-course-that-doesnt-teach-design-patterns/5418#5418">How bad is a Computer Science course that doesn&#39;t teach Design Patterns?</a></li>
  <li><a href="https://softwareengineering.stackexchange.com/questions/157526/explanation-on-how-tell-dont-ask-is-considered-good-oo">Explanation on how “Tell, Don't Ask” is considered good OO</a>. Only after they gain some coding experiences can they ask/appreciate the question. But it is a good one.</li>
  <li><a href="https://softwareengineering.stackexchange.com/questions/297090/should-i-create-a-class-if-my-function-is-complex-and-has-a-lot-of-variables">Should I create a class if my function is complex and has a lot of variables?</a> One answer there was also my recommendation to my students when they have such question, &quot;Use a class, but also provide a free standing function, that only constructs the object, calls the method and returns the result, the class that you use internally really becomes just an implementation detail of your public function&quot;</li>
  </ol>
  <p>Quora also has some interesting questions I feel people will ask when they first learn OOP, I list some here:</p>
  <ol>
  <li><a href="https://www.quora.com/Can-anyone-in-a-programmers-position-survive-in-the-modern-tech-industry-software-or-no-software-without-OOP-What-else-is-required-for-the-future" rel="nofollow noreferrer">Can anyone (in a programmer's position) survive in the modern tech industry (software or no software) without OOP?</a></li>
  <li><a href="https://www.quora.com/How-often-do-software-developers-use-OOP" rel="nofollow noreferrer">How often do software developers use OOP?</a>. One answer there by Kurt Guntheroth is interesting &quot;Any time you write a program longer than about 1,000 lines, you should use OOP. 1000 lines? Why’s that ...?&quot;</li>
  <li><a href="https://www.quora.com/When-is-object-oriented-programming-not-a-good-fit" rel="nofollow noreferrer">When is object-oriented programming not a good fit?</a></li>
  </ol>
  <p>Hopefully I can get some other answers.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-20T04:01:37.157Z
Answers.LastActivityDate: 2021-01-21T09:12:23.170Z
Answers.LastEditDate: 2021-01-21T09:12:23.170Z
Answers.UserDisplayName: Qiulang 邱朗
Answers.Body: <p>This is a really nice question! Your answer covers a lot of ground too.</p>
  <p>I’d like to offer a reflection on what might motivate these questions.</p>
  <p>In my experience, learners who encounter OOP early in their journey have to wrestle with a few different challenges, including:</p>
  <ol>
  <li>They’ve not yet experienced the problem/s that OOP solves.</li>
  <li>They believe that there is a perfect solution to all programming challenges waiting to be discovered.</li>
  </ol>
  <p>These give rise to a whole load of questions, confusions and, in some cases, insecurities.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-12T17:55:42.500Z
Answers.Text: Your point #2 is pretty universal: rationality asserts the ability to solve problems. It is the Juggernaut that is the only tool which eventually will solve every problem. And, to a kid with a Juggernaut, everything is something to drive over. If we could teach people only one thing, it should be that thoughts can be wrong, too. Skepticism of mental processes would reduce suffering dramatically, including for students. (I think the Buddha said that. Or maybe it was Socrates. Abraham? Confucius...)
Answers.UserDisplayName: Scott Rowe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-18T00:08:24.943Z
Answers.Text: In my experience in teaching grade 11 and 12, early'ish OOP is better than late.  If students don't learn OOP in grade 11, it feel like breaking (bad?) habits in grade 12.  I also feel the same about functions.  I have grade 9s build games is Scratch that are quite modular with custom blocks.  I think making decomposition and modularity core components early on helps all learners.  Without it, I find the weaker students struggle with advanced algorithms, and the strong students try to brute force the solution successful, but their code is a mess.
Answers.UserDisplayName: TooManyCooks
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-23T07:30:30.263Z
Answers.Text: Another reason maybe because GUI is everywhere (especially for kids never touch linux world) , students may tend to feel OOP is THE solution for every programming problem.
Answers.UserDisplayName: Qiulang 邱朗
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-06T10:23:44.110Z
Answers.LastActivityDate: 2021-02-06T10:23:44.110Z
Answers.UserDisplayName: Eddie
Body: <p>Reading this question <a href="https://softwareengineering.stackexchange.com/questions/344522/do-we-really-need-oo-languages-to-manage-software-complexity">Do we really need OO languages to manage software complexity?</a> on one of SE sites and my own experiences in teaching object-oriented concept, e.g. <a href="https://cseducators.stackexchange.com/questions/6709/some-real-practical-example-to-teach-object-oriented-concepts-and-programming-i">Some real practical example to teach object-oriented concepts and programming (in python)</a> has kept me wondering <strong>what are common questions students may ask when they first learn OOP</strong> ?</p>
  <p>For example in that question the author asked,</p>
  <blockquote>
  <p>I am a beginning CS student ... In the first semester we were introduced to OOP concepts like encapsulation,  data hiding, modularity ...</p>
  <p>But I think all the principles used to manage complexity like
  modularity, encapsulation, data hiding and so on can be very easily
  implemented by procedural languages. So why really OOP if we can
  manage complexity without it?</p>
  </blockquote>
  <p>I also have to admit that I have own struggle, e.g I asked this question <a href="https://softwareengineering.stackexchange.com/questions/419122/does-oop-overemphasize-the-importance-of-noun-and-thus-put-action-verb-in-the-le">Does OOP overemphasize the importance of noun and thus put action/verb in the less importance position ？</a> on that site too (no student has asked me this question though). My question was closed and even got 2 delete votes but that is alway my concern.</p>
  <p>If my students or my colleagues who have experience with javascript and like to learn OOP, I will always let them compare <a href="https://momentjs.com/" rel="nofollow noreferrer">momentjs</a> with <a href="https://date-fns.org/" rel="nofollow noreferrer">date-fns</a>, both deal with date and provide the similar functions, both do a good job, but momentjs an OOP library and date-fns is a function library.</p>
  <p>My purpose is let them understand there are more than one ways to do things.</p>
  <p>So what are common questions your students ask ?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-19T10:46:35.620Z
Comments.Text: This depends on when OO concepts are introduced. It is quite different if you teach objects _early_ than if you teach them _late_.
Comments.UserDisplayName: Buffy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-20T04:02:19.717Z
Comments.Text: @Buffy I provide an answer in order to get more (I hope)
Comments.UserDisplayName: Qiulang 邱朗
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-20T10:29:50.520Z
Comments.Text: As a side note. I have noticed a difference between teaching a feature (iteration, encapsulation, etc) and teaching a problem and a solution. I have not as yet decided on the best strategy. But think that a solution (language feature) without a problem is hard to learn. This will also make it hard to learn constrained iteration (`foreach item in list: process(item)`), after unconstrained iteration (`for i is 0 while i< length(list): process( item i of list); add one to i` ), as constrained will seem like it is not needed (as it is not needed, but it does make the code simpler).
Comments.UserDisplayName: ctrl-alt-delor
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-20T10:33:04.533Z
Comments.Text: Totally agree, that was the reason I asked 2 other questions here https://cseducators.stackexchange.com/questions/6699/practical-application-of-loop-e-g-check-prime-number and https://cseducators.stackexchange.com/questions/6709/some-real-practical-example-to-teach-object-oriented-concepts-and-programming-i both emphasize the word "practical"!
Comments.UserDisplayName: Qiulang 邱朗
Tags: <lesson-ideas><object-oriented-paradigm>
Title: Common questions students may ask when they learn OOP?
ThreadText: # Common questions students may ask when they learn OOP?
  
  (Asked by: username_0 on 2021-01-19)
  
  Reading this question [Do we really need OO languages to manage software complexity?](https://softwareengineering.stackexchange.com/questions/344522/do-we-really-need-oo-languages-to-manage-software-complexity) on one of SE sites and my own experiences in teaching object-oriented concept, e.g. [Some real practical example to teach object-oriented concepts and programming (in python)](https://cseducators.stackexchange.com/questions/6709/some-real-practical-example-to-teach-object-oriented-concepts-and-programming-i) has kept me wondering **what are common questions students may ask when they first learn OOP** ?
  
  For example in that question the author asked,
  
  > I am a beginning CS student ... In the first semester we were introduced to OOP concepts like encapsulation, data hiding, modularity ...
  >
  > But I think all the principles used to manage complexity like
  > modularity, encapsulation, data hiding and so on can be very easily
  > implemented by procedural languages. So why really OOP if we can
  > manage complexity without it?
  
  I also have to admit that I have own struggle, e.g I asked this question [Does OOP overemphasize the importance of noun and thus put action/verb in the less importance position ？](https://softwareengineering.stackexchange.com/questions/419122/does-oop-overemphasize-the-importance-of-noun-and-thus-put-action-verb-in-the-le) on that site too (no student has asked me this question though). My question was closed and even got 2 delete votes but that is alway my concern.
  
  If my students or my colleagues who have experience with javascript and like to learn OOP, I will always let them compare [momentjs](https://momentjs.com/) with [date-fns](https://date-fns.org/), both deal with date and provide the similar functions, both do a good job, but momentjs an OOP library and date-fns is a function library.
  
  My purpose is let them understand there are more than one ways to do things.
  
  So what are common questions your students ask ?
  
  **Tags:** lesson-ideas, object-oriented-paradigm
  
  > **Comments:**
  > **username_1**: This depends on when OO concepts are introduced. It is quite different if you teach objects _early_ than if you teach them _late_.  
  > **username_0**: @username_1 I provide an answer in order to get more (I hope)  
  > **username_2**: As a side note. I have noticed a difference between teaching a feature (iteration, encapsulation, etc) and teaching a problem and a solution. I have not as yet decided on the best strategy. But think that a solution (language feature) without a problem is hard to learn. This will also make it hard to learn constrained iteration (`foreach item in list: process(item)`), after unconstrained iteration (`for i is 0 while i< length(list): process( item i of list); add one to i` ), as constrained will seem like it is not needed (as it is not needed, but it does make the code simpler).  
  > **username_0**: Totally agree, that was the reason I asked 2 other questions here https://cseducators.stackexchange.com/questions/6699/practical-application-of-loop-e-g-check-prime-number and https://cseducators.stackexchange.com/questions/6709/some-real-practical-example-to-teach-object-oriented-concepts-and-programming-i both emphasize the word "practical"!  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2021-01-20. Score: 4
  
  I read through most voted questions tagged **object oriented** on *softwareengineering.stackexchange.com* and *stackoverflow.com*. I feel some questions on softwareengineering site are quite common when learning OOP while questions on stackoverflow are more related to practical programming questions that are more likely asked by professionals.
  
  So I listed some questions from softwareengineering site,
  
  1. [Why is it good to split a program into multiple classes?](https://softwareengineering.stackexchange.com/questions/154228/why-is-it-good-to-split-a-program-into-multiple-classes). This question was indeed asked by a high school student.
  2. [Do objects in OOP have to represent an entity?](https://softwareengineering.stackexchange.com/questions/288990/do-objects-in-oop-have-to-represent-an-entity). My students do ask me this question.
  3. [What's the benefit of object-oriented programming over procedural programming?](https://softwareengineering.stackexchange.com/questions/120019/whats-the-benefit-of-object-oriented-programming-over-procedural-programming) this one is somewhat related to the "manage software complexity" question in my question and I do discuss with my colleagues another interesting question that was asked on quora [How does Linux maintain such a large code base when C isn't an object oriented language? Is the code base all messed up?](https://www.quora.com/How-does-Linux-maintain-such-a-large-code-base-when-C-isnt-an-object-oriented-language-Is-the-code-base-all-messed-up)
  4. [Does OOP fulfill the promise of code reuse? What alternatives are there to achieve code reuse?](https://softwareengineering.stackexchange.com/questions/7618/does-oop-fulfill-the-promise-of-code-reuse-what-alternatives-are-there-to-achie) I am not sure if students will ask this question and I have my own double to the question too.
  5. [When writing object-oriented code, should I always be following a design pattern?](https://softwareengineering.stackexchange.com/questions/257885/when-writing-object-oriented-code-should-i-always-be-following-a-design-pattern). This site also has a question about design pattern, [How bad is a Computer Science course that doesn't teach Design Patterns?](https://cseducators.stackexchange.com/questions/5417/how-bad-is-a-computer-science-course-that-doesnt-teach-design-patterns/5418#5418)
  6. [Explanation on how “Tell, Don't Ask” is considered good OO](https://softwareengineering.stackexchange.com/questions/157526/explanation-on-how-tell-dont-ask-is-considered-good-oo). Only after they gain some coding experiences can they ask/appreciate the question. But it is a good one.
  7. [Should I create a class if my function is complex and has a lot of variables?](https://softwareengineering.stackexchange.com/questions/297090/should-i-create-a-class-if-my-function-is-complex-and-has-a-lot-of-variables) One answer there was also my recommendation to my students when they have such question, "Use a class, but also provide a free standing function, that only constructs the object, calls the method and returns the result, the class that you use internally really becomes just an implementation detail of your public function"
  
  Quora also has some interesting questions I feel people will ask when they first learn OOP, I list some here:
  
  1. [Can anyone (in a programmer's position) survive in the modern tech industry (software or no software) without OOP?](https://www.quora.com/Can-anyone-in-a-programmers-position-survive-in-the-modern-tech-industry-software-or-no-software-without-OOP-What-else-is-required-for-the-future)
  2. [How often do software developers use OOP?](https://www.quora.com/How-often-do-software-developers-use-OOP). One answer there by Kurt Guntheroth is interesting "Any time you write a program longer than about 1,000 lines, you should use OOP. 1000 lines? Why’s that ...?"
  3. [When is object-oriented programming not a good fit?](https://www.quora.com/When-is-object-oriented-programming-not-a-good-fit)
  
  Hopefully I can get some other answers.
  
  
  ---
  
  ### Answer by username_3 on 2021-02-06. Score: 1
  
  This is a really nice question! Your answer covers a lot of ground too.
  
  I’d like to offer a reflection on what might motivate these questions.
  
  In my experience, learners who encounter OOP early in their journey have to wrestle with a few different challenges, including:
  
  1. They’ve not yet experienced the problem/s that OOP solves.
  2. They believe that there is a perfect solution to all programming challenges waiting to be discovered.
  
  These give rise to a whole load of questions, confusions and, in some cases, insecurities.
  
  > **Comments:**
  > **username_4**: Your point #2 is pretty universal: rationality asserts the ability to solve problems. It is the Juggernaut that is the only tool which eventually will solve every problem. And, to a kid with a Juggernaut, everything is something to drive over. If we could teach people only one thing, it should be that thoughts can be wrong, too. Skepticism of mental processes would reduce suffering dramatically, including for students. (I think the Buddha said that. Or maybe it was Socrates. Abraham? Confucius...)  
  > **username_5**: In my experience in teaching grade 11 and 12, early'ish OOP is better than late.  If students don't learn OOP in grade 11, it feel like breaking (bad?) habits in grade 12.  I also feel the same about functions.  I have grade 9s build games is Scratch that are quite modular with custom blocks.  I think making decomposition and modularity core components early on helps all learners.  Without it, I find the weaker students struggle with advanced algorithms, and the strong students try to brute force the solution successful, but their code is a mess.  
  > **username_0**: Another reason maybe because GUI is everywhere (especially for kids never touch linux world) , students may tend to feel OOP is THE solution for every programming problem.  
  
  ---
  
  