Search Unity

Insert... (actually, let's talk about code tags)

Discussion in 'Meta-forum Discussion' started by BlackPete, Jul 13, 2017.

  1. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    969
    I think the "Insert..." drop down hides valuable functions such as the code or quote tags.

    As a result, it's not obvious that there's a code tag feature in place, and people keep pasting code into posts without tags, and they're hard to read.

    There are a few of us who keep telling new people to use code tags, but honestly it's fighting an uphill battle. Plus, Unity is a very script-heavy platform, so code posts would be very common on these forums.

    Can the code tag button be moved into the main bar where it's a more obvious and convenient location?
     
    nat42, Kiwasi, mbbmbbmm and 2 others like this.
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,435
    YES PLEASE.
     
  3. mbbmbbmm

    mbbmbbmm

    Joined:
    Dec 28, 2013
    Posts:
    58
    +1
    Couldn't find it and googled this thread. Generic "insert" is not so obvious somehow. Strange but true.
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,223
    It'd also honestly be nice if the forums didn't strip white space at the beginning of lines. That would help a lot with how unreadable non-tagged code is.

    Code tags.
    Code (csharp):
    1.  
    2.     this
    3.         should
    4.   all
    5.             be
    6.      on
    7.  different
    8.      lines
    9.  
    Not code tags.
    this
    should
    all
    be
    on
    different
    lines
     
    Kiwasi likes this.
  5. Scabbage

    Scabbage

    Joined:
    Dec 11, 2014
    Posts:
    268
    @Baste
      Look
         at
     all
       these
     chickens
     
  6. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    2,960
    I think the forum should auto-detect when somebody's trying to post more than one line of code, and tell them how to use the tag. Curly braces are usually a sure sign of code, so that and the presence of certain keywords (void, public, private, var, string, GameObject between braces) should be enough to trigger a helpful dialog.
     
  7. Scabbage

    Scabbage

    Joined:
    Dec 11, 2014
    Posts:
    268
    That, and tell them not to use var in big capital letters when detected, because 99.9% of the time it's being used horrendously when code is posted in the scripting forum.
     
  8. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    2,960
    A.k.a. The Twilight Zone.
     
    Scabbage likes this.
  9. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,435
    I'd really like to see inline code formatting like you see on slack with tildes: `some code`. I made a thread about it a few months ago but it died.
     
    BlackPete likes this.
  10. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    2,960
    Yeah, I use markdown nearly everywhere. It's an automatic reflex when mixing code and text now. Backticks should be added to the forum markdown, with optional language identification (we need more than the only language in Unity, C#, since we also use various CLI script in server/batch contexts).
     
  11. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,223
    Pressing
     Tab
      Moves
       My
        Focus
         To
          The
           Reply
            Button!
     
    landon912 and Murgilod like this.
  12. nat42

    nat42

    Joined:
    Jun 10, 2017
    Posts:
    354
    Sorry and not sorry to necropost / bump this thread. Being new myself I still recall when I looked for a code option in the post toolbar and didn't find it.

    Even if only 1/10 newbies look for the code option and don't find it, I think that's enough to justify the change of putting it on the toolbar. The use code tags posts, while necessary, hardly seem the most welcoming/friendly first responses many new posters seem to get.

    Actually, if you view source I think you might see it's there and it's the browser not showing the whitespace. Because that's how HTML rolls.
     
  13. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,411
    Something like a message on posting: "It looks like you're posting code that's not in a code tag. If so, please use code tags for the sanity of our community or risk being flamed!"