1

Here is how I come up to this question:

  • I want to know what are the differences between immutable and readonly
  • There is already a question asking about this on this site: Immutable vs Read-only vs Unmodifiable naming difference. However it (1) has a tag, and (2) is closed for being opinion-based
  • I want to make sure they are the same regardless of the language. I visit What topics can I ask about here? and see that asking the nature of the question is not explicitly said to be on-topic or off-topic. However I think it's closer to:
  • Explaining, writing or debugging code

than

  • Software development methods and practices
  • Requirements, architecture, and design

Since the former is off-topic, it seems that it should be off-topic as well.

So should this kind of question be on-topic?

I also see that we already discussed about this: Should algorithm and data structure concepts still be on-topic for Programmers now that Computer Science has launched?. However it's 11 year old, and one of the allowed topic it says is "algorithm and data structure concepts", which is not listed on the current accepted topic list anymore. So I think we may want to revisit this issue.

2 Answers 2

1

Let us start with the headline of your question:

Are questions about explaining some concept of computer science on-topic?

That depends heavily on the question. Software Engineering is more a craft than a science. Surely software engineers make use of achievements in computer science, as lots of other crafts and engineering disciplines use achievements from other sciences, but that does not make any CS topic an SWE topic, or vice versa. Of course, one can ask on this site how to apply a certain CS concept in a specific SWE situation, ideally a real-world situation, not something hypothetical.

Now let us compare this title to your question here:

I want to know what are the differences between immutable and readonly

To my understanding, "immutable" and "readonly" are programming terms with some loose definitions. Still there is no canonical definition which holds to any scientific standard - which makes them non-CS terms. So yes, a question about them is probably be a better fit for Softwarengineering.SE than for ComputerScience.SE.

However, if you decide to ask such a question, you better lower your expectations on getting a strict, clear-cut list of differences.

There is already a question asking about this on this site: Immutable vs Read-only vs Unmodifiable naming difference. However it (1) has a java tag, and (2) is closed for being opinion-based

Though the question had a good title, in the question's body, the asker made the error of putting focus on how to name their class, which is clearly opinionated.

But instead of looking for the comparison of two terms which you did not understand in full, why not start with one term first? Here is a question with an answer* explaining immutability:

What is an immutable object anyway? *(disclaimer: written by me)

After reading that Q&A, maybe half of your question about "immutability vs. readonly" was already answered, and you may consider to ask differently now?

Let me say a word on this:

I want to make sure they are the same regardless of the language

Sorry, but when you don't know the differences between such two terms, what makes you sure the differences are not language-specific? (In fact, I am sure the term "readonly" is highly language specific, since there are programming languages where readonly is a key word). So instead of presenting your bias on how you expect a certain answer to look like, better stay open for answers which may surprise you. That can enhance the perception of a question by our community a lot.

I also see that we already discussed about this: Should algorithm and data structure concepts still be on-topic for Programmers now that Computer Science has launched?. However it's 11 year old, and one of the allowed topic it says is "algorithm and data structure concepts", which is not listed on the current accepted topic list anymore. So I think we may want to revisit this issue.

I think this is a good idea to discuss this matter and may be worth a question on its own. The question cited was from the time when SWE.SE was still named "Programmers" and the site had a much broader focus. Today, whenever a question is algorithmic in nature, I am under the impression some usual suspects of our community pop up and downvote and close vote it quite thoughtlessly, without giving any further explanation. My opinion here is that we should keep such questions in case they have a practical real-world background, and are not just asked out of a scientifical research context.

6
  • I accept this answer as it breaks down my question better (plus a link for me to read more about immutable object).// You ask: "when you don't know the differences between such two terms, what makes you sure the differences are not language-specific?" Well, in the question I link someone say that it's the same. That's why I want to make sure they are the same regardless of the language. I thought that the phrase "I want to make sure" is enough to tell that I'm looking for answers may surprise me, not expecting a certain answer to look like. It seems not?
    – Ooker
    Sep 22, 2023 at 13:31
  • @Ooker: no, for me this phrase sounds like prejudice. And now wrote you expect the answer to be "both terms mean the same" - which is an even stronger bias.
    – Doc Brown
    Sep 22, 2023 at 14:05
  • which part I said I "expect the answer to be "both terms mean the same""?
    – Ooker
    Sep 22, 2023 at 14:14
  • @Ooker: "Well, in the question I link someone say that it's the same. That's why I want to make sure they are the same regardless of the language" - maybe I misunderstood something here. I guess what you really want is a language-agnostic description of the differences between "read-only" and "immutable", in case such a description exists.
    – Doc Brown
    Sep 22, 2023 at 14:24
  • hmm definitely I don't "expect the answer to be "both terms mean the same"" when I said that. This misunderstanding is weird to me. I guess what you really want is a language-agnostic description... — Yes, that's what I mean
    – Ooker
    Sep 22, 2023 at 14:29
  • @Ooker: ... actually, I guess when you would ask about "differences between read-only" and "immutable", the only answer you will get is "often, those terms are used synonymously, except when not".
    – Doc Brown
    Sep 22, 2023 at 14:35
3

There are plenty of questions tagged terminology asked here. Generally speaking, terminology questions as they relate to software engineering are on-topic here. However, there are plenty of terms and concepts that are not well-defined or that can easily be defined in existing glossaries, and those types of questions are likely to be closed - the former tends to be opinion-based with everyone sharing their interpretation of the term and concept with no way to objectively vote on correctness and the latter is closer to asking us to do a search and not share personal knowledge and experiences to solve a problem.

The question that you identify isn't asking about the concepts "immutable" and "read-only". The question is about naming a class. And naming is a highly subjective matter. Some languages may have some good practices or conventions for naming, but there's a lot of personal preference. It's definitely not a good example of a terminology question, either a good terminology question or a bad terminology question.

If you can come up with a concrete question about defining immutability and readability, you can try to ask it. If you want to ask about asking it, write up the full question and post it on Meta. Someone can tell you if it's on-topic here and, if not, if there's a better place to post it. And if it could use a little bit of work, you can get those clarifications, too. It's sometimes ok to ask about asking if you aren't sure.

Algorithms and data structures are also still on-topic, as they pertain to software design (or, I suppose, in some cases, requirements). However, with the launch of Computer Science, a good number of algorithm questions are better suited for there. That doesn't mean they are off-topic here, but we do want to encourage questions to be asked in the best possible place. Do avoid cross-posting the same question on more than one site, though - for questions that are on-topic on multiple sites, find the community of experts best suited to give you the kind of answer that would help you in your immediate need or tailor the question to the specific audience.

0

You must log in to answer this question.

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