Will Functional Programming Replace OOP?

preview_player
Показать описание
🔥 PREMIUM DEVELOPER MENTORING PROGRAM:

🔥 CODER'S CAREER PATHS WEBINAR - FREE 29 MINUTE VIDEO:

🔥 LIZARD WIZARD KOMODO - TRANSFORMATIONAL MIND TRAINING:

*************

WEB HOST PAYS FOR YOUR WEB DESIGN TRAINING IN 2021:

POPULAR & EASY CODING COURSES:

*************

🦎 Lizard Wizard Course:

📚 BOOKS TO READ:
… Complements Studioweb courses on HTML5, CSS3 and JavaScript.

The Naked Ape:

✉️ STAY IN CONTACT:
Stef's social links:

Stef's business channel:

👉 GOOGLE REVIEW:
Leave a Google review about Stef.

READ MY GOOGLE REVIEWS:

MY MOUSE & KEYBOARD:

SUPPLEMENTS THAT WORK AMAZING FOR ME:

Protein Essentials Beef Gelatine Powder:

... Healed my very bad knee. If you have joint problems, this *could do miracles for you.

Webber Naturals 88862 Glucosamine Chondroitin

MY CAMERA GEAR:
Canon EOS C70 Cinema Camera

Thanks!

Stef

#mentoring #developermentoring #unclestef #codingcoach
Рекомендации по теме
Комментарии
Автор

Uncle Stef at it again! Thank you for all the ancient coding dragon wisdom!

andrewdillard
Автор

Functional will not replace oop, some problems are easier in oop while others are easier in functional.

nsambataufeeq
Автор

I don’t like the whole complexion in OOP. OOP is not intuitive…People don’t think in OOP…Functional programming makes a whole lot of sense! When you’re given a problem to solve…our minds don’t start thinking in what class will this be in..? You just start solving it linearly…OOP is not linear…It’s a forced way of thinking

mosesnandi
Автор

Agree with you. Inheritance should usually be avoided, you should try to write mostly pure functions, but OOP isn’t itself a bad problem. The real problem is bad codebases mutating state all over the place and tightly coupled code that’s hard to change.

joshuamathews
Автор

It does have some nice practices related to it. I like composition, no mutating of state and pure functions. It feels cleaner and a bit less prone to issues to me with easier debugging? Still though, like most things it has its drawbacks just as OOP and inheritence does. There are usecases out there for either paradigmns.

neomangeo
Автор

I do find functional programming easier to deal with than object oriented programming.
But I'm still upset when object oriented programming replaced structured programming.

lorensims
Автор

Insightful Uncle Stef! Composition is better than inheritance.

sadiqsalah
Автор

Functional programming is already here, but it didn't replace OOP. Object oriented features won't go away from programming languages, but FP style will predominate in codebases since it outputs shorter cleaner code.

v_iancu
Автор

Functions are object object orientated. They're classes. They instanciate when called.

Whether a procedure is programmed or not, object orientated designs operate procedurally.

The big picture of object orientated programming is procedural programming using functions.

godofgodseyes
Автор

Love FP and OOP, however, functional component is replacing class component in React. so, FP is trending looks like in some particular area obviously. many project teams converting class to function approach as I know.

digitnomad
Автор

I’m a functional programming enthusiast, but whenever somebody asks me this question I always reply “will AutoCAD ever replace concrete?”.

OOP and FP are completely orthogonal. OOP answers the question “how do I split up my programs into smaller chucks”, ie it deals with modularization. FP deals with the single pieces of your program, and answers the questions “how do I manage my program’s side effects?” and “how can I make my program time-unaware?” .
OOP and FP can, and should coexist.

The opposite of functional programming is not OOP, but rather imperative programming.

I’ll make a brief code example (in C#) to illustrate this

1) Imperative
class Car {
public Car() {
IsOn = false;
}
public bool IsOn { get; private set; }
public void Start() {
if(IsOn) {
throw new Exception(“Already On”);
} else {
IsOn = true;
}
}
}

2) Functional

