Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^3: I dislike object-oriented programming in general

by vrk (Hermit)
on Oct 20, 2007 at 09:14 UTC ( #646159=note: print w/replies, xml ) Need Help??

in reply to Re^2: I dislike object-oriented programming in general
in thread I dislike object-oriented programming in general

The lazy answer is that these are all Turing complete programming languages, and can thus (skipping a few implicational steps) emulate each other. So yes, you are correct that given any Turing complete programming language, we can do object-oriented programming in it. Since all implementations of programming languages run on a computer, ultimately what you are doing is functional/imperative/logical/object-oriented programming in machine language.

However, it's a separate thing to ask if the syntax and semantics of a programming language makes one paradigm easier or harder than the other. I find programming languages such as Scheme much easier to work with exactly due to minimalistic core features and closures: if I want objects, I'll just wrap the methods in a closure. Doing the reverse in, say Java, that is, using classes and objects to emulate closures entails creating a new class definition for each closure you use, then instantiating objects from them.

Both are possible approaches, and as has probably been discussed in the monastery many times (sorry, I can't search right now), closures and classes/objects are just about equivalent. Now, many "functional" programming languages support objects (since it's really easy to do with closures) and many "object-oriented" programming languages support closures. Arguing which one is better is a source of much heat but usually little light.

As for me, I'm prone to pick a programming language that has closures rather than one that only has objects, because I tend to use closures more.

print "Just Another Perl Adept\n";

  • Comment on Re^3: I dislike object-oriented programming in general

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://646159]
LanX leaves with a song of the Chjuman League
[ambrus]: LanX: that's funny because it's actually the upper class that sleep in hotels, so they're the ones who should know how it's pronounced
[LanX]: h is mute in French (and most other romanic languages)
[LanX]: https://en. oxforddictionaries .com/explore/words -with-silent-h
[LanX]: it's 'orrible zis langage...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2017-03-27 17:33 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (321 votes). Check out past polls.