Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Functional Programming

Functional Programming

Scheduled Pinned Locked Moved The Lounge
questionfunctionallearning
39 Posts 25 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Forogar

    Was Forth a fourth generation language? Can you imagine interpreting a job requirement that says what is needed is, "Go, Forth and Javascript".

    - I would love to change the world, but they won’t give me the source code.

    G Offline
    G Offline
    Gary Wheeler
    wrote on last edited by
    #20

    Forogar wrote:

    "Go, Forth and Javascript"

    Why does my brain read that as "Go :elephant: yourself"?

    Software Zen: delete this;

    1 Reply Last reply
    0
    • C CodeWraith

      Functional programming is loved mainly by eggheads, like my boss who has a degree in mathmatics. He also loves VB, so take that as a reference however you like. Long ago, I was tortured with LITHP and Scheme by egghead professors. Twice. That's enough for the rest of my life and I can easily live with not ever having to see that stuff again. Maybe aliens from Ceti Alpha love it, but I also suspect it's the reason why Ceti Alpha Six exploded.

      I have lived with several Zen masters - all of them were cats. His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.

      R Offline
      R Offline
      Ron Nicholson
      wrote on last edited by
      #21

      I'm sure Star Fleet used Functional Programming and that's why they thought Ceti Alpha Five was Six. Just thinkin outloud. :doh:

      Jack of all trades, master of none, though often times better than master of one.

      1 Reply Last reply
      0
      • N Nand32

        Who's yet to open the book on this? This is one such topics where the whole world starts doing something about, but I keep it safe in my todo list. Just a quick question from the dummies perspective. 1. Will functional programming make all the OOAD concepts obsolete or it can get along well with OOAD? 2. What's your take? You like it?

        G Offline
        G Offline
        Gary Wheeler
        wrote on last edited by
        #22

        I've always had the impression that functional programming was academia's pathetic attempt to wrest computing back to the 1960's era notion of high priests in attendance upon their gods, with the academics in the role of the priests. They can't earn a living doing programming themselves, so they're trying to keep the rest of us from doing so as well. :elephant: them.

        Software Zen: delete this;

        1 Reply Last reply
        0
        • F Forogar

          Was Forth a fourth generation language? Can you imagine interpreting a job requirement that says what is needed is, "Go, Forth and Javascript".

          - I would love to change the world, but they won’t give me the source code.

          S Offline
          S Offline
          stoneyowl2
          wrote on last edited by
          #23

          Actually, Forth did what it was designed for reasonably well. Unlike MUMPS, which was developed by (hold your breath) *doctors*! And the VA STILL uses it. One of the only 'languages' that allowed you write a complete program in a string variable (using user input) and execute it immediately. One nice thing was there were only 25 reserved words, each one starting with a different letter (Z was for anything that did not fit) and a program was allowed use just the first letter for the reserved word.

          A human being should be able to change a diaper, plan an invasion, butcher a hog, navigate a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects! - Lazarus Long

          M 1 Reply Last reply
          0
          • N Nand32

            Who's yet to open the book on this? This is one such topics where the whole world starts doing something about, but I keep it safe in my todo list. Just a quick question from the dummies perspective. 1. Will functional programming make all the OOAD concepts obsolete or it can get along well with OOAD? 2. What's your take? You like it?

            D Offline
            D Offline
            Dr Walt Fair PE
            wrote on last edited by
            #24

            F# works quite well with the rest of .NET, so it gets along well with OOAD, It's a native .Net language and interesting to play with. The first step in learning effective F# is to forget everything you know about programming unless you learned Prolog! Learned Prolog, way back when Borland had a Prolog compiler and IDE, I found F# was similar in some respects with OOP added on. CQ de W5ALT

            Walt Fair, Jr.PhD P. E. Comport Computing Specializing in Technical Engineering Software

            1 Reply Last reply
            0
            • N Nand32

              Who's yet to open the book on this? This is one such topics where the whole world starts doing something about, but I keep it safe in my todo list. Just a quick question from the dummies perspective. 1. Will functional programming make all the OOAD concepts obsolete or it can get along well with OOAD? 2. What's your take? You like it?

              B Offline
              B Offline
              Bob Nadler
              wrote on last edited by
              #25

              Here's a must-read: Object-Oriented Programming — The Trillion Dollar Disaster [^]. Clearly, an OOP-hater, but he does make many good points (also read through the comments). The take-away for me was this: "Trying out Functional Programming will make you a better developer."

              Bob on Medical Device Software [^]

              1 Reply Last reply
              0
              • N Nand32

                Who's yet to open the book on this? This is one such topics where the whole world starts doing something about, but I keep it safe in my todo list. Just a quick question from the dummies perspective. 1. Will functional programming make all the OOAD concepts obsolete or it can get along well with OOAD? 2. What's your take? You like it?

                M Offline
                M Offline
                Member 9167057
                wrote on last edited by
                #26

                Tried to get into "real" FP a couple times but I haven't found a single tutorial starting with something FP does better than, let's say, OOP or even procedural. On the other hand, functional concepts are creeping into languages like C# where I've been using them extensively. Heck, even variable.dosomething(parm).dosomethingelse(someotherparm) is, as a matter of fact, functional.

                1 Reply Last reply
                0
                • N Nand32

                  Who's yet to open the book on this? This is one such topics where the whole world starts doing something about, but I keep it safe in my todo list. Just a quick question from the dummies perspective. 1. Will functional programming make all the OOAD concepts obsolete or it can get along well with OOAD? 2. What's your take? You like it?

                  B Offline
                  B Offline
                  Bob1000
                  wrote on last edited by
                  #27

                  The difference is OOAD is for the pragmatic real world. Functional programing is for the theoretical. ok maybe not 100% true, just seems that way!

                  1 Reply Last reply
                  0
                  • S stoneyowl2

                    Actually, Forth did what it was designed for reasonably well. Unlike MUMPS, which was developed by (hold your breath) *doctors*! And the VA STILL uses it. One of the only 'languages' that allowed you write a complete program in a string variable (using user input) and execute it immediately. One nice thing was there were only 25 reserved words, each one starting with a different letter (Z was for anything that did not fit) and a program was allowed use just the first letter for the reserved word.

                    A human being should be able to change a diaper, plan an invasion, butcher a hog, navigate a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects! - Lazarus Long

                    M Offline
                    M Offline
                    Member 12775823
                    wrote on last edited by
                    #28

                    MUMPS is an old, procedural language and I was not thrilled to have to learn it in 2001. However, the database Cache is BLAZING fast and works very well for storing Medical data. Fortunately, I no longer have to code MUMPS, but I still respect the speed.

                    1 Reply Last reply
                    0
                    • L Lost User

                      for mine it's something everyone talks about as the new sliced bread, and later all but disappears into some niche, like lisp or prolog, or even forth.

                      Message Signature (Click to edit ->)

                      U Offline
                      U Offline
                      User 8413112
                      wrote on last edited by
                      #29

                      I did a large project in Forth back in the '80s. Never again. Forth is a write only language

                      S M 2 Replies Last reply
                      0
                      • F Forogar

                        Was Forth a fourth generation language? Can you imagine interpreting a job requirement that says what is needed is, "Go, Forth and Javascript".

                        - I would love to change the world, but they won’t give me the source code.

                        B Offline
                        B Offline
                        bleahy48
                        wrote on last edited by
                        #30

                        Forth was supposed to be a fourth generation programming language but the computer that it was developed on would only allow 5 character file names.

                        1 Reply Last reply
                        0
                        • R realJSOP

                          Functional programming preceeded OOP. OOP is (I think) a better idea. Turbo Pascal started out as a functional language. Fortran is a fucntional lanugage. C is a functional language. Javascript is not functional, but it is a functional language. Visual Basic was a functional language. My problem with the sudden interest (by people who don't matter) in functional programming is that everyone thinks OOP should be abandoned, or that functional crap should be injected into the OOP paradigm. These people are, for lack of a better term, retards.

                          B Offline
                          B Offline
                          bleahy48
                          wrote on last edited by
                          #31

                          From Wikipedia: 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 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. Fortran and C are not functional programming languages. Having functions does not make a language functional. And one of the reasons for renewed interest in functional languages is they have certain advantages when trying to parallelize programs.

                          L M 2 Replies Last reply
                          0
                          • U User 8413112

                            I did a large project in Forth back in the '80s. Never again. Forth is a write only language

                            S Offline
                            S Offline
                            sasadler
                            wrote on last edited by
                            #32

                            Not if you do proper decomposition and give your words readable names. I worked in forth for many years and my old code is still very readable today. Also, good commenting helps!

                            1 Reply Last reply
                            0
                            • U User 8413112

                              I did a large project in Forth back in the '80s. Never again. Forth is a write only language

                              M Offline
                              M Offline
                              mischasan
                              wrote on last edited by
                              #33

                              I've heard the "write-only" complaint about Perl and APL, too ... I've seen horrible Perl; but also have seen huge Perl apps that were a cakewalk to understand. APL worked very well at giving you the whole algorithm in a concise picture. Ask Morgan-Stanley how "K works, for people who are under serious coding pressure. I'd say it's a matter of developer community and praxis, without which every language can be a bomb. Language (syntax) requirements never prevent all the bad things you *can* do. Check out Linus Torvalds' comments on why not C++, referenced tangentially here (nevermind the flamebait) [medium.com/codeiq/object-oriented-programming...](https://medium.com/codeiq/object-oriented-programming-the-trillion-dollar-disaster-️-92a4b666c7c7\])

                              1 Reply Last reply
                              0
                              • B bleahy48

                                From Wikipedia: 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 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. Fortran and C are not functional programming languages. Having functions does not make a language functional. And one of the reasons for renewed interest in functional languages is they have certain advantages when trying to parallelize programs.

                                L Offline
                                L Offline
                                Lost User
                                wrote on last edited by
                                #34

                                Sounds like "static methods" are a step in the "functional" direction then. And enumerators.

                                The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.' ― Confucian Analects

                                1 Reply Last reply
                                0
                                • B bleahy48

                                  From Wikipedia: 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 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. Fortran and C are not functional programming languages. Having functions does not make a language functional. And one of the reasons for renewed interest in functional languages is they have certain advantages when trying to parallelize programs.

                                  M Offline
                                  M Offline
                                  MSBassSinger
                                  wrote on last edited by
                                  #35

                                  From what you wrote, it sounds like the use of deterministic and non-deterministic functions. How does functional programming differ from traditional OOP where the developer knows they are writing a deterministic or non-deterministic function within a class?

                                  B 1 Reply Last reply
                                  0
                                  • R raddevus

                                    I've thought about this same thing myself quite a bit. OOAD (OOP) is a tool. Functional Programming is a tool. Most of the time you read things about how one tool or the other solves all problems. But that is the same as thinking that a hammer solves all problems. There are concepts from both things that can make your code better. OOP / OOAD is really a way of organizing your code. It is not really more than that. But authors had to write books and those books had to meet a minimum length of pages so it exploded! Functional Programming (FP) did the same thing: exploded in publication. But again, Functional Programming contains some concepts that are novel and helpful. The one big concept from FP is the idea of "No Side Effects". Managing state while concurrent processes are running is a challenge. FP has exploded because concurrent processing has exploded in hardware. Suddenly you need a way to guarantee that you're not overwriting what another "thread" of execution is doing. So, as we consider Foundational Concepts of programming paradigms we see that the two (OOP and FP) can be very useful together. One for organizing your code. The other for managing state in a concurrent environment. Here's a very nice article I just googled that talks about Core Functional Programming Concepts[^]

                                    M Offline
                                    M Offline
                                    MSBassSinger
                                    wrote on last edited by
                                    #36

                                    Quote:

                                    FP has exploded because concurrent processing has exploded in hardware. Suddenly you need a way to guarantee that you're not overwriting what another "thread" of execution is doing.

                                    How is this any different than writing multithreaded code where the developer knows the scope of the variables used? I use the Task Parallel Library in .NET a lot, and never have any trouble with one thread/task affecting variables in another.

                                    R 1 Reply Last reply
                                    0
                                    • M MSBassSinger

                                      From what you wrote, it sounds like the use of deterministic and non-deterministic functions. How does functional programming differ from traditional OOP where the developer knows they are writing a deterministic or non-deterministic function within a class?

                                      B Offline
                                      B Offline
                                      bleahy48
                                      wrote on last edited by
                                      #37

                                      Deterministic function always return the same value from the same input. That is not the same as a function having no side effects.

                                      1 Reply Last reply
                                      0
                                      • N Nand32

                                        Who's yet to open the book on this? This is one such topics where the whole world starts doing something about, but I keep it safe in my todo list. Just a quick question from the dummies perspective. 1. Will functional programming make all the OOAD concepts obsolete or it can get along well with OOAD? 2. What's your take? You like it?

                                        D Offline
                                        D Offline
                                        David Sherwood
                                        wrote on last edited by
                                        #38

                                        Language Vb.net and C# have Linq which provides these OOP languages with FP. Switching from a OOP language to an FP language is another mater. I keep saying my next project I'll write in F#. but my designs always wind up using OOP constructs so I stick with my OOP language and use all of its FP features.

                                        1 Reply Last reply
                                        0
                                        • M MSBassSinger

                                          Quote:

                                          FP has exploded because concurrent processing has exploded in hardware. Suddenly you need a way to guarantee that you're not overwriting what another "thread" of execution is doing.

                                          How is this any different than writing multithreaded code where the developer knows the scope of the variables used? I use the Task Parallel Library in .NET a lot, and never have any trouble with one thread/task affecting variables in another.

                                          R Offline
                                          R Offline
                                          raddevus
                                          wrote on last edited by
                                          #39

                                          It’s not necessarily a whole lot different. Functional programming “automatically” supports structures and methods that support this type of thing a bit more easily than procedural or OOP languages. It’s also a way of thinking that is a part of FP. And, you can definitely do the same things with different tools. That is what confuses newer devs the most, I think. Of course some languages and some language types make certain things harder or easier.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups