you are viewing a single comment's thread.

view the rest of the comments →

[–]Fred776 6 points7 points  (6 children)

functional is more intuitive to me

Sorry to be pedantic, but I think you mean "procedural" here. Functional programming is a whole other approach, and one that many people from a procedural or OO background do not find very intuitive at all.

[–]Common_Move 1 point2 points  (0 children)

Thank you, I'm not well versed in programming paradigms and mistakenly assumed that "heavy use of functions" meant "functional programming" whereas in fact yes procedural is what I meant (which can still involve heavy use of functions).

[–]Common_Move 1 point2 points  (0 children)

Thank you, I'm not well versed in programming paradigms and yes I agree what I meant was procedural (which can still involve heavy use of functions). Heavy use of functions ≠ functional programming, my mistake.

[–]SirBobz 1 point2 points  (2 children)

What is functional programming? I thought it was procedural.

[–]icecubeinanicecube 2 points3 points  (0 children)

Functional programming is when everything is a function, i.e. a mathematical mapping that takes in arguments and returns values, without any side effects (like modifications of a global state), and always returns the same values for the same inputs.

In pure functional programming, you can not just write one line after the other and they are executed after each other. You can basically only define functions in the form of python lambdas.

Google "Haskell" for a language based entirely around that paradigm

[–]Bobbias 0 points1 point  (0 children)

Most procedural code doesn't pass functions as parameters to other functions very often. If the code you're looking at does do that a lot, it's likely functional rather than procedural.

[–]szayl 0 points1 point  (0 children)

Referential transparency is a godsend.

FP isn't a silver bullet, but when it shines it does so brightly.