Click here to Skip to main content
15,179,670 members

Welcome to the Lounge


For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

GeneralRe: OO Software design epiphany - it might not matter Pin
Dale Barnard14-Jan-21 7:18
MemberDale Barnard14-Jan-21 7:18 
GeneralRe: OO Software design epiphany - it might not matter Pin
sasadler14-Jan-21 8:00
Membersasadler14-Jan-21 8:00 
GeneralRe: OO Software design epiphany - it might not matter Pin
Paul Gehrman14-Jan-21 18:23
MemberPaul Gehrman14-Jan-21 18:23 
GeneralRe: OO Software design epiphany - it might not matter Pin
Member 289602014-Jan-21 18:24
MemberMember 289602014-Jan-21 18:24 
GeneralRe: OO Software design epiphany - it might not matter Pin
KateAshman15-Jan-21 6:26
MemberKateAshman15-Jan-21 6:26 
GeneralRe: OO Software design epiphany - it might not matter Pin
BotReject18-Jan-21 5:30
MemberBotReject18-Jan-21 5:30 
GeneralRe: OO Software design epiphany - it might not matter Pin
charlieg22-Jan-21 12:56
Membercharlieg22-Jan-21 12:56 
GeneralRe: OO Software design epiphany - it might not matter Pin
Martin ISDN1-Feb-21 9:18
MemberMartin ISDN1-Feb-21 9:18 
in my opinion OOP, FP and procedural programming are more a way of thinking. it's how you approach a problem.

i have a strong distaste for single paradigm languages. for me, if those languages were people they would have surely been racist. not only they have chosen to do things in only one way, but they have heavily preached that their way is the only true way and ridiculed others.

Javaheads have been known to express their superiority vs people using C, Perl, JavaScript... i considered the later to be far superior than Java since day No.1, C in one way, Perl and JS in another way.

