IS Java Functional Programming? | What about Python?

preview_player
Показать описание
In computer science, functional programming is a programming paradigm—a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. It is a declarative programming paradigm in that programming is done with expressions or declarations[1] instead of statements. Functional code is idempotent: a function's return value depends only on its arguments, so calling a function with the same value for an argument always produces the same result. This is in contrast to imperative programming where, in addition to a function's arguments, global program state can affect a function's resulting value. Eliminating side effects, that is, changes in state that do not depend on the function inputs, can make understanding a program easier, which is one of the key motivations for the development of functional programming.
-wikipidea

#telusko #functional

Mistake @ 4:30
Correct code :
def calc():
def div(i,j):
if j==0:
j=1
return i/j

return div

abc = calc()

print(abc(4,0))
Рекомендации по теме
Комментарии
Автор

@Telusko
Hi Navin, Thanks for the video. I have one doubt though. In this @4:30, you are saying that calc function is returning another function div. But it is actually calling div inside calc itself, evaluating the value from div and then returning the value returned by div function, not div function itself. So, result = calc(20, 5); type(result) would return type as float, not the type function. I guess to return a function from a function, you'll have to define that function inside that function itself. Kindly let me know if my understanding is correct. Looking forward to your reply. Thanks!

sagarkate
Автор

nice...but I think div(i, j) inside calc() calculate the value first and output the result...it doesn't output the function. If function needs to be given as output then it should not be invoked there right?

kavinduvindikasomadasa
Автор

That is more useful for understanding the difference between OOP & FP.Thank you.

sachinthasampath
Автор

At 5:00, Line 13, you are not returning a function, rather calling div(i, j), and then returning that value. Passing and returning a function can't be the only basis for calling a language a functional programming language. There is more to it.

pragun
Автор

You are the best bro, for the first time i understand the difference between OOP and FP . Qudos bro

mamadouanne
Автор

2:58 This is what happens when you switch from Java to Python. 😂

Live-hhli
Автор

5:01, I think it's returning the value after evaluating the function not the function itself. if you were to return the function you would just return div. Correct me if I'm wrong. Just wanted to point it out. As always, I learned something new. Thank you! :)

IreshDissanayakaM
Автор

Sir can we use java for AI and machine learning (like weka, deeplearning4j framework)

siddhantagarwal
Автор

Can I go with any language like python at first because I think every language is same in concepts mostly but differ in difficulties. So is there any chronological order to learn languages. Please be honest to help me 🙏

isumitd
Автор

Which website you use for python programming

.devayaninandrekar
Автор

yes it's quit interesting to know that Java is also functional programming

ruchikagedam
Автор

Best teacher
My guru
Love from Maharashtra

smhere
Автор

great... worth watching this video..too many important things covered in very less time and nicely explained

shubhamraja
Автор

Thanks a lot for explaining this important concept in a easy way. Great effort.God bless you.

shalinisharma
Автор

As someone who has thus far worked with Python, Swift, and Go, just looking at Java fills me with overwhelming dread.

AWriterWandering
Автор

thank you very much sir for this video

saddamahmad
Автор

5:55 you are not returning a function. You still returning a value. Because you have called the div(i, j) function inside calc(i, j) function....

shahriarzaman
Автор

I have watching your python series. I have issue
In pycharm I have working in one module if I wants to run another I have to select the module in script path . Doing this often is annoying .
Is there any solution?

sudhakarsunil
Автор

Nice one
But
My question is why use interface
If we can work directly with method in
Except achieving multiple inheritance...

MDASIF-wock
Автор

plz help..!.which one i choose web development( spring, hibernate) or android development.(java)....or both. ..why?

harshtyagi
visit shbcf.ru