19

Functional, Declarative, and Imperative Programming

Can we keep this question on the site please?

Update:

I'm researching a short essay for University, and when I placed the question in criteria in google this question came up third (after wikipedia). I have found it more useful than wikipedia, as it gave many different ways of explaining the subject matter. The large variety of answers gave differing perspectives to help grasp the subject matter.

Now it's clear that the question is too broad for the site. It would be a shame for the information to be lost. There is one long canonical type answer, that will be lost and would be possibly well suited to documentation. With all the effort that has gone into the answers it would be better not to delete it off the site. That is why I suggested an historical lock.

It's a shame to remove content that was once on topic, where the information within the answers are encapsulated within the answers, i.e. not link only answers. This is, in this case unique information on the internet. Original content created by these users that is to be unaccessible to the general public.

As someone working and studying in the field. I find that SO serves two uses. To understand and find quick fixes to programming blocks or speed bumps. To get resources for study. It is the latter that can be onerous, particularly when writing essays and it helps to have a variety of information to read through from the succinct to the more detailed from a resource that I trust. I trust SO more than I trust wikipedia. Why should we be deleting resources that are helpful to students? I think for people learning or studying it would be good to access these answers.

If it's considered off topic to stay, perhaps an historical lock?

related:

This question is on topic:

What is the difference between declarative and imperative programming

Screenshots of Shelby's answer bellow, as it was deleted and couldn't be viewed with rep<10k (Click "Run" to see it, a little bit too tall to be directly included in the post)

<img src="https://i.sstatic.net/o11Ik.png" style="width:100%" />

27
  • 20
    I voted to reopen it Do you honestly think that the question isn't Too Broad? On what basis are you making that decision? The answers to the question pretty clearly demonstrate that the closure is absolutely merited.
    – Servy
    Commented Feb 1, 2017 at 22:16
  • 6
    @Servy I think it's a valuable question. What more can I say. I summed it up in my post. You do not have to agree.
    – user3956566
    Commented Feb 1, 2017 at 22:19
  • 15
    So you're incapable of providing any support for your position at all? You can't provide even a single reason for why that question isn't too broad, despite tons of evidence to suggest that it's too broad? If you have no more to say, and you haven't said anything at all, then that's about as unconvincing of an argument as you can present. You haven't summed anything up in your post that would explain why this question isn't too broad. If that question isn't too broad, than what would be?
    – Servy
    Commented Feb 1, 2017 at 22:22
  • 12
    @Servy I stated my reason. If you don't like it or don't agree with it, that's your choice, but if you refuse to acknowledge it, I don't know what else to say. I haven't given a paper on my reasons, it's short and succinct. Seems to me you're spoiling for a fight. As I cannot see why you can't understand what I've written.
    – user3956566
    Commented Feb 1, 2017 at 22:24
  • 5
    It has been superseded. Googling these terms, the Q+A is nowhere in sight and has excellent hits on other sites. It is not going to missed. If it gets deleted then SO users can vote to undelete it again. That's the way it works, the way it always worked, it is not somehow different just because you like it. Use a chat room to gather a posse, you are familiar with the concept. Commented Feb 1, 2017 at 22:24
  • 1
    FWIW whenever I link a relevant meta question into the SOCVR, as I do frequent there and this is relevant, the question is DOWNVOTED.
    – user3956566
    Commented Feb 1, 2017 at 22:28
  • 9
    It looks like you haven't actually read the post at all. It's got dozens of answers, many of which are very long, none of them provide a complete answer to the question (or even come close, they all touch a few basic points of the topic in the question and then stop). This is literally a textbook example of a Too Broad question. Again, like I said before, if this isn't Too Broad, what is? What do you think would be Too Broad, if this wouldn't be?
    – Servy
    Commented Feb 1, 2017 at 22:28
  • 3
    I don't think Hans' comment was abusive or bullying; the only part that seems pointed to me was the last sentence, which just references that you're a part of the SOCVR room and that maybe Hans feels sorely about that room's existence.
    – TylerH
    Commented Feb 1, 2017 at 22:44
  • 15
    I... Fail to see how if you come to a meta site to get something reopened, you potentially having to deal with disagreement is badgering or a popularity contest.... You think the question is valuable. Servy thinks it isn't.. He gives arguments for his position.... You throw your hands up in the air, yell abuse and run.... Is that really constructive discourse? :/
    – Patrice
    Commented Feb 1, 2017 at 23:13
  • 5
    I really don't like snide comments. I upvoted a couple of Servy's comments because I agree that the question is too broad, not because I was supporting the tone of the comments. Commented Feb 1, 2017 at 23:16
  • 6
    I don't want to make you feel bad. I just don't agree with you, and someone else already stated why I don't agree, regardless of how they said it, so I upvoted that instead of just saying it again. I would assume that's what others did as well. Commented Feb 1, 2017 at 23:16
  • 9
    I think it's definitely worth trying to keep Shelby's answer to that, and if we're about to throw all of it out anyway, I'm not opposed to doing quite a bit of surgery to get it in shape to remain (even with a historical lock applied). See my answer.
    – user50049
    Commented Feb 2, 2017 at 6:50
  • 9
    @YvetteColomb you're free to call out SOCVR but don't you think making the room responsible for the 18 down votes is a bit unbalanced, given the 15 up votes? Could it be that visitors vote on the content and not on who you are? And I personally would hate it when meta posts that are advertised in the room would get instant up votes.
    – rene
    Commented Feb 2, 2017 at 8:14
  • 3
    @YvetteColomb ah, ok. without the correct context comments get misinterpreted, sorry about that. Thanks for clarifying.
    – rene
    Commented Feb 2, 2017 at 9:54
  • 2
    I was actually later embarrassed that my answer had so many upvotes, because I've since read a blog by the venerable Bob Harper that afair (no time to go look right now) seemed to concur with my sinking feeling that I had accomplished only handwaving with that answer. Yet in other cases I have answers which I think are unequivocally correct yet are hidden due to excessive downvotes. Thus the wisdom of the crowd is not always canonical. I really don't have a good proposal at this time of how to resolve this. This appears to be the imperfect nature of knowledge formation. Commented Feb 19, 2017 at 7:30

