Actually there is no โplaceโ of comparison that I know for checking your code for its implementation in C ++. Instead, I would recommend that you find a local OO development specialist and ask him or her to conduct a thorough code review of your sample code. After that, he or she will probably go through the port in C ++ and you will see that the languages โโare not much different. (In libraries you will find significant differences, not languages, but this may not be a significant difference for you at the moment.)
A code review is different than asking your professional or TP to rate your work. The professor will likely not have time to conduct a full review with you (although he or she can go through a few points in his office.) A good code reviewer will guide you through the code line by line, providing feedback and questions such as โwhy do you think that I would either not do this? ", or" did you think what would happen if your requirements change to X? " or "what happens to this code if someone else wants to reuse Y?" When you go through the review, they will help strengthen the good principles of OO. You will learn a lot from someone who made a lot of them. (Finding a good person can be a difficult task - if necessary, get a referral or ask someone who is familiar with refactoring. Perhaps ask a TA or a cooling student to do this.) With your code above, I would expect it to take an hour or two.
You can also ask StackOverflow residents to view the code with you via email or right here in the comments / responses. I am sure that you will receive vivid answers, and the discussion is likely to be educational.
It is also helpful to review the code for the test code - ask questions about โwhy did you do this?โ. may lead to insight; and itโs always fun when a beginner finds an error in the code of the guru.
After you conduct a review with an expert to find out what they are (at least one or two reviews), think about doing code reviews with your colleagues in the class, where each of them looks at a different code. Even an inexperienced set of eyes may ask a question that raises some deep understanding.
I understand that you are considering a C ++ class, but you also need more practice with the basics of OO design. After you have more hands-on experience, you will find that all C-based languages โโare just syntactic variations of the general set of ideas, although some language functions make your work easier and some more difficult.
source share