Live data from Hacker News

Goodbye, Object Oriented Programming

medium.com

191–200 of 355 posts

Re: Goodbye, Object Oriented Programming

#191
post #17

I wonder if someone invented the "modular" programming yet. Judging by the UNIX paradigm of the command line tools, the idea is clearly out there. Instead of objects, do modules - things that do one thing, and carry minimal dependencies. You need a banana? Grab the banana module. You need a banana with ice-cream center? Feed the "center" callback of the banana module with "ice-cream" instead of "banana intestines". Y…

Lisp is always an answer.

Re: Goodbye, Object Oriented Programming

#192
post #166
post #135

Earlier quoted context omitted.

> And this guy has supposedly been writing in OO languages for decades? What? This is the bit i don't get. It's like he learned OOP in the '90s, when everyone thought inheritance was rad and nobody had realised how terrible mutating shared state was, and then fell asleep for twenty years. None of this article, none of it , has any relevance to how OOP is practiced by informed people today.

The keyword there is informed. There are still plenty of shops that practice OOP this way. I'm working at one right now and there are OOP horrors around every corner. Unfortunately, they seem intent on adding more mutable state rather then eliminating it.

Do you have anecdotes you can share? :D

Re: Goodbye, Object Oriented Programming

#193
post #57
post #33

Let's wait for a few years and we'll see plenty of articles "Goodbye functional programming". You can write good and bad stuff with OOP, you can do the same with FP. There is no one-size-fits-all porgramming style.

You're making a false equivalence. Functional programming has a strong basis in discrete mathematics that OOP simply does not. This makes it better suited to accurately describing computation at a high level than OOP. However, you probably arrived at this conclusion because you still see programming languages as having intrinsic paradigms and those paradigms meaning anything about computation. The fact of the matter…

> The best programming language is the most accurate algorithmic notation system.

Actually, the best programming language is the one you're programming in right now. /s

Although my comment is in jest, I do think it has a lot of truth; I'm never going to write something for HPC in Haskell just because it has better algorithmic notation, I'd most likely choose Fortran or C. I'm not going to write a web back end in Haskell, I'm going to write it in Python, Ruby, Javascript, or any other language much better suited for the application. I'm not going to write statistical model analysis in Haskell, I'm going to write it in R, Python, Matlab, or Mathematica.

Saying that all programming languages are just little more than notation systems for algorithms doesn't actually reflect reality that programming languages are not just math operations, even if that's what they become in the compiler or to the CPU, and telling people that is disrespecting the entire industry and academic side of programming and computer science.

Re: Goodbye, Object Oriented Programming

#194
post #123
post #70

OO is treated almost like a religion by some people. It's useful to be able to create instances of some things but the place OO fails is the "oriented" part. Code is much easier to maintain and understand written in a functional state. If something doesn't need to be an instance, it probably shouldn't be one. This article articulates a lot of problems I've noticed in OO code, I think it would be foolish to ignore it.…

> Code is much easier to maintain and understand written in a functional state. Why is it then that programs written in OO outnumber FP software by 100000:1 or more. For example most of the software written for iOS and macOS are written in C++, Objective C or Swift. All three are class-based object-oriented languages. What you say may not be true or may not be very important.

Why is there so much COBOL or Visual Basic still around? Or tons of PHP and Javascript on the server? Just because there is lot of programs written in $x doesn't mean $x is better, more maintanable, more efficient, easier to understand. It could be, but it doesn't have to be.

That argument assumes the average developer, average university, average company can look around and is able to effectively pick, understand (this implies ability to learn) and evaluate merits of a framework or language. Most don't even have a choice. They are taught, or maint the code base or listen to what is told by management and that's their choice. Managers hire to the code base that's already there and to languages / frameworks they know. Developers who just want a job (nothing wrong with that) will pick and learn languages that managers hire for.

Re: Goodbye, Object Oriented Programming

