# Do we really need the “programming” tag?

There are a lot of questions now tagged with , about a wide range of issues from graphics to core. In my opinion this tag is similarly vague and superfluous as the (see here). As in Mathematica, everything is an expression, similarly one can say that everything is about programming, if it is not about typesetting, notebooks, formating, or other features of the front-end. Since the amount of front-end questions is considerably smaller than non-front-end ones, it makes sense to rather use the (or other formatting-specific tags) to specify those rather than tagging every other question as programming. Not to mention that most of the front-end questions attract answers that demonstrate how to deal with the front-end in a programmatic way.

Therefore I would suggest removing the tag, or at least limiting to the programming-language-aspect-related questions (i.e. typing, metaprogramming, etc.). Though to be honest, I could easily reclassify each example under the tag's wiki into either , , or the respective data structures (, , etc.) which would be more specific and hopefully more useful.

Update: the tag wiki is now updated according to the guidelines defined below.

I would think that we need a tag to cover two things not covered by other tags.

• Larger programming projects, beyond a single function, where doesn't fit because, for example, the code isn't in a package and the question isn't specifically about package-related issues (i.e. context).
• Philosophical type question about programming practice.

As examples of the latter I present:

Also, I wouldn't know how else to tag this one on iteration of a function.

• I can only agree with this, and I think it nicely fits Leonid's and others' ideas about the tag. Added it to the wiki. – István Zachar May 28 '12 at 9:22
• +1 - very good points! I missed these in my answer, but I totally agree - this describes another facet of it. – Leonid Shifrin May 29 '12 at 15:08

I think we need it, to separate strictly programming questions from those about FrontEnd, Mathematica set up and administration, etc (of course, I must disclose that I am an interested party for this tag :)). Saying that we don't need it is like saying that we can't define what Mathematica programming is.

That said, I can see why it disturbs you, because we currently don't have more specific guidelines as to which questions are appropriate to tag as . I would think, that the main reason for this is that this tag is often more appropriate to be used after the question received one or several answers, because it is not always clear a priori that answering a given question would involve non-trivial programming challenges.

So, my suggestion is to tag a question as question in case if best / representative answers to that question involved non-trivial programming efforts. Such questions do not necessarily have to be restricted to those whose formulation implies their strictly programming nature. For example, some questions on visualizations often receive answers which have beautiful and interesting code. Also, for some questions which look like programming questions but end up being answered by, e.g., a straight-forward call to a built-in function, the tag could perhaps be removed after the fact.

To summarize the main idea of this answer, I believe that there are useful tags which however often can be properly assigned to the question only after it has received good answers, and I think that tags belongs to this category. This implies a somewhat more complex tagging procedure, where the tags are reviewed after the question has been satisfactorily answered, but it looks like for many questions this is happening already anyway. Let's keep in mind that the purpose of tags is to simplify and improve search, and it is not required that we always use all proper tags ahead of time.

EDIT

While @Istvan correctly criticized my description as subjective, I will try to make a shorter summary. I think that the question can be tagged as question, if it's code and code of representative answers contain any of the following:

• Large (more than, say, 20 lines, and often several functions) amount of Mathematica code, which serves its purpose, in the sense that it can not be easily reduced to fewer lines without missing some of the defining properties of the solution (e.g. efficiency or generality)
• Implementation of reasonably generic new functionality, which can be used in (many) more situations than the current problem.
• Implementation of interesting algorithms and / or data structures
• Good example of program design, where by splitting a problem into right sub-problems and using appropriate tools to "glue" it together, an extensible and modular design is achieved.
• Interesting new abstractions or instructive use of some known abstractions (e.g. linked lists, OO-style, strong types, etc, etc)
• Interesting and possibly novel uses of language constructs. In particular, using certain combinations of them to achieve things which are not easy to achieve by other means.

