My assertion (maybe not 100% right but close I think) is that these are wrong motivating examples for the concepts.
-
-
Replying to @RichFelker @aprotim
For example a C++ class "Student" is almost surely wrong, even if you decided to keep the interface and swap in a db-backed implementation.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @aprotim
It's wrong because the object lifetime is wrong unless you plan to copy the whole db into your process and keep it there.
2 replies 0 retweets 0 likes -
Replying to @RichFelker
This seems totally reasonable for a toy problem. It also allows you to discuss the limitations of the technique as knowledge/scope grows.
2 replies 0 retweets 0 likes -
Replying to @aprotim
I guess, but somehow it seems wrong to me to introduce a tool with a problem it's totally unsuited for. First impressions and all..
1 reply 0 retweets 0 likes -
Replying to @RichFelker
But it's only "totally unsuited" because you're used to larger scope/scale of problems. For one student/class grades, most DBs are overkill
1 reply 0 retweets 0 likes -
Replying to @aprotim
It's more a matter of philosophy & what you consider idiomatic to teach, which of course makes it more open to valid diffs of opinion.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @aprotim
As a real world example of where OO representation of persistent data (or even "constant" data) as lang objects leads to nonsense...
1 reply 0 retweets 0 likes -
Replying to @RichFelker @aprotim
I saw a foreign-lang dictionary util in Java that loaded the whole (flat, sorted) dict file in tree object for sake of binary-searching it.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @aprotim
The catch? It only performed one lookup (from the command line) then exited. So all the data structures were useless inefficiency.
1 reply 0 retweets 0 likes
For me the thing that "program level objects are not your persistent-data model" is a pretty important foundational concept.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.