i was exposed to OOP via C++ and Turbo Pascal. what i am going to say next is thus of concern to statically typed languages of the Algol family (C++, C#, Java) and does not have meaning to CLOS LISP, Smalltalk, JavaScript, REBOL... and i find the later to be superior for OOP.

Encapsulation - i see this as only the shortening of the visible scope. aside from that inside the encapsulated area you still deal with structural programming tools. also, classes are inferior in encapsulation to ADTs in C. when a library or a module in C exposes it's ADT as an opaque struct, opaque pointer or should i say a handle, that is when you are really working with a "blob of data". it's not even a blob, it's just a name. it's called an opaque pointer, but it's not a pointer at all, because you cannot de-reference it yourself. when they give you the definition of a class i.e. the data type descriptor, is when you already know to much to be called encapsulation.

Inheritance - for the type of languages that we speak, statically typed, OOP folks see it as a liberation from a world that has nothing resembling a first-class functions, while LISP folks see OO as a prison. inheritance is the liberating force in OOP because it lets you go around the type system that is too strict. not by any virtue as it is always represented (it had never happened to me to misuse a reptile where i should have used a mammal), but by the lack of abstraction from the von Neumann architecture and the basic data types in CPU usage, namely: integer and float. in that respect Java has not gone far in abstraction than the C Abstract Machine.

inheritance is not about code reuse. every time you see a method overridden you see the braking of the OOP promise of reuse. inheritance is to losen the grip of the strict typing and it's most useful for building interface compliance. inheritance is mainly a specification technique rather than an implementation technique

Standard C++

and now lets look at encapsulation and inheritance together. they are antagonizing forces. the former is a restricting force, the later is an liberating force. in my opinion, that is why it is hard to do OOP in an Algol type language and that rises the need for design patterns. those patterns are there to make you interact the right way in such an environment. 2/3 of those patterns have no meaning in LISP and probably in JS, too. LISP and JS have something in them essentially reusable, because its easy to prototype a new application and it's easy and fast to rewrite the application. first class functions.

Polymorphism - without this, you only have function overloading. everybody knows that in C++ (et al) the code is not inside the object. when you don't use polymorphism and virtual functions, all you get is overloading. having the ability to define a function that has the same name for a different type of formal parameters. signature if you will.

int f(int, int)
int f(double, double)

but because in Algols the f method has a hidden parameter, it's not magic. it's only overloading.

f(type cat, int)
f(type dog, int)

in C++ that is the first parameter in Pascal that is the last parameter. in fact, that is how also Pascal does nested functions. the last hidden parameter is a delegate to the scope of the enclosing function. and thus, closures are a poor man's object's and vice versa.

newer versions of C++ are going to make this equivalent. whenever you can say cat.move() you will also be able to say it move(cat).

so, with inheritance you get the liberty to call a last descendant's function with any ancestor. and with polymorphism you get that call resolved the right way and runtime. Because the only true OOP you get with Algols is when you use virtual functions and there for you have something from the class functionality embedded in the object. otherwise objects are just dumb data. it's not like in JS where the object is constructed dynamically and the functions are added to that object.

it all boils to personal preference, mostly to the type of person you are. i presume building Byzantine hierarchies of classes is for persons who like perfect utopia like societies.

i use my favorite language C any way i please. it's not too strong at OOP nor at FP, but it doesn't forbid it. Java forbids procedural programming. my understanding of FP is in using pure functions and i use them all the time. C is more capable of pure functions than Java, bc it's composed types do not copy by value. only the reference to an object is copied by value, much like you would do with a pointer to a struct in C and that's mutation outside the scope of the function. a side effect.

whenever i create structures that have mostly the same building blocks i understand there is something OOP in the C++ way in it and may use it's tricks.

this is an exhausting topic and although i have written too much, plenty more can be written. but i believe it comes to what is your personal liking. there is also the right tool for the job.

i have strong confidence in Dennis MacAlistair Ritchie and the compromises he chose. i like what John McCarthy did with LISP, too. the way i do in programming are closely related to my personality, unless i get payed to do otherwise.

that is why you should not care if you do it in OO design or not. in your domain of embedded systems it is not strictly required from you to do so.

good luck
GeneralHorror videos on youtube! Pin
CodeWraith13-Jan-21 5:05
MemberCodeWraith13-Jan-21 5:05 
GeneralRe: Horror videos on youtube! Pin
OriginalGriff13-Jan-21 5:13
mveOriginalGriff13-Jan-21 5:13 
GeneralRe: Horror videos on youtube! Pin
CodeWraith13-Jan-21 5:42
MemberCodeWraith13-Jan-21 5:42 
GeneralRe: Horror videos on youtube! Pin
dandy7213-Jan-21 5:50
Memberdandy7213-Jan-21 5:50 
GeneralRe: Horror videos on youtube! Pin
den2k8813-Jan-21 5:24
professionalden2k8813-Jan-21 5:24 
GeneralRe: Horror videos on youtube! Pin
CodeWraith13-Jan-21 6:10
MemberCodeWraith13-Jan-21 6:10 
GeneralRe: Horror videos on youtube! Pin
Daniel Pfeffer13-Jan-21 6:28
professionalDaniel Pfeffer13-Jan-21 6:28 
GeneralRe: Horror videos on youtube! Pin
den2k8813-Jan-21 6:38
professionalden2k8813-Jan-21 6:38 
GeneralRe: Horror videos on youtube! Pin
Kris Lantz13-Jan-21 6:39
professionalKris Lantz13-Jan-21 6:39 
GeneralRe: Horror videos on youtube! Pin
den2k8813-Jan-21 6:43
professionalden2k8813-Jan-21 6:43 
GeneralLots of voting for December Article of the Month Pin
Greg Utas13-Jan-21 3:50
mveGreg Utas13-Jan-21 3:50 
GeneralSurveys? Pin
charlieg13-Jan-21 3:29
Membercharlieg13-Jan-21 3:29 
GeneralRe: Surveys? Pin
Marc Clifton13-Jan-21 3:36
mvaMarc Clifton13-Jan-21 3:36 
GeneralRe: Surveys? Pin
Greg Utas13-Jan-21 3:47
mveGreg Utas13-Jan-21 3:47 
GeneralRe: Surveys? Pin
charlieg13-Jan-21 4:31
Membercharlieg13-Jan-21 4:31 
GeneralRe: Surveys? Pin
RickZeeland13-Jan-21 4:05
mveRickZeeland13-Jan-21 4:05 
GeneralRe: Surveys? Pin
charlieg13-Jan-21 4:30
Membercharlieg13-Jan-21 4:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.