Why do people hate on OO so much. Do a degree it was forced down my throat in college and many of its principles I disagree with. It almost seemed design to cause code bloat and run slower than a non OO language, but still has some reasonable application in modern programming.
I don't really hate OO. I think it's overused by retards and inheritance is a completely inane concept.
Name:
Anonymous2012-07-15 10:08
It's a simply a design method. You structure your code so that it becomes easy to reuse common code. It's very useful to inherit basic code traits and focus on extending the less common requirements. As with any system, it can be a habit to apply so many layers of abstraction that the the whole system becomes structurally unwieldy which would lead to code bloat.
I'm not sure how one would fix this other that getting programmers to experience this and telling them "don't do it that way".
I don't think OOP should be used that way. Abstraction should be developed through modules. Objects should be used the way they were designed to be used, that is, to model real-world objects. Incidentally, this makes inheritance and data hiding almost useless.
Name:
Anonymous2012-07-15 11:08
out of interest, what other design methods are there? /prog/ seems coo-coo-bananas about list programming languages (why?), what else is out there? what would you classify java as? what about javascript?
Name:
Anonymous2012-07-15 11:16
>>6
Type classes is my personal favorite. Essentially you assign properties (via function implementations) to your data types. It's how Haskell does it.
For example, you have the function ==. This function is of type a -> a -> Bool, and the class is called Eq. So let's say for your data type it makes sense to be able to equate two, you implement the == function for your type a. This is very much like how interfaces are handled (in Go), but superior to objects in the sense that all of a sudden, you operate only in terms of what your "objects" can do, rather than who or what they inherit from (base classes and all that useless junk).
>>1
Compiler implementations plus bad modelling cause code bloat, not OO itself. Dynamic dispatch can be slow, but isn't that irrelevant with modern cpus/vms?
>>1,2
But I agree that the OO paradigm is being forced down for quite a long time, and with several bad examples (classic: roles through inheritance).
>>5
Yup, I don't know what kind of bad joke is data hiding. And it's weird how people model extensible libraries with fixed class hierarchies.
Name:
Anonymous2012-07-15 14:38
I invented the term Object-Oriented, and I can tell you I did not have C++ in mind. - Alan Kay OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them.
Name:
Anonymous2012-07-15 14:47
>>3
>I'm not sure how one would fix this other that getting programmers to experience this and telling them "don't do it that way".
By the time programmers have experienced this, they want nothing to do with the people who indoctrinate students to think otherwise. (This is half the problem.)
Name:
Anonymous2012-07-15 15:28
>>12
I agree that for the time being its slight issues with efficiency are irrelevant, but it's been proven that CPU's will not continue to improve too much longer. Eventually it will become an issue.
Name:
Anonymous2012-07-15 15:32
OOP is crap. I wish C had a template system for types inside a function, though, without the use of cpp and dubious typeof() extensions.
(Though those extensions are supported by both compilers that matter: GCC and Clang.)
There are no efficiency problems with OOP. Usually these circlejerk pseudo-arguments are used to promote C or some similarly ancient language. OOP can only be inefficient if you use vtables and dynamic binding, but then again typical C code is littered with function pointers which are the same shit. But obviously you wouldn't use polymorphic objects in a high performance setting. Nor would you use RTTI in C++ (the name should give it away as being a performance-degrading feature). Simple classes with encapsulation have no detrimental runtime effect. Do some fucking research ( http://www.open-std.org/jtc1/sc22/wg21/docs/TR18015.pdf ) before you type stupid shit in a sorry attempt to parrot memes.
The way i see things is that OOP is being hyped because it makes programming possible for stupid people and in turn permits corporation to train keyboard monkeys that have no understanding of computers but still can get work done while being cheap and replaceable.
That said i never had to use OOP so i dont know if it has any real significant flaws, but i can see that it makes sense in some applications.
Name:
Anonymous2012-07-15 16:35
>>20
Rather, complete absence of library interfaces. Also, why would I want to use Lisp when C has a rich sediment of practical tradition? I only wish for a better C, not a not-C.
>>27
Well, I would say “fuck you”. But these wines from Argentina are pretty damn good, so I will just say that C isn't shit. It was a high enough language to build great software and can't be replaced with something better suited until now.
>>25
By the way, I'm working in something like C with templates and some type inference to handle some things [that I don't like to do Lisp].
Name:
Anonymous2012-07-15 19:10
OOP sucks because it is merely a ``good'' approximation (and more often than not a mediocre one) of the domain of whatever you are doing, and never the best one. So if you are willing to settle with a tolerably good, passable representation of your entities, OOP is of much benefit to you because it can be applied without turning your brain on and burning precious glucose in the process.
However, if you are looking for the best way to define your objects of interest in your programs, you will have to learn a lot of theory about all kinds of models and paradigms of programming, and then attempt to apply this knowledge to choose a right way of expression. Depending on your domain of interest, it can be anything, from state automata to logic programming, but it is never OOP.
Name:
Anonymous2012-07-16 0:06
Learning lisp will alter your life.
Your brain will grow bigger than you ever thought possible.
You will rewrite all of your applications in just a handful of lines
Society will shun you. You will shun society.
You will become disatisfied with everything and everyone around you.
Lisp is so simple to learn that you can learn lisp in just a few minutes. I just learnt it now while I was waiting for a bus.
Lisp is so simple that you can implement it in any language in just a few pages of code. This might never happen though, because once you've learnt lisp you'd never want to write anything in any language other than lisp, so you wouldn't bother implementing lisp in any language other than lisp.
Lisp can be fully implemented in lisp in just a handful of lines. I just implemented lisp in lisp, fully, while i was hopping onto a bus and paying for my bus ticket all at the same time.
When you become a lisper, you will laugh at jokes that no one else thinks are funny. You will know things that cannot be expressed in ordinary imperative language.
You will think people are idiots when they state things like "Hi, how are you?" because a lisper simply doesn't need to use such verbose constructs. Lisp abstracts away those patterns of interaction and makes them completely irrelevant. The proper way to greet a fellow lisper is just a tiny nod of the chin, and about a tenth of a wink from your left eye, then point at your tin foil hat. They will know what you mean. if they don't know what you mean then they are not a true lisp programmer and they don't matter anyway.
Lisp was invented a long time ago, before java, before C, before fortran, before computers, before people, before the earth was built. the universe itself is a lisp program so trivial that no true lisper would even both implementing it.
Lisp is so elegant that the very fact that you know even the first thing about it will qualify you for a season as principal dancer of the royal ballet. You will go out on stage in your little tutu and just scribble a few round brackets in the air with your toe. People will gasp in wonder. Unless they don't know any lisp. If they don't know any lisp then they are idiots and they don't matter.
Only lispers have a true definition of fun. Maybe ML programmers too. All of today's languages are based on fortran and lisp. The bad bits fortran, the good: lisp.
If you're good enough to use lisp, you'll soon be frustrated with lisp. Lisp is not an adequate lisp. By the time my bus had made it two blocks I'd written some simple lisp macros that were so powerful they made lisp completely obsolete and replaced it with a new language. Fortunately, that new language was also called lisp. And i was able to prove, mathematically, that the new lisp i'd created was both far superior to lisp in every conceivable way, but also exactly equivalent to lisp in every possible way. I was very excited by this. But also found it very boring.
Reddit is proof that lisp is really powerful. Paul Graham originally wrote reddit, in lisp, on the back of a napkin while he was waiting for a coffee. it was so powerful that it had to be rewritten in python just so that ordinary computers could understand it. Because it was written in lisp it was almost no effort to rewrite the entire thing, and the rewrite was completed in-between two processor cycles. Paul Graham himself was completely written in lisp, by an earlier version of himself, also written in lisp, by an earlier version of lisp. It's lisp, paul graham, lisp, paul graham, all the way down.
Because we've reached the limits of moore's law, the computers of the future will have many-core processors and all our programs will need to be written in a combination of haskell and lisp, that will itself be so powerful that the computers of the future will not be able to implement any of our ideas without creating time-travelling algorithms that borrow processing power from other computers that are further into the future. This sounds difficult, but in lisp it isn't difficult at all. in haskell this is a built-in feature and the way you implement it is just a no-brainer to any one who knows lisp or haskell.
After that, the computer of the future will be called The Lisputer. It's speed will be measured using the Lispunit, which is a measure of how many simultaneous arguments about the inadequacy of lisp can be proposed and defeated by an infinite number of lisp pundits without any actual decisions being made. Today's computers run at just under one lispunit. The Lisputer will run at lisp Lispunits, where lisp is a fundamental maximum constant of the universe that can't be expressed using ordinary imperative numerals. Suffice to say that it ends with an infinite number of closing parentheses.
Name:
Anonymous2012-07-16 0:41
>>30
>Your brain will grow bigger than you ever thought possible.
Dude if you are a healthy male in his 20/30 and your brain starts to grow. Go see a doctor, shit is not normal and could be cancer.
>Lisp gave me cancer
Name:
Anonymous2012-07-16 0:48
>>31
Brain growth grows not in volume taken but the interconnections formed between the different parts. Existing connections become stronger and new connections all contribute to increasing brain capacity.
Using OOP features where you would otherwise use structs and functions that have "this" pointers isn't. You get a boost (no pun intended) in productivity and the compiled code will be almost if not exactly the same.
>>30
Lisp is fun to play with but much too inefficient. This post looks like that of someone under the influence of a mind-altering substance, and that's what the experience of using Lisp is like, but someone who is high can't think practically and clearly.
>>29,33,35
I agree. The problem is that 99%1 of OOP is overuse because design patterns instruct programmers to violate data structures: “continue using more OOP until it fits.”
______________
1. Source: pulled out of my anus.
Name:
Anonymous2012-07-16 8:27
You know, I just wrote a program for a microkernel that's got a runtime of about 8k of 32-bit x86 code. That includes a vsnprintf() and dlmalloc.
I'd like to see an equivalent Lisp or Scheme implementation. And no skimping on the GC.
Name:
Anonymous2012-07-16 9:35
SKIMP MY ANUS
Name:
Anonymous2012-07-16 13:57
>>35 Lisp is fun to play with but much too inefficient.
Common myth.
>>37
If you run only one program inside a Lisp implementation, sure, it's extremely inefficient. But if you run a bunch of programs, the cost is amortized and approaches less than 8k ;)
>>35 Lisp is fun to play with but much too inefficient.
Go back to /jp/, Cudder.
Name:
Anonymous2012-07-16 15:18
>cat-v
I sincerely hope not.
>OOP
I sincerely hope not.
Name:
Anonymous2012-07-18 19:22
bampu pantsu
Name:
Anonymous2012-07-18 22:20
>>25
I've long lamented lisps lack of libraries, but looking at the leaning of #lispers they linger too long in last-centuries limits, its not likely that they'll listen to any logical argument leading to the laying down of new labor lessening lambdas.
>>44
Am I autistic if I haven't noticed until you said it?
Name:
Anonymous2012-07-19 4:12
>>25 Also, why would I want to use Lisp when C has a rich sediment of practical tradition?
Yesterday I read Xah Lee's “What Languages to Hate”1 essay and related web scrolls. It liberated me! I realised the trickery of C and how my brain had adapted to it. C is not minimalistic, C is not a low-level language, C is a wretched and underspecified virtual machine that pretends to try to abstract most mainstream systems.
C is full of lies. C libraries pretend there is such a thing as “plain text”. C pretends to have a consistent syntax and a macro system. C pretends to give portable access to CPU datatypes. C is lies.
C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C. C!
Of course like any self-respecting programmer I read SICP. And I pretended to understand it. I bend and corrupted each sentence found in it to suit C's model. C had become a part of me, I started lying to myself. I pretended to use Common Lisp but what I was doing was pretend Common Lisp is C. “Good programmers can write FORTRAN in any language.”
I can't take it anymore. C is fast not because it was well-designed but just because enormous efforts have been put into its compilers. All dialects of assembly are vastly better low-level language but they're not practical enough so I will probably continue to use C, this time without deluding myself. I will also re-read SICP with a new eye.
I hope this answers your question or at least convince you that using C is neither a priviledge nor a sin: it's a penance.
Have your own god damn perspective, don't get paranoid just because something everyone uses is actually bad. I tell you, beautiful things are always dominated by hurrdurr dumb crap, and you will have to use shit to do shit to make a living, sooner or later. That's how it has always been.