Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
beggarboy250115din a 🥜🐚
Prodecural: do one thing or flow of actions with fixed start and end point
Funxtional: perform granularized bits of code in no concrete order or amount
this is a loose formulation for understanding purposes.
monkeyboy72615d@beggarboy . I think your concise explanation was a bit too concise. Procedural and functional are not mutually exclusive. Indeed, at the end of the day, all applications are procedural to some degree. Some more so than others with Skyrim and the Google maps API as examples of things near opposite ends of the spectrum. The question itself is a little odd in that it's more appropriate to compare functional vs. OOP and procedural vs. event driven.
norman70688355315dYou tell your program in:
functional- what to do
procedural- how to do
RememberMe1018414dIn procedural code you organise things as a bunch of procedures or lists of "do this, do that" steps. You generally end up specifying everything and it generally has a lower level feel.
Functional programming's distinctive feature is that functions are everyday values and they can be passed to functions and returned from functions just like other values. Eg. a standard "map" function takes a collection to work over, like a list, and a function to apply to every element in that list. That's classic functional programming. Other features generally associated with FP are purity (functions tend to avoid side effects), organising code around function composition, and laziness (code does minimum required), though none of these are actually necessary for FP.
They're not really mutually exclusive. Heck you can mix them as you want. You can do OOP style dynamic dispatch in Haskell (existential types), FP in C, and procedural in Java, they're just not based around it.
devapsarl2614dLet's say: a function is a litle procedural program.
U can build up ur understanding starting from here
norman70688355314d@RememberMe Reply to your longer comment- that's what I said before :D
Functional is sub of declarative. You tell w h a t to do- cast that integer to string, select from db, etc.
Procedural is sub of imperative. You are giving series of instructions h o w to proceed. Loops, if/else etc.
Your Job Suck?
Take a quick quiz from Triplebyte to skip the job search hassles and jump to final interviews at hot tech firms
Get a Better Job
corjaantje29And the most useless function of the year award goes to...
chrisrhymes10At my old job we hired a junior developer. Turned out the junior knew more than all of us. I learnt a lot from...
Mba3gar11Dear junior programmers: You will never get hired from what you learned at University You have to study on y...