5 Answers 5

20

I'd like to keep Shelby's answer to the question; it would be an egregious waste to remove it. However .. I'm having a hard time wrapping around how to make the question lead into it in a .. slightly less broad way, and deciding which answers to prune.

So I say, let's keep it, even if it gets deleted today.

I'd appreciate any help in comments on pruning, and if anyone wants to take a stab at narrowing the question a bit, that would be helpful. Even if the question can't be made into something that wouldn't be closed today, I'd be happy to place a historical lock on it if we could narrow it just a tiny bit, and remove the misleading answers.

Yeah, kind of drastic surgery, but it sure beats losing all of it. So if we're about to throw it all out anyway, let's see if we can keep what's good?

30
  • It could be made to match the similar question, or a duplicate of it. stackoverflow.com/questions/1784664/…. It would be helpful though to get some mod assistance on the reopen and reclose for that. Or we could put the content into documentation.
    – user3956566
    Commented Feb 2, 2017 at 6:57
  • 1
    I'm up for it. By "mod assistance", @YvetteColomb , you mean an undelete followed by a temporary lock in case it gets deleted while it's being worked upon, I suppose?
    – duplode
    Commented Feb 2, 2017 at 7:09
  • 1
    @duplode to reopen and reclose it, if it's to be marked a dupe. I'm not sure about the editing. I could make an edit, but would need to read the questions thoroughly. I've finished my short essay (thanks to the question) so have some time to look at it later. I have horses to feed right now :D
    – user3956566
    Commented Feb 2, 2017 at 7:11
  • @duplode I've edited the question, have a look. The edit doesn't invalidate the answers.
    – user3956566
    Commented Feb 2, 2017 at 7:21
  • 1
    @YvetteColomb That's a start. I am quite sure the jQuery sub-question won't be missed either. I will come back to this later, once I have a second look at the answers from the point of view we are discussing here.
    – duplode
    Commented Feb 2, 2017 at 7:29
  • 1
    I'm working on pruning some of the answers now.
    – user50049
    Commented Feb 2, 2017 at 7:33
  • 1
    It seems like the question would be better off on the Software Engineering site, but I don't know their policy about broad questions.
    – Lundin
    Commented Feb 2, 2017 at 7:49
  • @Lundin Possibly, though Shelby's answer (the one we are primarily concerned about) has a theoretical bent that might make it less of a good fit there.
    – duplode
    Commented Feb 2, 2017 at 7:56
  • @TimPost So the top answer is gone now, as well as the obviously unhelpful ones -- that's good. I gotta go now; once I return (in a few hours) I will help with any pending adjustments.
    – duplode
    Commented Feb 2, 2017 at 7:57
  • 2
    @Lundin it would be a very poor fit over there for the same reasons as at SO. Recommended reading: What goes on Software Engineering (previously known as Programmers)? A guide for Stack Overflow
    – gnat
    Commented Feb 2, 2017 at 8:44
  • 2
    Tim this seems to be a reasonably close fit for collaborative lock but as far as I know it allows only for a single answer while question in question has two worth keeping (merging these two seems impossible because of char limit - their total length slightly exceeds 30K)
    – gnat
    Commented Feb 2, 2017 at 8:49
  • @gnat I know, I actually made a note of the use case for that lock to see if we could accommodate it in the future, but the historical lock is probably going to have to work for this one.
    – user50049
    Commented Feb 2, 2017 at 13:01
  • 3
    @MikeMcCaughan Because we should be extremely jealous of our content, in general, but especially content that gets so many views. I agree it's a bit of bending over backwards this time, but handling graceful deprecation of information is something that I positively have to work out this year, so it's actually a good exercise in everything something simpler is going to need to do through less effort. We're turning a page that quite a few people found from a 'meh' to a 'wow', I think it's worth it.
    – user50049
    Commented Feb 2, 2017 at 14:57
  • 2
    @TylerH its copy or reference to it already is somewhere here at MSO. Still, experience has shown that "master" copy should be at SE.SE: second answer over there tweaked for Math.SE folks was originally posted at their meta and deleted from there because they decided they don't want to keep it (they certainly have a right to decide so (even though their decision sucks:))
    – gnat
    Commented Feb 2, 2017 at 19:03
  • 2
    I will now have a go at trimming some more answers. Once I'm done, I will post a summary as an "answer" here, so that the changes can be easily reviewed (or reverted, if need be).
    – duplode
    Commented Feb 2, 2017 at 21:51
