5

Unity3d uses (almost) only C# as the main programming language.

However lots of questions about [Unity3d] in my opinion don't really need / should maybe not be tagged [c#], because they refer to a Unity3d API specific problem and are actually not about C# in general. (And also because the available C#/.NET version in Unity is often version specific.)


So until now I use

<!-- language: lang-c# -->

or

<!-- language-all: lang-c# -->

on almost all Unity3d questions and don't tag them [c#].


I therefore think the syntax-highlighting for questions tagged [unity3d] should automatically be set to c# - Or should I tag all [unity3d] questions also [c#]?

4
  • you say almost always but what should someone do when they are posting with a different language?
    – Joe W
    Mar 5, 2019 at 13:26
  • @JoeW than you can still change it manually like how do it now all the time <!-- language: lang-XY -->. Or - I honestly don't know what happens for multiple language tags but - I'ld expect that if you add additional language tags the parser tries to recognize the correct one?
    – derHugo
    Mar 5, 2019 at 14:01
  • 4
    Hm, Unity is not strictly tied to C# though. In the recent past it also targeted Javascript, but that has been discontinued so at this moment in time it is mostly C# oriented. Who knows what will be true tomorrow. IMO, a language tag is a better solution.
    – Gimby
    Mar 5, 2019 at 14:40
  • Unit3D has 2 programming langs supported Javascript in older version which might still be used or C# the now default the that means the language tag is needed so developers know which one they are helping with like I can support C# less than I can support Javascript in Unity3D. older versions might still be used by people who have paid for Pro of an older version.
    – user623150
    Mar 6, 2019 at 13:49

1 Answer 1

6

We are reluctant to add language highlighting hints to non-language tags, because it can cause all sorts of unexpected behavior and general breakage.

I don't think it's appropriate in this case, for basically the same reasons that Gimby already pointed out. Unity3D is not, by design, a strictly C#-specific API. It can be used from other languages, including JavaScript, Boo, and F#.

Even if it mostly targets C#, that's not enough to introduce a language highlighting hint.

There is no drawback to simply applying a language tag to the question. If there's C# code, then a tag is quite appropriate. You'll get the appropriate syntax highlighting for free.

Anyone who wants to answer C# questions that are not about Unity3D can just filter out that tag.

11
  • 2
    Maybe lang-default can be considered but adding the language specific tag is much cleaner.
    – rene
    Mar 5, 2019 at 20:12
  • lang-default could still introduce clashes. Unity3D is a more popular tag than, say, Boo. I don't see the advantage. @rene Mar 5, 2019 at 20:14
  • 1
    Yeah, agree, it was more a suggestion in case lots of followers in that tag insist on having an highlighter enabled. I'm not familiar with Boo's syntax but I expect most people will not notice the difference between lang-default vs lang-csharp or lang-js
    – rene
    Mar 5, 2019 at 20:23
  • @CodyGray yeah sounds reasonable. Just a question: Let's say a question about unity3d is not tagged c# and doesn't provide code (though it should ofcourse) - however I answer it providing c# code. should I rather add the <!-- language comment or tag the question c#?
    – derHugo
    Mar 5, 2019 at 20:49
  • 1
    If the question isn’t about C#, then it shouldn’t have the tag. Your choice of language to demonstrate the use of the library is incidental. Just add the formatting hint to your post. @der Mar 5, 2019 at 21:41
  • If a question isn't about a programming problem with Unity3d, should it even be considered for the site? How should we distinguish between a UI specific problem with Unity3d and a language-choice related one? Send them to Game Development all the time? Require a language tag if Unity3d tag is selected?
    – Eliasar
    Mar 7, 2019 at 18:21
  • 1
    You should make the distinction by reading the question, @Eliasar. If it's not programming-related, it's likely off-topic for Stack Overflow and should be closed. However, do keep in mind that tools/libraries commonly used by programmers are on-topic here, so problems with a Unity3D UI are going to be on-topic here, even if the question doesn't need to contain any code. Mar 7, 2019 at 18:50
  • 1
    I disagree. Unity dropped support for Javascript in 2017. The Unity3d API has different idioms around async programming, eventing, serialization, and coroutines. This makes it annoying when askers add the C# tag to get C# syntax hilighting, and a C# expert gives an answer that doesn't work in Unity, and the (wrong) answer gets upvotes from other C# tag watchers. Jun 12, 2020 at 20:12
  • 3
    Can this be looked at again? Considering Unity has now fully dropped support for languages outside of C# (Boo, UnityScript)? And although yes, F# can be used in Unity it is not an out of the box native support. IMO there is a drawback to having to add the C# tag, it creates an unnecessary bump, and requires people to do edits that could be prevented.
    – Remy
    Jul 2, 2020 at 7:31
  • 2
    @CodyGray "now" that Unity fully dropped other language supports except for c# (a while ago) .. would you still stick to this or would we have to reconsider? ;)
    – derHugo
    Jun 21, 2021 at 11:23
  • Perhaps this may not be appropriate, but when facing a question with only the unity tag, you have 3 options: 1. Add a c# tag, 2. Specify a language, 3. Use the default synatx highlighting. Obviously, the 3rd one is the most convenient and can provide higher readability to the code in the first place.
    – shingo
    Jul 11 at 4:52

You must log in to answer this question.

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