class Car {
public Car() {
IsOn = false;
}

private Car(bool IsOn) {
IsOn = IsOn;
}
public bool IsOn { get; }
public Validation<string, Car> Start()
=> IsOn ? Fail<string, Car>(“Already On”)
: Success<string, Car>(new Car(true));
}

Both examples are object oriented, however the first one is imperative (mutates state and throws an exception) while the second one is functional.

gigik
Автор

Good programmers learn both and use the one language with the best ecosystem for given problem.

hurolinci
Автор

not really, problem is most schools teaches procedural /oop languages.
which is why functional is not people's first language, the adoption/transition is very low.
most people with choose similar C-style language

muyvin
Автор

With C# you can write any type of code - those with mutable state and those with immutable state.
If you have mutable state, well you wrote the code, don't put it on OOP.

barryblack
Автор

FP is way better then OOP but everything for the web is made in an OOP way so there is that. It's dominant because it was first. That is all. I started learning Haskell. No way this is ever going to beat a mature webstack in terms of popularity. But FP certainly is something to consider when you're building a very large application (big domain) or you have to deal with very complex If you're going to build something that on a regular basis will be expanded with new features then FP is also a very good candidate. The biggest advantages of FP are maintainability, write time speed and bugs being detected much easier and faster. An example: applications written in Haskell are about 2 to 10 times shorter in lines of code. Conclusion: OOP is a mistake but it works good enough to stay dominant on the web until the end of times.

paulholsters
Автор

Not a fan of OOP and I doubt if OOP will be dominant in the future.

kaiserphemi
Автор

There are two separate questions being addressed here: "Will functional programming replace OOP?" and "*Should* functional programming replace OOP?"

I feel like the first one is easy to answer: No. There is way too much momentum in OOP languages like Java and C++ and a bunch of other languages for OOP to completely die. If nothing else, the graphics API (metal) for macOS is fully object-oriented, meaning that OOP will be sticking around indefinitely.

I feel like the latter question is more interesting, and in my opinion, the answer is "yes" for one simple reason: concurrency. Obviously you can do concurrency in Java and C++ and whatnot, but it's *monumentally* easier if you use a pure (or pure-ish) functional language like Haskell or Clojure or F#. Like, night and day. Instead of mucking with locks and mutexes and weird reader patterns that are hard to follow and *extremely* difficult to debut, you can largely just replace your loops with parallel equivalents, and due to your functions being pure, *the result does not change*, and this guarantee is enforced by the compiler, so you have a reasonably strong assurance that if your code compiles, it will work (not always, but a stronger guarantee than you'd get with Java). For the cases where you *do* have to use something more elaborate than "replace loops with parallel loops", Haskell gives you an extremely nice form of lock management called "Software Transactional Memory" (STM). This is just magic, and it's complicated but I largely view it as "garbage collection for locks" in the sense that you can largely ignore any annoying concurrency quirks.

The type systems of functional programming languages tend to also be substantially better than the crap that we call a type system in Java. The haskell type system is arguably a simple proof machine, and you get a metric ton of guarantees about the correctness of your application if the typechecker says its good. It's not perfect, but coding is hard enough without introducing additional uncertainty.

thomasgebert
Автор

another informative video Stefan. I will add my 2 cents. I started out as a functional programmer working on data bases in the early 90s. Which in my experience and in my area most functional programing is gear for those job that have huge data bases or need to perform many functions on the data. If you are writing an app that has a strong (UI)user interface and heavy graphics, you will usually write it in an OOP language. Many languages can do both. Java, C#, Object C/Swift, and Python. Some more OOP some more functional.
Functional will not replace OOP they provide two types of solutions for business needs.

But if you want to learn a truly functional language F# (Functional) by .Net (Microsoft) which is popular use a lot in web development using Xamarin, there are others out there.

kirktheprofessorfindley
Автор

Data will push for functional programming. Concurrency will push for functional programming. The need will grow, and functional programming will grow with them.

wdeath
Автор

What about lambda notation? Why does it keep coming? What good does it do? I find it making the code harder to read.

MuhazamCSE
welcome to shbcf.ru