Post Reply 
C++ Was a Joke
03-04-2014, 10:05 PM (This post was last modified: 03-04-2014 10:08 PM by Han.)
Post: #4
RE: C++ Was a Joke
(03-04-2014 09:42 PM)Garth Wilson Wrote:  On another forum I'm on, there was a volley of posts between two professional programmers who had both been using OOP in their work for 15+ years, one of them saying it was ill-conceived, that no one thought in terms of objects, etc., while the other one was saying that he definitely does think in terms of objects and OOP has its place, which apparently is for GUIs and plug-ins, something whose insides I'm not the least bit familliar with. I do a fair amount of programming of microcontrollers for embedded applications where the microcontroller will never run anyone's code but mine, and I don't touch graphics. I've read various descriptions for what the parts of OOP are, watched YouTube videos on OOP, and none of it has ever really made any sense to me, at least as presented.

A nephew who's majoring in CS said, "If you're defining a car for example, you don't want to have to define a wheel four times. You make it a re-usable object." My immediate response was that there were subroutines decades before OOP, and, although you might have different kinds of wheels in something so you can't just use the same one for everything--for example, although they are all round and turn on their axis, they will have different diameters and other attributes--I do that kind of thing with macros all the time, not OOP. After all the reading though, I do suspect I've done a little OOP in Forth without knowing it.

I believe your nephew's analogy is not entirely correct. He was probably referring to inheritance when creating a new object based on existing objects (so that you don't re-invent the wheel). But the idea behind object oriented programming is that rather than thinking of a program as merely a sequence of commands applied to data, the data and commands can be categorized as objects with attributes (both in the sense of data values as well as procedures associated with that object). Even your microcontroller can be considered as an object that has certain states (low power, on, off) and procedures that it must run. The difference between the type of programming you do (in which case there is only one object -- the microcontroller, and everything else is either data or procedures related to the microcontroller) and OOP is that OOP would likely break down the "microcontroller" object into a larger collection of smaller objects. For example if your microcontroller is comprised of several subsystems, then an OOP approach would likely create "objects" out of each subsystem -- each subsystem has a certain number of data values associated with it as well as what procedures must be run to maintain those subsystems.

The end result is the same; OOP just makes it a bit easier to organize code as everything is very modular not just by code, but also by design.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
C++ Was a Joke - Dave Frederickson - 03-04-2014, 05:27 PM
RE: C++ Was a Joke - HP67 - 03-04-2014, 06:10 PM
RE: C++ Was a Joke - Garth Wilson - 03-04-2014, 09:42 PM
RE: C++ Was a Joke - Han - 03-04-2014 10:05 PM
RE: C++ Was a Joke - Thomas Klemm - 03-04-2014, 11:20 PM
RE: C++ Was a Joke - Thomas Radtke - 03-08-2014, 11:07 AM
RE: C++ Was a Joke - Thomas Klemm - 03-05-2014, 06:35 AM
RE: C++ Was a Joke - pascal_meheut - 03-04-2014, 10:24 PM
RE: C++ Was a Joke - Garth Wilson - 03-04-2014, 10:35 PM
RE: C++ Was a Joke - Garth Wilson - 03-05-2014, 09:47 AM
RE: C++ Was a Joke - HP67 - 03-05-2014, 10:57 AM
RE: C++ Was a Joke - Tugdual - 03-05-2014, 07:34 PM
RE: C++ Was a Joke - David Hayden - 03-05-2014, 09:11 PM
RE: C++ Was a Joke - Joe Horn - 03-08-2014, 10:45 AM
RE: C++ Was a Joke - Marcus von Cube - 03-09-2014, 12:28 PM
RE: C++ Was a Joke - Howard Owen - 03-10-2014, 01:43 AM
RE: C++ Was a Joke - Sylvain Cote - 03-10-2014, 03:11 AM
RE: C++ Was a Joke - Marcus von Cube - 03-14-2014, 10:40 PM



User(s) browsing this thread: 1 Guest(s)