|
Keep in mind, I don't know for sure. I saw a snapshot of a printed assignment, or maybe it was a book. Like I said, I didn't ask. Jschell did some googling and found that other people made a class with that name. I'm pretty sure the prof adapted the assignment somewhat for his class though, for reasons.
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: But I'm hearing that professors are teaching that classes are effectively a single action
Plural?
So someone claims that multiple different teachers are teaching that?
And what professors? Community college? Some night school community education classes? High school?
honey the codewitch wrote: Am I wrong here?
You are correct.
But there could be more to it.
For example the curriculum could be forced. Especially true for high school type education. They screw around all sorts of ways with teaching reading/math like that using experimental methods which never work.
Or just an incompetent teacher. Either not trying or just one that does not have the knowledge.
|
|
|
|
|
Yeah plural, as I've seen before in other assignments in the past.
CS coursework, last one at a uni in south africa.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Perhaps the classes were really about teaching coding (mostly) and not about concepts?
True it shouldn't be that way but it does happen.
|
|
|
|
|
I used to work with a guy who did so much refactoring that most of his functions came down to one-liners, and all of his classes were focused to an extreme, to the point of being responsible for a single action.
Looking at individual classes/functions one-by-one, his code became trivial to read, but the problem this introduced is that there were so many tiny single-purpose classes, the whole thing grew to have the opposite effect and became an unmanageable mess. He understood it very well. But the rest of the team spent way too much time jumping through endless class definitions, trying to find where the real work was being done.
I'm hoping those professors aren't following that model.
|
|
|
|
|
In that case, if you make them all static, put them in related "class libraries", it becomes manageable; like "System.Math".
"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
|
|
|
|
|
More than thirty years ago, when OO concepts made were first thought of, everyone jumped onto this, and started talking about OO, without really understanding it; much like The Emperor's New Clothes - Wikipedia Everyone could see the 'clothes' the Emperor was wearing, and talk about their grandeur, but the reality was different.
History is said to repeat itself, perhaps in the form of these OO professors of today.
modified 6-Nov-23 19:28pm.
|
|
|
|
|
OOP? Hell, I'm pissed they never taught anything about debugging techniques or using a debugger!
It would make teaching the languages and code much easier if they could see exactly what's changing while the code is running.
|
|
|
|
|
They also didn't teach building/making complex software systems.
We learned on OpenVMS and the debugger is nigh on unusable so it's no surprise they didn't teach it. Learning how to debug without a debugger is much more important anyway.
|
|
|
|
|
I wish they would have taught just the basic technique of outputting suspect variables to the console, but when I was going, they didn't teach even that.
|
|
|
|
|
The prof is teaching “microServices”
I remember seeing a text book purporting to teach OO with C++. I seriously think that a professor took an Introduction to Programming with classic BASIC and converted it paragraph by paragraph to C++. It was horrendous!
|
|
|
|
|
|
When I was learning C++, most college professors knew a bit of C and taught C as C++. I see things have not improved
|
|
|
|
|
honey the codewitch wrote: Am I wrong here?
No, not at all. A class, in the various languages that contemplate it as a construct, is one of several possible forms of implementing an ADT (Abstract Data Type). Generally data + code, plus some other "automation" to implement inheritance and, consequently, dynamic polymorphism, at least in languages like C++. An ADT is also an opaque structure (like FILE in the C library) in addition to the free functions that operate on it: it does not matter what the "guts/bowels" (hidden part) of a class or structure look like, what matters is the interface with which it allows you to operate, i.e., the functions that accept an explicit or implicit "this".
|
|
|
|
|
Your description is very accurate IMHO...
Can you - secretly - share the name of the places those professors teaching? I want to ensure my kids don't go near there...
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization." ― Gerald Weinberg
|
|
|
|
|
You're probably safe. I ran into this while helping a student from South Africa
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 car class might contain 4 Tire class instances
...
Am I wrong here? Yes - you misspelled "tyre".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
honey the codewitch wrote: professors are teaching that classes are effectively a single action like ReadTextFile I hope what they meant (but probably didn't clearly convey) is a recommendation for a TextFileReader class (that derives from FileReader that derives from StreamReader ) that has methods like Read() and ReadToEnd().
/ravi
|
|
|
|
|
Not at all.
It had ParsePatientData, and OuputPatientData
Yeah. It's like that.
And the assignment required the name.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I guess that could be considered a class in a command-based architecture, where ReadTextFile inherits from (or implements) some sort of base Command class and it contains all the information the processing system needs to perform that action, but it's a stretch, and certainly not to be taught as "the norm"...
|
|
|
|
|
That's almost certainly what is being taught. It comes from the (very helpful) book 'Design Patterns' by Erich, Gamma, et. al. (aka. 'the Gang of Four' ... abbreviated everywhere to 'GoF'). It is useful in particular situations, and it has trade-offs. Professors should teach it, but I doubt they are advocating that it should be always done that way ... that's more likely students not grasping the nuance of when to apply the pattern.
|
|
|
|
|
Mark Quennell wrote: where ReadTextFile inherits from (or implements) some sort of base Command class
Interesting possibility.
Although then either the class should be an advanced one or specifically about patterns.
Patterns should not be introduced in an introductory course.
|
|
|
|
|
Many people consider this a must read for OOP/class deisgn -
|
|
|
|
|
No, you are correct.
Your car is a valid class as you define it. ReadTextFile() is a function. To be a valid class, imo, it would be TextFile as the class, with properties and actions. TextFile.length, etc. and TextFile.Read,write,etc.
My take, in English grammar, is that a class should be a noun, with adjectives, verbs and possibly adverbs that go with it. If it's short of that, it deserves another look for consideration as a function or structure.
I suppose, depending on the language, a class could be looked at as a convenient way to store a reusable. What a declaration nightmare that creates, using your example.
|
|
|
|
|
honey the codewitch wrote: But I'm hearing that professors are teaching that classes are effectively a single action like ReadTextFile and it makes me a lot more irritated than I probably should be. You're right. A class encapsulate a physical or logical object, including ways to interact with the object.
What that professor is teaching is sheer idiocy.
Many moons ago a friend relayed a story -- we worked for a consulting firm and he did the tech interview for a professor that had taught VB at the local community college for 5 years. She failed the interview and he recommended against hiring her.
Why? She knew the syntax of the language better than he did, but she had NO idea how to actually program. She could answer questions such as "which method to use to add an item to a listbox" (something we didn't bother asking), but didn't know which construct to use for looping. She could write an if loop, but couldn't tell when to use if or while or foreach. He went into the interview assuming it was a formality, and ended up vetoing her.
Far too many college professors have no real world experience.
|
|
|
|