As already mentioned, this is still a subjective description. However, I still think that such categorization is possible. To put it short, any nice piece of code which achieves something not easily obtained by gluing a few built-in functions together and adds to one's "personal library of good programming examples" should qualify. Another possible definition: anything which can not be obtained by pure "plug and play" experimentation performed by an average beginner or intermediate-level user who happens to have read all Mathematica help, tried / understood all examples and has a photographic memory. :)

• I can agree with you on that there are certainly programming and non-programming-type questions, though I still only have a very vague idea about what should be under programming. You mention e.g. "non-trivial programming efforts", but I'm not sure I understand that, or at least I don't know how to define it. I have nothing against the tag itself, but perhaps someone who has a better understanding of (or has the hots for) this tag should post here a more clear-cut wiki-specification than the present one. – István Zachar May 25 '12 at 13:32
• @IstvánZachar I think, one can measure "non-trivial programming efforts" roughly by lines of code, elegance (it is easy to generate lots of ugly procedural code where much shorter and better alternatives exist), and smart algorithms - provided that either much shorter solutions using built-ins is not obvious or there are other reasons which justify the longer top-level code. This is still subjective, of course. One possible criteria is to pick the best answer and ask yourself: does this (code) look obvious and easy in retrospect, or are there some non-trivial ideas which make it possible. – Leonid Shifrin May 25 '12 at 13:38
• @IstvánZachar Another class of cases which I would classify as "programming" are those where the answers achieve some non-trivial goal by utilizing a combination of language features and techniques, which is in some way novel, while the separate ingredients may be well-known and not so interesting taken separately. – Leonid Shifrin May 25 '12 at 13:41
• Yes, I still find this approach (triviality) highly subjective, even in retrospect, especially when one has to write a short guideline for others on how to use the given tag. While you are giving here valid factors, I noticed that you deliberately avoid providing such a concise definition of the tag. I don't want to start any kind of crusade against this tag, but I simply cannot see the logic behind it, and therefore it fails to be a good classifier (at least for me). When it comes to retagging I am as clueless as any newcomer, so I want to rely on the wiki. – István Zachar May 25 '12 at 13:57
• @IstvánZachar Ok, it is a tough one. I tried to make a shorter description, but it still remains admittedly subjective. I don't view it as necessarily a bad thing though, in this particular case. – Leonid Shifrin May 25 '12 at 14:43
• I never used this tag (never retagged much), because like István, I found it extremely vague. Your bullet list makes it somewhat more clear, but still quite broad. But there's another question: will people use the tag 'correctly'? Is the name self-explanatory enough that the questions tagged with it will really cluster around a common (if broad) theme? Looking at some of the recent questions tagged programming I'm worried this is not the case. We could retag manually, but it's just too big a burden. The fact that both I and István were a bit confused about how this should (cont.) – Szabolcs May 25 '12 at 15:13
• be used shows that the current name for the tag might be a bit too vague to be effective. What I'm saying is that while it's worthwhile to group questions of the type you describe under the same tag, I'm concerned that this is not really easy to do in practice---the main problem being that the name is not self-explanatory and also very general. People will keep consistently mistagging, some regulars won't know how to correct. I'd say more than half of the currently tagged recent questions don't really fit your description of what should be tagged programming (the bullet list above). – Szabolcs May 25 '12 at 15:14
• Here's a screenshot of the currently tagged recent questions.. I posted it because I'm going to remove this tag from some of the questions now. After reading your answer, I'm still not confident to add the tag, but at least now I can remove it when it's clearly appropriate. – Szabolcs May 25 '12 at 15:20
• @Szabolcs "The fact that both I and István were a bit confused about how this should be used shows that the current name for the tag might be a bit too vague to be effective" - well, OTOH, I consider myself mostly active / competent in M programming, and the tag does correctly reflect that (if I compare the score to other tags I am active in), so in some ways, it is effective, at least from my perspective. And yes, people mistag, and we should IMO retag after the fact, since, as I tried to make a point in my answer, programming seems to belong to the tags which are easier to use ... – Leonid Shifrin May 25 '12 at 15:28
• @Szabolcs ... after the question has been aswered. " We could retag manually, but it's just too big a burden" - well, to me, this is not the problem of the programming tag per se - this is a problem of the tagging system as it exists on SO, since it is less than adequate and will anyway be of a very limited use if not augmented by some manual community efforts. – Leonid Shifrin May 25 '12 at 15:33
• @Leonid The reason I didn't really add/remove this tag before is that I wasn't sure how it is meant to be used. Could you give a few example from the last 5-10 questions, and show that: yes, this question should clearly be tagged, or no, this one shouldn't have this tag. For example, do you agree that this question shouldn't have it? – Szabolcs May 25 '12 at 15:33
• @Szabolcs I think it (the question you linked to) should have it, because at least one of the answers (Brett's) shows an implementation of a new reasonably generic functionality which can not be reduced to just gluing a couple of built-ins, plus nice programming techniques (overloading functions, Hold-wrappers). In other words, my list unambiguously answers that it should have it. Perhaps, once we accumulate really a huge pile of questions under programming, we could go through them and retag, introducing more specific tags. But I don't think this time has come yet. – Leonid Shifrin May 25 '12 at 15:37
• @Szabolcs: Thanks, you've removed all those occasions which made me frustrated. Everyone: I have now updated the tag wiki, please feel free to roll back/modify if you don't agree. – István Zachar May 25 '12 at 15:40
• @Leonid: I'm not sure if the presence of a specific insightful answer is enough to justify a tag for the whole thread. People who want to know how the ProgressBar works probably wouldn't even recognize the subtlety (I didn't). This tag now seems more like a very clever way of introducing a (personal) bookmarking system (which we all lack) :) – István Zachar May 25 '12 at 15:52
• @IstvánZachar Yes, it is a bookmarking system - albeit not very good one - what else the tags are? Originally, tags were introduced, or at least popularized to a very wide audience, in social bookmarking apps. As I mentioned in my answer and repeated in the comments above, some tags are like that - and I actually think that this is good. Not all tags IMO can be meaningfully assign to a question without seeing the answers. And people who need ProgressBar will search for ProgressBar, not programming, in the first place :) – Leonid Shifrin May 25 '12 at 15:59

While I have no firm opinion about the tag itself (it may well be superfluous given the more specific tags), I disagree that all non-frontend questions are about programming. For example, I wouldn't think a tag would be justified for any of the following non-frontend questions:

Facegrids at ticks

Finding real roots of negative numbers (for example, $\sqrt[3]{-8}$)

Unsaved notebook is crashing: is there any way I can save the state of the MathKernel before I kill it?

Pattern issues weird warning

Reduce/Solve an equation with symbols in powers

Why does LogLinearPlot sample its argument outside the specified domain?

Time-frequency analysis beyond wavelets

• Yes, of course you are right: front-end and programming would not be enough to classify any question (i.e. while they might be exclusive on each other they do not cover all possibilities), but I never stated anything like that, nor was it my main point. My problem so far was that I could do the very same thing you did here: building a negative definition, that is: what should not have the tag programming at all. – István Zachar May 25 '12 at 15:14
• @IstvánZachar: Well, a positive (but not completely sufficient) criterion for programming could be: Would it have been acceptable on Stack Overflow? – celtschk May 25 '12 at 15:19
• But I'm fairly sure that neither me, nor any newcomer (not coming from SO) would know the answer to that :) – István Zachar May 25 '12 at 15:22
• I agree with your categorization for all but the pattern warning one as patterns are integral to programming in mathematica. – rcollyer May 25 '12 at 15:29
• @rcollyer: But the question is not about programming, but specifically about the reason of that warning. Just like the question about the correct spelling of a certain English word is not a poetry question, even if that word is mostly used in poems. – celtschk May 25 '12 at 15:40