|
pkfox wrote: He designed C++ not OOP
No one person "designed" OOP.
Like many concepts it evolved over quite a long time with different people working on the concept.
And at least when the "C++ Programming Language" was published for available books there were perhaps only four (or three) of them. And two were on C++. The concepts in all were basically the same.
|
|
|
|
|
But he explained OOP that way and the implmentation in C++ was that way as well.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
I’m begging you for the benefit of everyone, don’t be STUPID.
|
|
|
|
|
Mixing (up) function(s) and actions.
ReadTextFile is some clumsy rewording of a "TextReader" class.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
In this case it was part of an assignment to read phony medical records from a CSV.
A more horrible name I could scarcely fathom. I was helping with their homework, and trying to teach them what their prof wasn't.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I would say TextReader is the superclass of ReadTextFile. Text doesn't always come in files.
|
|
|
|
|
Personally I can't make a bridge between ReadTextFile and the car...
Anyway you example shows a classic thing, that classes are usually not 'stand alone' and in a certain way 'connected'/'depended'
Your examlpe:
Engine.Start() does depend on the state of the Gear. Either Engine asks the gear for 'I'm ready to start' or the gear sends a message to the engine 'hey, I'm at gear 1 (without pressed clutch), not really good to start at the moment' and so on and on and on...
Abstracting the reality is usually very hard.
Only my two cents.
|
|
|
|
|
Of course, but I was simplifying and glossing over details to simply get to the larger point, to wit: In my mind, a class is a noun, not a verb, essentially.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
honey the codewitch wrote: a class is a noun Not really, since a class encapsulates properties (nouns), and actions (verbs); so it could be an ablative gerund.
|
|
|
|
|
Holy ...
Dear Richard, you know me now for a longer time as an English non native. Can you please describe 'ablative gerund' in _very simple words_ for me?
Thank you very much in advance
|
|
|
|
|
lol
Apparently it does mean something. I googled it just to be sure. But I still didn't understand what it means.
|
|
|
|
|
=> Conclusion: You are not native English, at least not british native
modified 6-Nov-23 18:35pm.
|
|
|
|
|
English has gerunds (a verb ending in -ing that also functions as a noun) but no ablative case[^].
|
|
|
|
|
Thank you Sir. But is this also available in easy words
|
|
|
|
|
I believe ablative gerund belongs to latin grammar, and there is no such thing as easy latin.
But I'm probably wrong though, as I never learned latin.
|
|
|
|
|
Awesome rabbit-hole
|
|
|
|
|
Ha ha! I remember "ablative" and "gerund" from my Latin classes back in the 1950s. So I just put the two words together as a joke. But the joke, it appears, is on me, as there realy is such a thing. But I am not sure exactly what that thing is.
|
|
|
|
|
|
I think I would rather read a PHD research article on string theory.
|
|
|
|
|
LOL.
So I am not the only one.
|
|
|
|
|
honey the codewitch wrote: In my mind, a class is a noun, not a verb, essentially For me, a class may be either a noun or a verb.
As a noun, the concept represented by the class is a thing, and the class provides information and operations for that thing.
For a verb the concept is a process, and the class supports that process. I guess 'process' can be thought of as a noun, but thinking of it that way adds indirection to my thinking.
Software Zen: delete this;
|
|
|
|
|
That's a good point. I was trying to get to the essence of it and simplify, but obviously I missed the mark in terms of covering every eventuality.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Keeping in mind of course that a school class is intended to teach concepts not practice.
So in general one can think of it as a noun but if someone insists that every single class must always follow some rule about that then it is going to be a problem.
|
|
|
|
|
An engine on a stand doesn't need a gear box to "start" or "run". It needs fuel and / or a battery.
"Moving" is accomplished through the addition of a transmission, axels and wheels.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
0x01AA wrote: Abstracting the reality is usually very hard.
Abstracting reality may be difficult but its absolutely essential. If you see a chair that you've never seen before and you don't have an abstract concept of what a chair is, how would you ever know its a chair?
It sounds like this professor had a difficult time with the abstract concept of a class. It can be a difficult concept but I would think it would be a prerequisite to being an IT professor.
But what do I know? I'm self taught and assume there a plenty of abstract concepts I'm just not aware of.
|
|
|
|
|
That's the way I learned it also, of course I taught myself but every reference I came across explained it that way.
I don't think before I open my mouth, I like to be as surprised a everyone else.
PartsBin an Electronics Part Organizer - Release Version 1.3.0 JaxCoder.com
Latest Article: SimpleWizardUpdate
|
|
|
|