#195
For some odd cosmic anomaly, I learned programming almost exclusively in functional programming environments. My first language was R, and subsequently learned Scheme, Clojure, Ocaml, Haskell, and currently program primarily in Scala. Having never gone a through the OOP trend, and realizing that my current programming experience happened to be de jour gave me some undeserved confidence. So much so that I would regularly make fun of all of the Java drones at my work for their insistence on using such an inferior paradigm.

Then due to some directions I was taking at my job, it became very valuable to run millions of simulations of warehouse and transportation operations. After months of pain, I discovered object oriented programming (luckily I didn't have to abandon my language of choice to get it). Comparatively speaking, there wasn't a functional design pattern I could find that could come anywhere close to the simple elegance of OOP for modeling people, vehicles, warehouses, etc.

It's almost as if different ideas have different virtues in different domains.

Re: Goodbye, Object Oriented Programming

#196
post #74

I find many of the objects in .NET very useful and use them in my code. Also in my code I define and use some classes. I like the idea of classes. E.g., in my Web pages, I have a class for the user's state . When a new user connects, I allocate an instance of that class. Then I send that instance to my session state store server. To do that, I serialize the class to a byte array and then send the byte array via TCP/I…

> But inheritance? Didn't think it made much sense and never tried to use it.

This is interesting to read. When OO was popular inheritance was at the top of the list as the OO killer feature. "your 'Manager' class is just an employee but with 3 extra methods, so you save so much copy and paste, etc etc".

I believed it at some point. Then perhaps 15 years later, after everyone has been bit by deep, confusing inheritance they had to maintain and debug, inhertance is the devil.

It is just interesting to observe how once a selling point of OO is now a big giant warning to stay away from.

Re: Goodbye, Object Oriented Programming

#198

Earlier quoted context omitted.

I don't have any idea what you're talking about when you say 'functional came before OO'. I'm guessing you are talking about Lisp, but not only are Common Lisp (and the languages it evolved from) not at all functional in any technical sense of the word, many of them only had dynamic scoping, and often used mutation of data structures implicitly. Stop talking nonsense. EDIT: If you are talking about scheme, then the s…

>I don't have any idea what you're talking about when you say 'functional came before OO'. Lambda calculus is technically the first functional language, and predates computers. But if we're talking about actual programming languages, SASL, one of the earliest functional languages actually implemented, was released the same year as Smalltalk, and was influenced by the older ISWIM, which was never implemented. >I'm gue…

The lambda calculus was also the first OO language. (William Cook pointed this out in http://web.engr.oregonstate.edu/~walkiner/teaching/cs583-sp1... and I'd noticed the same thing. I just want to bring in a neat observation here, not fight for either side of the OO/FP culture war. I wish we humans wouldn't do that.)

Re: Goodbye, Object Oriented Programming

#199

For some odd cosmic anomaly, I learned programming almost exclusively in functional programming environments. My first language was R, and subsequently learned Scheme, Clojure, Ocaml, Haskell, and currently program primarily in Scala. Having never gone a through the OOP trend, and realizing that my current programming experience happened to be de jour gave me some undeserved confidence. So much so that I would regula…

> it became very valuable to run millions of simulations of warehouse and transportation operations. After months of pain, I discovered object oriented programming

That's interesting. I think simulation specifically is an area that fits OO too well. It even fits the classic texbook example of a "Car is a vehicle, which enapsulates and engine. Its state has speed and position. etc".

Re: Goodbye, Object Oriented Programming

#200
post #196
post #74

I find many of the objects in .NET very useful and use them in my code. Also in my code I define and use some classes. I like the idea of classes. E.g., in my Web pages, I have a class for the user's state . When a new user connects, I allocate an instance of that class. Then I send that instance to my session state store server. To do that, I serialize the class to a byte array and then send the byte array via TCP/I…

> But inheritance? Didn't think it made much sense and never tried to use it. This is interesting to read. When OO was popular inheritance was at the top of the list as the OO killer feature. "your 'Manager' class is just an employee but with 3 extra methods, so you save so much copy and paste, etc etc". I believed it at some point. Then perhaps 15 years later, after everyone has been bit by deep, confusing inheritan…

There was a lot of hype floating around. There still is. It's like the news: Always the same just the names change.
Post reply on HN