News for hackers. Stuff that matters.
Re:Almost everything on computers is perceptually slower tha... by sunseb on Tuesday November 07, 2017 @11:14AM (#15644589)
Another thing I realized it's nonsense lately: object oriented programming.

It's often an over-engineered bloat that only works for trivial Programming 101 courses (yeah the famous Employee or Bike class). But in 10+ years of programming, I found that OOP is just a complete mess (you end up with awful classes in your code like Service, Manager, AbstractFactory, and so).

I wish we could just use variables and functions, that's all we need really. :)

Re:Almost everything on computers is perceptually slower tha... by rpeden on Tuesday November 07, 2017 @01:54PM (#15646322)
It depends on what kind of development you're doing.

For most web and business programming I've done, at the end of the day I'm mostly just taking data and transforming it into other data. Most of the time, looking at these programs as a series of functions through which data gets piped to obtain the result works well. As a result I think that functional programming is a good fit a ton of code that is written using OOP. For fun, I tried converting some old side projects to F#. Once I'd gotten used to the language, I ended up being able to express the same ideas more clearly, and with fewer lines of code. Functional programming isn't magic, but it can be very effective when used in the right places.

Lately, I've been getting into game development as a hobby. And when I'm simulating a miniature world with hundreds or thousands of stateful actors, I find that OOP works really well - in that the way to code models the game world aligns well with my mental model of the game world. You absolutely can program games using a functional style - I've just found OOP to be a better fit here for my uses. It's still useful to use a functional approach where you can, though, even inside an OOP game code base. John Carmack has written and spoken about this.

Re:Almost everything on computers is perceptually slower tha... by ams6110 on Tuesday November 07, 2017 @11:31AM (#15644756)
> I wish we could just use variables and functions, that's all we need really.

You still can. You need decent data structures too, but I never in over 20 years really "got" OOP. It seemed needlessly complicated. Functions and data always seemed to do the job for me.

Re:Almost everything on computers is perceptually slower tha... by digi_owl on Tuesday November 07, 2017 @01:31PM (#15646083)
OOP as most people get to know it seems to be a bleak application of the original concept.

And the original was not aimed at dealing with the internals of a single program sitting on a single CPU, but grand simulations running on massive clusters. There each "object" would could very well be a process of its own, running on its own dedicated hardware.

Effectively OOP became another one of those buzzwords on the bingo board...

Re:Almost everything on computers is perceptually slower tha... by vikramkrishnan on Tuesday November 07, 2017 @02:28PM (#15646657)
You can: try FP languages. My personal recommendations (from opposite ends of the FP spectrum) would be Clojure and Haskell. F# is pretty nice too.