15

The second question would be too broad in that an explanation of each programming paradigm would be expected, which would require explaining all of the programming paradigms. This includes but is not limited to: procedural, structured, object-oriented, aspect-oriented, event-driven, and automata-based.

Wikipedia has a good—if incomplete—article on programming paradigms


The third question should be its own question:

Which of the major programming paradigms are supported by JavaScript?


The first question:

What is:

  • Functional programming
  • Declarative programming
  • Imperative programming

is actually three separate questions:

Now, while definitions of things are wonderful, definitions alone usually aren't very helpful in understanding a topic. For that you would need comparisons:


All together:

While all of the questions contained in this question might arguably make good questions on their own, together they are too broad for the format.

11
  • The reason I thought it was a good question, is that comparisons are often made between them. Thanks for your answer :)
    – user3956566
    Commented Feb 1, 2017 at 22:30
  • @YvetteColomb of all the questions asked in that question, the implied question (listed at the end here) is the most interesting and useful, and is the one you hint at in your comment. Note that it has already been asked: What is the difference between declarative and imperative programming
    – user4639281
    Commented Feb 1, 2017 at 22:44
  • It is clear the question is too broad and should not be reopened. Do you think it is worthy of an historical lock?
    – duplode
    Commented Feb 1, 2017 at 22:58
  • 1
    @duplode possibly, but given that the topics are reasonably covered elsewhere, I don't think it is necessary,
    – user4639281
    Commented Feb 1, 2017 at 23:09
  • @TinyGiant thanks for that linked question, it was very useful for my studies :)
    – user3956566
    Commented Feb 2, 2017 at 6:59
  • I think you are being too lenient calling those phrases "questions". There's no difference between them and "Define X" enunciated.
    – Braiam
    Commented Feb 2, 2017 at 18:47
  • Wikipedia would be a good place for this content if they had a reference... those answers didn't have a reference.
    – Braiam
    Commented Feb 2, 2017 at 23:05
  • 1
    @braiam Programming paradigms might also make a good Documentation topic, if Documentation wasn't so fubar.
    – user4639281
    Commented Feb 2, 2017 at 23:12
  • Presuming you get a tag for paradigms (I'm not going to click that link, my heart isn't ready)
    – Braiam
    Commented Feb 2, 2017 at 23:24
  • 1
    @Braiam there is also programming-paradigms. I don't think these questions are inherently off-topic, but this one as it was asked is.
    – user4639281
    Commented Feb 2, 2017 at 23:51
  • @TinyGiant yeh I agree with it being a good doc topic. I also agree, it's difficult to traverse O.O
    – user3956566
    Commented Feb 3, 2017 at 1:31
2

Tiny Giant's answer explains why this question should not be reopened. Here, I will focus on what there is in the answers that might justify an historical lock. Since I don't know the guidelines and precedents about locks all that well, I will mostly stick to considerations about how valuable the answers are.


The interesting part of the question is the comparison between functional, declarative and imperative programming. Tiny Giant has shown that most of the sub-questions that might be extracted from this broad comparison are already covered elsewhere in Stack Overflow. I say "most" specially because of the declarative vs. functional contrast, which is the sub-question I will focus on in what follows.

