This is related to my C++ teacher of semester one and, unfortunately, the coming second semester as well. I have already completed the first assignment; needless to say, it's horrible.
How can I gently tell my professor that the homework he is forcing us to do is giving us a bad example of good OOP as well as bad OOP practice in C++.
For example, he is forcing us to class all of our functions, use get/set methods for all members and painstakingly horrible functions to call our data.
This is an example of the homework project we have to do:
AuctionApplication aA; Auction *auction = aA.CreateAuction("Hello"); Bidder *bidder = aA.CreateBidder(", World"); Bid *bid = aA.bid(bidder, auction, 0); std::cout << "Auction: " << aA.GetLatestBid(auction)->GetAuction()->GetName() << "\nBidder: " << aA.GetLatestBid(auction)->GetBidder()->GetName() << "\nPrice: " << aA.GetLatestBid(auction)->GetPrice() << "\n\n"; std::cout << "Auction: " << bid->GetAuction()->GetName() << "\nBidder: " << bid->GetBidder()->GetName() << "\nPrice: " << bid->GetPrice();
Every single function must have a non-void return type, I cannot simply retrieve any data whatsoever without jumping through hoops. Above that, it's not even encapsulated properly, as I can easily get a bid member and then, if I was an unknowing programmer, continue programming with said value.
There is no const-correctness, there is no efficiency (everything is pass by value, even vectors and lists), there is no exception safety, nothing whatsoever.
The homework assignments are bug-ridden and goes against the nature of C++, which is, in my opinion, OOP in moderation, as it demands.
I'm not sure if it's me, and how my other classmates feel about it. I know my friend feels the same way, but most of the class is struggling as it is with a fail-rate of 60% on exams.
Is there any way I can tell my teacher to try and give better assignments in a more C++ style environment without possibly raising his ire?
Posting this in Programmers as opposed to SO since the question deals with how to talk to programming professors, not write actual code :)