3

I'm asking this in relation to the following question, but I'm interested in the community's view in general principle, not just in relation to the example question mentioned.

Example: The question Where are JavaScript vars stored? asks, well, where JavaScript variables are stored. It asks the question using Lisp as a reference, describing how things work in Lisp, including at one point saying

Strangely, Lisp does not seem to have a parallel to a JavaScript var/let/const; in the sense of the example above (Does it? I'm not very familiar with Lisp...)

I answered the question about JavaScript, and another helpful person answered the question about Lisp.

Having a question asking how variables work in two largely-unrelated languages seems over-broad to me and I suggested to the OP that he separate the question so that rather than one conflated question with two completely unrelated answers, there would be two targeted questions with targeted answers. E.g., that the way SO works, one question should ask one question, not two.

The other answerer said he didn't think that was the case. As both of us have long experience with SO, I thought I'd ask the community what they thought.

Should the question about whether things work as described in the question in Lisp be moved to a separate question?

6
  • 4
    1,253,899 questions and this was never asked before?? Surely bringing in the Lisp comparison makes it interesting and unique. Nothing wrong with that. If you don't know Lisp then that's not a problem, two users know more than one. Commented Nov 12, 2016 at 15:26
  • @HansPassant: Whether it's a duplicate is irrelevant to the question above. (Answering your question: I don't recall seeing anything asking this specific question before, no. But true, it would be answered by a thorough explanation of closures.) Commented Nov 12, 2016 at 15:28
  • 1
    Well, of course it is relevant. If you hack the Lisp part off then it is a duplicate and you shouldn't have answered it. Do nothing. Commented Nov 12, 2016 at 15:31
  • 1
    @gothdo: Thanks for that -- I've corrected the wording, because I didn't actually mean it to be specific to a single question. Commented Nov 12, 2016 at 15:36
  • 1
    @HansPassant: Sorry, my original wording did very much give the impression I was asking narrowly about that specific question, which wasn't my intent. Gothdo edited in the specific-question tag which prompted me to realize the wording was off. Fixed. Commented Nov 12, 2016 at 15:39
  • 2
    @T.J.Crowder I've made a further edit to make it even more clear you're not singling out a single question - rather a general principle.. If you feel I've altered your intent etc... please feel free to rollback.
    – Jon Clements Mod
    Commented Nov 12, 2016 at 16:00

3 Answers 3

2

No.

Technical relationship

Actually, Javascript and Lisp are closely related. Javascript was largely inspired by a Lisp dialect called Scheme. See

https://brendaneich.com/2008/04/popularity/

I’m not proud, but I’m happy that I chose Scheme-ish first-class functions and Self-ish (albeit singular) prototypes as the main ingredients.

http://www.crockford.com/javascript/little.html

JavaScript has much in common with Scheme. It is a dynamic language. It has a flexible datatype (arrays) that can easily simulate s-expressions. And most importantly, functions are lambdas.

The basic idea of lexically scoped first-class functions in Javascript comes from Scheme. In the question it was asked how variables are introduced and where, in relationship to function scope.

A person is asking

The question has one important audience: the person asking.

Many questions will need a frame of current understanding, even if that is another programming language. It can help to make that frame clear to understand the question and answers - in both languages.

Programming language mechanisms: syntax, semantics, pragmatics

Many language mechanisms are independent from a certain programming language or are transported over time from one language to another. Helping people to understand the underlying mechanism will also help them to understand a particular language and the language designer's choices better.

What helps the person asking to understand his question and possible answers

The focus should be: what helps the person asking the question to understand the basic mechanism (here: introducing variables in a scope).

The focus should not be to narrow the scope of the answer as much as possible.

We should also not request to aim to write one definitive answer. What makes Stackoverflow attractive is the breadth of the expertise of various people providing added value by answering parts of a question. And yes, a question can have different parts.

Add perspective, where useful. Help the person asking by also addressing the frame of knowledge, which he used to formulate his/her question.

2
  • "We should also not request to aim to write one definitive answer" For the avoidance of doubt: I've never said otherwise. I've said a question shouldn't have completely unrelated answers to completely unrelated parts of it. It's absolutely useful for questions to have multiple answers coming at it from multiple perspectives, or even sometimes saying the same thing in different ways. Commented Nov 12, 2016 at 15:30
  • 2
    @T.J. Crowder: The parts are not 'completely unrelated'. See the question. The person wants to understand how variables are introduced in local scopes. He uses his current understand to try to understand how it works in Javascript. Commented Nov 12, 2016 at 15:31
0

Yes. It makes no sense to have two unrelated questions (where JavaScript variables are stored, and whether Lisp has a parallel to a JavaScript var/let/const) conflated into a single question. The two questions have different audiences, different answers, and are about different languages.

As it stands now, the question asks two different things, and has one answer answering one of the things it asks and not the other; and another answer answering the other and not the first one. It makes more sense to separate them.

-4

Not certain what the issue is? OP of the question is putting forth effort to learn different languages and the difference between these languages. Original question was tagged with both and .

If a viewer finds interest in a question, though from viewers perspective portions of question are confusing or exact expected result of answer is unclear, there are several available options; two of which include asking OP for clarification at comment; or posting an answer based on viewers interpretation of what OP is attempting to solve or learn.

There are no guarantees for absolute simultaneous mutual clarity as to a precise reasons OP asked question and interpretation of question by viewer.

Though, there is a strong probability that one or more of OP, viewers of question, and individual whom decides to answer question will learn.

The specific question does not appear to be too broad, here. Rather embodies the possibilities of broadening awareness of similarities and differences between languages; that is, communications.

Should this question How is asynchronous javascript interpreted and executed in Node.js? be separated into different questions due to topics within question body, and tags including , and libuv?

libuv is a multi-platform support library with a focus on asynchronous I/O. It was primarily developed for use by Node.js, but it’s also used by Luvit, Julia, pyuv, and others.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .