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. Imperative, declarative, functional, and... ???

Imperative, declarative, functional, and... ???

Scheduled Pinned Locked Moved The Lounge
csharptutorialquestionphpcom
35 Posts 22 Posters 0 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.
  • M Mark_Wallace

    Interrogative. Ve ask the qvestions.

    I wanna be a eunuchs developer! Pass me a bread knife!

    M Offline
    M Offline
    Marc Clifton
    wrote on last edited by
    #9

    Mark Wallace wrote:

    Interrogative.

    Heh - there might actually be something there. ;) Marc

    Reverse Engineering Legacy Applications
    How To Think Like a Functional Programmer
    My Blog
    Computational Types in C# and F#

    1 Reply Last reply
    0
    • M Marc Clifton

      Was wondering this morning what other programming paradigms there are (I'm putting OO into the imperative category.) For example, I think "asynchronous" might fit into this list, but what it really begs for is a definition of what this list actually is - I'm not happy with the word "paradigm". So, I have two questions - first, can you come up with a more concrete definition of this list, rather than just the word "paradigm", and what else do you think fits into this list? You could look at this post[^] but I don't think it contributed anything much to the actual question (though lots of good discussion on the 3 paradigms), and one person replied "Are there more exotic types? Not yet." Really? Not yet? Hmmm.... Marc

      Reverse Engineering Legacy Applications
      How To Think Like a Functional Programmer
      My Blog
      Computational Types in C# and F#

      E Offline
      E Offline
      Ennis Ray Lynch Jr
      wrote on last edited by
      #10

      imperative, declarative, functional, scripting, and OO. At least that is from the list in 1301.

      Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost

      M 1 Reply Last reply
      0
      • C Chris Meech

        What would make another type, exotic? Seems like an attempt to promote something because of it's properties rather than it's usefullness. As far as another word for paradigm, it could be replaced with philosophy, dogma, religion(?). I'm too much of a practical programmer, so it's just another word that won't help solve things. Do people really look at a problem and decide what paradigm would best be used to solve it? :)

        Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

        M Offline
        M Offline
        Marc Clifton
        wrote on last edited by
        #11

        Chris Meech wrote:

        Do people really look at a problem and decide what paradigm would best be used to solve it?

        Possibly, but I think what people mostly do is figure that out somewhat unconsciously. For example, if I need some sort of iteration that's not not provided by the framework, I might realize that I could generalize the iteration because I don't know what the next guy might want to do with each element, so I write a functional representation of the iteration that lets the programmer pass in a lambda expression, and I've just implemented a "functional paradigm" solution. Or I use an enumerable and a yield and I've implemented an imperative paradigm. Or I leverage an IoC framework to glue the handler to the iterator through an XML statement an lo, I have implemented a declarative paradigm. So, without really putting much thought into it, I end up with some implementation, and I'm going to contend that when we look at a problem, yes, we really should decide what paradigm would be best to solve it, we really should be more conscious about the decision process. Marc

        Reverse Engineering Legacy Applications
        How To Think Like a Functional Programmer
        My Blog
        Computational Types in C# and F#

        1 Reply Last reply
        0
        • M megaadam

          Oh there are many many more... http://en.wikipedia.org/wiki/Programming_paradigm[^] I for one have no quarrels with the word "paradigm". I think it is wise to remember that the paradigms cover different aspects (as well as properties) of a programming language. In other words paradigms are not necessarily mutually exclusive. (And BTW, there is no direct correlation between OO and imperative, according to the above link.)

          Life is too shor

          M Offline
          M Offline
          Marc Clifton
          wrote on last edited by
          #12

          megaadam wrote:

          http://en.wikipedia.org/wiki/Programming_paradigm[^]

          :doh: Thanks! That was a case of my not seeing the forest for the trees. Marc

          Reverse Engineering Legacy Applications
          How To Think Like a Functional Programmer
          My Blog
          Computational Types in C# and F#

          1 Reply Last reply
          0
          • C c2423

            According to wikipedia OO should be considered as it's own paradigm, as should machine code and assembly language. It would depend on whether you want to class all of those as imperative or not. Technically they are, but is that really a useful definition? My thinking is that it depends what level of abstraction you want to consider: if you want to talk in the abstract it's hard to think of other major classes of language, but equally when describing the properties of a language by paradigm it's better to have more words than fewer, even if OO and procedural boil down to being imperative - I could say "C# is an imperative language, and so is machine code" but it's so abstract as to not give any useful information, whereas if I said "C# is an OO language, and machine code is an imperative language" then this at least starts to hint at the fundamental differences in how you would use both. And I don't particularly have a problem with the word paradigm in this context as to me it would imply a different way of thinking about how to structure the program, which taking OO vs structured programming as an example makes sense as, even though they are both still imperative, you think about their structure differently.

            M Offline
            M Offline
            Marc Clifton
            wrote on last edited by
            #13

            c2423 wrote:

            My thinking is that it depends what level of abstraction you want to consider:

            Good points, all. I appreciate the feedback! Marc

            Reverse Engineering Legacy Applications
            How To Think Like a Functional Programmer
            My Blog
            Computational Types in C# and F#

            1 Reply Last reply
            0
            • E Ennis Ray Lynch Jr

              imperative, declarative, functional, scripting, and OO. At least that is from the list in 1301.

              Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost

              M Offline
              M Offline
              Marc Clifton
              wrote on last edited by
              #14

              Ennis Ray Lynch, Jr. wrote:

              imperative, declarative, functional, scripting, and OO.

              Thanks! Marc

              Reverse Engineering Legacy Applications
              How To Think Like a Functional Programmer
              My Blog
              Computational Types in C# and F#

              1 Reply Last reply
              0
              • M Marc Clifton

                Was wondering this morning what other programming paradigms there are (I'm putting OO into the imperative category.) For example, I think "asynchronous" might fit into this list, but what it really begs for is a definition of what this list actually is - I'm not happy with the word "paradigm". So, I have two questions - first, can you come up with a more concrete definition of this list, rather than just the word "paradigm", and what else do you think fits into this list? You could look at this post[^] but I don't think it contributed anything much to the actual question (though lots of good discussion on the 3 paradigms), and one person replied "Are there more exotic types? Not yet." Really? Not yet? Hmmm.... Marc

                Reverse Engineering Legacy Applications
                How To Think Like a Functional Programmer
                My Blog
                Computational Types in C# and F#

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

                I really don't like adding OO to that list (as many suggest), because it's really just an extension to imperative programming (sometimes also used with functional) - an over-hyped way to organize imperative code that is the evolution of structured programming, or when used with functional, well, I don't even know what it's supposed to do in that case. If OO was a programming paradigm, then UML would be a programming language.

                1 Reply Last reply
                0
                • M Marc Clifton

                  Was wondering this morning what other programming paradigms there are (I'm putting OO into the imperative category.) For example, I think "asynchronous" might fit into this list, but what it really begs for is a definition of what this list actually is - I'm not happy with the word "paradigm". So, I have two questions - first, can you come up with a more concrete definition of this list, rather than just the word "paradigm", and what else do you think fits into this list? You could look at this post[^] but I don't think it contributed anything much to the actual question (though lots of good discussion on the 3 paradigms), and one person replied "Are there more exotic types? Not yet." Really? Not yet? Hmmm.... Marc

                  Reverse Engineering Legacy Applications
                  How To Think Like a Functional Programmer
                  My Blog
                  Computational Types in C# and F#

                  G Offline
                  G Offline
                  GenJerDan
                  wrote on last edited by
                  #16

                  Subjunctive "The program would work better if it had been written by someone competent."

                  No dogs or cats are in the classroom. My Mu[sic] My Films My Windows Programs, etc.

                  1 Reply Last reply
                  0
                  • M Marc Clifton

                    Was wondering this morning what other programming paradigms there are (I'm putting OO into the imperative category.) For example, I think "asynchronous" might fit into this list, but what it really begs for is a definition of what this list actually is - I'm not happy with the word "paradigm". So, I have two questions - first, can you come up with a more concrete definition of this list, rather than just the word "paradigm", and what else do you think fits into this list? You could look at this post[^] but I don't think it contributed anything much to the actual question (though lots of good discussion on the 3 paradigms), and one person replied "Are there more exotic types? Not yet." Really? Not yet? Hmmm.... Marc

                    Reverse Engineering Legacy Applications
                    How To Think Like a Functional Programmer
                    My Blog
                    Computational Types in C# and F#

                    M Offline
                    M Offline
                    Michael Bergman
                    wrote on last edited by
                    #17

                    Functional and imperative are the same thing. You only really do three things in programming. Ever. 1. Set a value. 2. Test a value. 3. Jump to an instruction that sets or tests a value. Noop doesn't count. I come from a lit background so I think in these terms: The declarative: this sets a value. It could be memory, registers, whatever. If you remember, back in the 1980's you would change what was on the monitor by simply writing directly to video memory using BASIC PUT. The inquisitive: this tests a value. If could be an if, for, or while statement. The imperative: go do something. Jump to another instruction. Everything is in the present tense. I've always kind of wondered how we could introduce the past and future tense into programming. To incorporate the past tense in to programming you would have to know the past states of objects to effectively use it. To incorporate the future tense you have to predict the states of objects. A past tense algorithm could help to predict trends of objects. Also, the modal verb "may" is interesting for statistical analysis. For example:

                    may i = 1;

                    Well, i may be 1, or it may not be one. Or...

                    may i = {1, 3, 5, 7, 9};

                    where i may be initialized to any of the values in the set. I think, if we also look at other language structures, we might come up compelling structures to use in describing algorithms. However, it still all comes back down to the basics of setting, testing, and jumping and you just can't get away from that.

                    m.bergman

                    For Bruce Schneier, quanta only have one state : afraid.

                    To succeed in the world it is not enough to be stupid, you must also be well-mannered. -- Voltaire

                    In most cases the only difference between disappointment and depression is your level of commitment. -- Marc Maron

                    I am not a chatbot

                    R 1 Reply Last reply
                    0
                    • M Marc Clifton

                      Was wondering this morning what other programming paradigms there are (I'm putting OO into the imperative category.) For example, I think "asynchronous" might fit into this list, but what it really begs for is a definition of what this list actually is - I'm not happy with the word "paradigm". So, I have two questions - first, can you come up with a more concrete definition of this list, rather than just the word "paradigm", and what else do you think fits into this list? You could look at this post[^] but I don't think it contributed anything much to the actual question (though lots of good discussion on the 3 paradigms), and one person replied "Are there more exotic types? Not yet." Really? Not yet? Hmmm.... Marc

                      Reverse Engineering Legacy Applications
                      How To Think Like a Functional Programmer
                      My Blog
                      Computational Types in C# and F#

                      B Offline
                      B Offline
                      BobJanova
                      wrote on last edited by
                      #18

                      I agree with some other people that OO should be a separate category. Also, event-driven (or message based which is the same thing) is missing from your list.

                      1 Reply Last reply
                      0
                      • M Marc Clifton

                        Was wondering this morning what other programming paradigms there are (I'm putting OO into the imperative category.) For example, I think "asynchronous" might fit into this list, but what it really begs for is a definition of what this list actually is - I'm not happy with the word "paradigm". So, I have two questions - first, can you come up with a more concrete definition of this list, rather than just the word "paradigm", and what else do you think fits into this list? You could look at this post[^] but I don't think it contributed anything much to the actual question (though lots of good discussion on the 3 paradigms), and one person replied "Are there more exotic types? Not yet." Really? Not yet? Hmmm.... Marc

                        Reverse Engineering Legacy Applications
                        How To Think Like a Functional Programmer
                        My Blog
                        Computational Types in C# and F#

                        T Offline
                        T Offline
                        TheGreatAndPowerfulOz
                        wrote on last edited by
                        #19

                        I think paradigm, while somewhat overused, is entirely appropriate. _paradigm: A typical example or pattern of something; a model_ Along with others, I would say OO is a separate paradigm and often uses the other paradigms. On the other hand, it's all machine, binary language in the end, so it's all different ways of expressing the same thing.

                        If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams
                        You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering.-Wernher von Braun
                        Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein

                        1 Reply Last reply
                        0
                        • M Marc Clifton

                          Was wondering this morning what other programming paradigms there are (I'm putting OO into the imperative category.) For example, I think "asynchronous" might fit into this list, but what it really begs for is a definition of what this list actually is - I'm not happy with the word "paradigm". So, I have two questions - first, can you come up with a more concrete definition of this list, rather than just the word "paradigm", and what else do you think fits into this list? You could look at this post[^] but I don't think it contributed anything much to the actual question (though lots of good discussion on the 3 paradigms), and one person replied "Are there more exotic types? Not yet." Really? Not yet? Hmmm.... Marc

                          Reverse Engineering Legacy Applications
                          How To Think Like a Functional Programmer
                          My Blog
                          Computational Types in C# and F#

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

                          How about these: Pedantic: Standards it may implement, but work it may not. Aromatic: It may work, but there are these smells coming from the great steaming pile of source. Pragmatic: Ugly, but it works.

                          Software Zen: delete this;

                          G 1 Reply Last reply
                          0
                          • M Marc Clifton

                            Was wondering this morning what other programming paradigms there are (I'm putting OO into the imperative category.) For example, I think "asynchronous" might fit into this list, but what it really begs for is a definition of what this list actually is - I'm not happy with the word "paradigm". So, I have two questions - first, can you come up with a more concrete definition of this list, rather than just the word "paradigm", and what else do you think fits into this list? You could look at this post[^] but I don't think it contributed anything much to the actual question (though lots of good discussion on the 3 paradigms), and one person replied "Are there more exotic types? Not yet." Really? Not yet? Hmmm.... Marc

                            Reverse Engineering Legacy Applications
                            How To Think Like a Functional Programmer
                            My Blog
                            Computational Types in C# and F#

                            J Offline
                            J Offline
                            jsc42
                            wrote on last edited by
                            #21

                            ... understandable! I think that 'understandable' languages are definitely in the 'exotic' future scope and that no programming idioms are currently expressive enough to enable ordinary people to comprehend what they are about without putting in a lot of effort. P.S. A game to play on marketing people and management: insist the word 'paradigm' is pronounce par-ard-did-gem (or par-arg-dig-dem) and that they have been conned by other buzzword merchants into saying pah-ad-ayem. Also, insist that a 'quantum' is the smallest possible unit of energy so their beloved phrase 'quantum shift' means an almost negigible amount of change.

                            1 Reply Last reply
                            0
                            • G Gary Wheeler

                              How about these: Pedantic: Standards it may implement, but work it may not. Aromatic: It may work, but there are these smells coming from the great steaming pile of source. Pragmatic: Ugly, but it works.

                              Software Zen: delete this;

                              G Offline
                              G Offline
                              grralph1
                              wrote on last edited by
                              #22

                              I like where you are coming from Gary. It is really quite funny, however, I think that I have used all of your methods or paradigms at some point. The aromatic is probably the worst, as it hangs around, and comes wafting back to haunt you. Pragmatic is the best as long as you don't have to update it in 5 years time. I have not and have never been a pedant. ...and never will be.

                              1 Reply Last reply
                              0
                              • G gavindon

                                Chris Meech wrote:

                                Do people really look at a problem and decide what paradigm would best be used to solve it?

                                Probably not, but they might need to write something that sounds fancy for the boss :)

                                Beauty is in the eye of the beer-holder Be careful which toes you step on today, they might be connected to the foot that kicks your butt tomorrow. You can't scare me, I have children.

                                R Offline
                                R Offline
                                RafagaX
                                wrote on last edited by
                                #23

                                Naa, bosses rarely understand such things, i could say that i'm going to program using a functional declarative object oriented paradigm, and they never will catch what it means. :)

                                CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

                                G 1 Reply Last reply
                                0
                                • C Chris Meech

                                  What would make another type, exotic? Seems like an attempt to promote something because of it's properties rather than it's usefullness. As far as another word for paradigm, it could be replaced with philosophy, dogma, religion(?). I'm too much of a practical programmer, so it's just another word that won't help solve things. Do people really look at a problem and decide what paradigm would best be used to solve it? :)

                                  Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

                                  R Offline
                                  R Offline
                                  RafagaX
                                  wrote on last edited by
                                  #24

                                  Chris Meech wrote:

                                  Do people really look at a problem and decide what paradigm would best be used to solve it?

                                  Sometimes i do, but i always end up on OO. :-D

                                  CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

                                  E 1 Reply Last reply
                                  0
                                  • R RafagaX

                                    Chris Meech wrote:

                                    Do people really look at a problem and decide what paradigm would best be used to solve it?

                                    Sometimes i do, but i always end up on OO. :-D

                                    CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

                                    E Offline
                                    E Offline
                                    Erik Rude
                                    wrote on last edited by
                                    #25

                                    RafagaX wrote:

                                    Chris Meech wrote:

                                    Do people really look at a problem and decide what paradigm would best be used
                                    to solve it?

                                    If you've got a hammer - every problem looks like a nail!

                                    S 1 Reply Last reply
                                    0
                                    • R RafagaX

                                      Naa, bosses rarely understand such things, i could say that i'm going to program using a functional declarative object oriented paradigm, and they never will catch what it means. :)

                                      CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

                                      G Offline
                                      G Offline
                                      gavindon
                                      wrote on last edited by
                                      #26

                                      ah but that's the beauty of it see.. they wont understand it, but being the boss they cant admit that. :laugh:

                                      Beauty is in the eye of the beer-holder Be careful which toes you step on today, they might be connected to the foot that kicks your butt tomorrow. You can't scare me, I have children.

                                      1 Reply Last reply
                                      0
                                      • M Marc Clifton

                                        Was wondering this morning what other programming paradigms there are (I'm putting OO into the imperative category.) For example, I think "asynchronous" might fit into this list, but what it really begs for is a definition of what this list actually is - I'm not happy with the word "paradigm". So, I have two questions - first, can you come up with a more concrete definition of this list, rather than just the word "paradigm", and what else do you think fits into this list? You could look at this post[^] but I don't think it contributed anything much to the actual question (though lots of good discussion on the 3 paradigms), and one person replied "Are there more exotic types? Not yet." Really? Not yet? Hmmm.... Marc

                                        Reverse Engineering Legacy Applications
                                        How To Think Like a Functional Programmer
                                        My Blog
                                        Computational Types in C# and F#

                                        S Offline
                                        S Offline
                                        satovey
                                        wrote on last edited by
                                        #27

                                        Are you thinking of the usage definition of paradigm or the actual definition of paradigm? What's the difference? Usage definition is an implied definition based on how a word is used. A good example is the use of the word might: Might is actually the past tense of may, however, it is mostly used to imply possibility. "It might come to that." "May I enter?" - "You might." In this proper use permission is presumed to have already been given. What specifically do you not like about the word paradigm? Actual definition from: http://dictionary.reference.com/browse/paradigm?s=t[^] par·a·digm    [par-uh-dahym, -dim] Show IPA noun 1. Grammar . a. a set of forms all of which contain a particular element, especially the set of all inflected forms based on a single stem or theme. b. a display in fixed arrangement of such a set, as boy, boy's, boys, boys'. 2. an example serving as a model; pattern.

                                        1 Reply Last reply
                                        0
                                        • E Erik Rude

                                          RafagaX wrote:

                                          Chris Meech wrote:

                                          Do people really look at a problem and decide what paradigm would best be used
                                          to solve it?

                                          If you've got a hammer - every problem looks like a nail!

                                          S Offline
                                          S Offline
                                          satovey
                                          wrote on last edited by
                                          #28

                                          "If you've got a hammer - every problem looks like a nail!" I have read that statement many times and I think it is quite inaccurate. My point of view is due to the fact that if I have a hammer and I am frustrated, the hammer being readily at hand is what I am gong to use to smash the thing that is frustrating me. And that is regardless of whether it looks like a nail or not. On the other hand, if I have a baseball bat handy, I'm a gonna swing and hit whatever it is that is frustrating me. If I have a gun, I will shoot whatever is frustrating me. This is why I do not keep a hammer handy (meaning I generally forget where I last placed it), and own neither bat nor gun. To date: I have smashed anything with the hammer unless it is in fact a nail, and have not utilized a bat or gun to eliminate those things that frustrate me. I realize that constantly misplacing a hammer wastes time in finding it when one has nails to hammer, however, the time it takes to find the hammer tends to be enough time for me to settle down and decide that smashing the computer will not solve the problem. :-O Besides that, I don't do a lot of hammering these days so it's all good for me. :-D

                                          P E 2 Replies 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