As Tiny Giant highlights, the first answer claims that:

Functional programming is a subtype of declarative programming

I don't believe that is a very helpful explanation. In fact, I don't like that answer very much: a definition of functional programming that doesn't mention functions is, at best, unsatisfactory. (I should also mention that the silliness in the paragraph about jQuery doesn't exactly help its case, but we can edit that out if the question ends up staying.)

Moving on to the second answer: it is long, dense and has quite a bit of useful information. It also has an interesting aspect: the author, Shelby Moore III, engages in what Wikipedia calls original research. That is made clear by this passage...

Any other attribute cited for declarative programming, e.g. the citation from 1999 used by Wikipedia, either derives from RT, or is shared with imperative programming. Thus proving that my precise definition is correct.

...and also by their second answer to the question, in which they propose a second definition of declarative programming that would be "superior to the one I provided in my prior answer", and contrasts it with two blog posts of Robert Harper (one of them argues that "declarative programming" is an ill-defined concept, while the other proposes an alternative definition of his own). It is also worth noting that a number of other answers by the same author link to the two here.

The third answer is similar to the first one. I believe it does well in stating right off the bat that "There's not really any non-ambiguous, objective definition for these"; however, it is even less helpful when it comes to functional programming (choice quote: "Functional - a subset of declarative languages that has heavy focus on recursion"), and so you might rather see the opening statement as cover for an unsatisfactory answer.

The fourth answer, my favourite one of the bunch, does a good job of explaining how functional programming and declarative programming are related. It also does so in neatly accessible form and language.

I haven't looked closely at the other answers, but there doesn't seem to be anything that would justify an historical lock.


It is also a good idea to, like Tiny Giant did, look at the other side of the (Meta) question and consider whether there are other questions that cover declarative vs. functional satisfactorily. There are quite a few alternatives, which I ordered according to how much I like their answers:

I don't think any of them is quite as nice as the fourth answer here (except perhaps for the SE.SE one, which addresses a slightly different question).


As I said before, I don't know locking policy very well, so I won't hazard any conclusive judgement (it would be nice to hear from you all in the comments). On the one hand, the assortment of existing answers is rather confusing, and the top answer isn't all that great. On the other hand, deletion would remove at least two very good answers. (There also might be a case focusing on preserving the original research in Shelby Moore III's answers, but I genuinely have no clue about what the usual practice is in such cases.)

31
  • 4
    Though I don't mind downvotes, I must say it was surprising to see one within one minute of posting this rather long and quite non-judgemental answer. I would really like hearing from the downvoter -- given how quickly it was cast, I guess either some specific sentence is a red flag or there is something catastrophically wrong with the overall approach I used here.
    – duplode
    Commented Feb 2, 2017 at 3:52
  • This question is not historical... is not a monument... it's rotting. It's smelly a piece of dark history of SO, that is best left forgotten. The only reason the historical lock was established was in those rare cases were the information wasn't available elsewhere. You see that vision each time CM talks about locks. Don't miss what it's obvious. There are better resources that accurately and precisely answer this question in all their possible point of view. Let that question lay the eternal rest, that SO has the right to forget the dark times of olde.
    – Braiam
    Commented Feb 2, 2017 at 3:56
  • 6
    ` it's rotting. It's smelly a piece of dark history of SO, that is best left forgotten.` @Braiam ridiculous way to describe it.
    – user3956566
    Commented Feb 2, 2017 at 4:06
  • 1
    Too often it's about personalities and humour on here and if that's not met, the votes won't follow
    – user3956566
    Commented Feb 2, 2017 at 4:06
  • 2
    @Braiam "Don't miss what it's obvious" -- I expicitly chose to fence-sit because I wasn't certain about exactly how high the bar for historical locks is set, i.e. it wasn't obvious to me. That said, I feel this answer offers considerable ammunition if you eventually need to argue against locking it.
    – duplode
    Commented Feb 2, 2017 at 4:19
  • Well, then don't argue. I will reject anything that frames rotting garbage for the quality of the site. If you want, it's better to do not put forward in a position you aren't willing to defend or even agree with. I don't do it. Every time someone's do it it ends with a freaking locking. If you aren't 1100% sure of what you want, it's preferably to let nature take its course instead.
    – Braiam
    Commented Feb 2, 2017 at 4:52
  • @YvetteColomb Read my profile. I'm honest with myself. You don't agree with it, that's your call, but I will always call things as they are, I do not use "alternative facts" or whatever is common these days. It's trash in my view, and will be trash.
    – Braiam
    Commented Feb 2, 2017 at 4:54
  • 8
    I would actually hate to lose Shelby's answer to that question. Trying to wrap my head around making the question better pair with it, and just doing quite a bit of pruning instead of deleting the whole thing.
    – user50049
    Commented Feb 2, 2017 at 6:28
  • 1
    @YvetteColomb I think your question makes a clearer and stronger case now, though I'm not taking sides just yet (the top answer being rather iffy bothers me quite a bit). Tim Post's suggestion of pruning the whole thing to preserve the interesting answers might just work.
    – duplode
    Commented Feb 2, 2017 at 6:34
  • 1
    @YvetteColomb "I hope you don't mind" -- Not in the slightest :)
    – duplode
    Commented Feb 2, 2017 at 7:01
  • 1
    @Veve I'll provide a screenshot and paste it into the question
    – user3956566
    Commented Feb 3, 2017 at 1:18
  • 1
    "OO vs FP | imperative vs FP" a better title would be "How can a comparison between apples and oranges make sense?"
    – user4639281
    Commented Feb 3, 2017 at 1:47
  • 1
    Again it seems like it would make a better documentation topic than Q&A, if documentation wasn't fubar.
    – user4639281
    Commented Feb 3, 2017 at 2:20
  • 1
    (Thanks for making the screenshots for Veve, @YvetteColomb -- between the length of the answer and my current screen size they would have been a bit of a pain to prepare here :))
    – duplode
    Commented Feb 3, 2017 at 2:39
  • 1
    (I believe you meant Shift+F2; in any case, I had no idea that command existed -- thanks a lot, @Veve !)
    – duplode
    Commented Feb 3, 2017 at 17:58
