3 ms·
Meaningless toy examples have the problem that they can appear to make sense, planting the seeds of terrible ideas. If in a course example Dog extends Animal,
by HelloNurse 9mo ago
Meaningless toy examples have the problem that they can appear to make sense, planting the seeds of terrible ideas.
If in a course example Dog extends Animal, it can be an arbitrary demonstration of language mechanisms (with an uncontroversial is-a relationship) but even in that case it is implicitly suggested that it is a good or "normal" design, implying an alarmingly complex program that has good reasons to deal with those two types.
Such a program is usually not described for brevity, giving the false impression that it exists: if the problem were analyzed with any diligence, usually Dog would appear a completely pointless complication.
- zamadatix 9mo agoMore or less, this is the https://en.wikipedia.org/wiki/Lie-to-children https://en.wikipedia.org/wiki/Lie-to-children debate. It'd be nice to always be able to learn the best known things up front, it's not usually a particularly practical approach to learning a complex field. I.e. planting a terrible idea is alright so long as by the end the terrible idea was able to be replaced down the line in less time than trying to learn everything "correctly" from the get go. The latter part is where I felt the class failed, it held on to bad idea through the end instead of quickly replacing it with the "next level" of conceptual thinking.
- HelloNurse 9mo agoThe problem is that treating the incorrect simplification as good can be very tempting for teachers. For example, in an introductory physics course teaching Newtonian dynamics without the brutal complications of special relativity and general relativity is fine because it doesn't take much to explain that it is an approximation and it is good enough for "everyday" situations. Students are aware that a better model is available: worst case, they try to get away with not using it. On the other hand in an introductory programming course teaching that if you have Animals in the program the dog instances "should" belong to a Dog subtype is logically consistent and elegant; the only opposing force is the abstract and uncool engineering principle of keeping software simple, and many teachers are dogmatic and enthusiastic.
- zamadatix 9mo agoEverything seems drastically simpler after you've already learned it vs when you're trying to learn everything about it for the first time. Hell, even explaining what the difference between a class and a struct is in C++ ends up going into weeds about public/private that makes many people who just learned what variables were a few weeks ago, let alone trying to teach them what different attributes of classes do by comparing best practices of their usages. I.e. they aren't trying to say what is elegant yet, they are just trying to get people to understand what the building blocks of classes they can compare are even supposed to do so they can get to comparing when you'd do different ones. But there are bad teachers and they tend to be bad regardless of the example chosen.