0

This is a summary of the changes being made to the answers to make them match the slimmed-down question, so that the changes are easier to review. Feel free to use this "answer" to keep track of your own edits as well.


Question: Functional, Declarative, and Imperative Programming (subquestions 2 and 3 removed)

Subquestion 2 is the "more exotic types" one; subquestion 3 is the jQuery one.

Answers touching on subquestions 2 and 3

https://stackoverflow.com/a/8357604 (minor change; former #2 answer; Shelby's main answer)

https://stackoverflow.com/a/602457 (major change; former #3 answer)

https://stackoverflow.com/a/602640 (major change)

Answers touching on subquestion 2

https://stackoverflow.com/a/11838125 (major change)

Answers touching on subquestion 3

https://stackoverflow.com/a/603151 (minor change)

https://stackoverflow.com/a/15382180 (minor change; Shelby's other answer)

Answers covering only subquestions 2 and 3 (deletion candidates?)

https://stackoverflow.com/a/17407748

Answers covering only subquestion 2 (deletion candidates?)

https://stackoverflow.com/a/15912635


(Note I didn't list the answers deleted outright earlier today, at the beginning of the cleanup.)

-6

Why can't we just ask several questions instead of trying to cram it all together into a single Q&A? That's one of the two solutions the too broad questions has, no? Either, narrow the scope or separate into several questions. Why isn't fixing the content an option?

Apparently nobody is interested in put into it any amount of effort into fixing the question for good. And well, if we aren't going to fix it, why are we bickering when others that saw this and decided that it lowers the quality of the site so they decided to just nuke it from orbit?

You want to keep content on the site, fix it. We know we can, and Shog demonstrated we are capable of doing just that, but it seems that it is something we do only when it's very clear that if we don't the solution will be a perma-deletion. It saddens me to no end that we have to use the stick to move our collective arses into doing what we should be doing instead, being proactive into curating the content.

So, meta need a pose:

Figure out what questions those answers answer and propose them in a way that 1) it complies with SO policies 2) is information not available elsewhere

Defining what functional, declarative and imperative programming is the work of a book, or a dictionary. Tiny seems to have found two questions on the site that seems to ask about two of them (closed as too broad, of course). So that's out. The question about paradigms of JS, needs to be fleshed out, or in. As it's the first thing someone is going to ask is "why don't you read some paradigms and find when JS seems to follow them". As you can see, there would be several issues if we just take the question without elaborating.

Remember, good questions are those that motivate explaining the "whys" and "hows". That is what we should strive here, but I presume we aren't that interested in those topics that we could think about a good question.

1
  • While I don't agree with the entirety of this answer, I must say it is not at all a bad idea to consider what can be done to bring a question into line before reaching for an exceptional instrument such as an historical lock. Working on the question we are discussing here has been a positive experience. Even if in the end we don't make it all the way towards making it reopenable, the progress so far sure beats both locking it in the state it was at first and outright deletion. (In this case, we should thank Tim for the proverbial kick up the backside.)
    – duplode
    Commented Feb 3, 2017 at 17:15

You must log in to answer this question.