Search Unity

Am I dumb or is it difficult to keep best practices while using Unity?

Discussion in 'General Discussion' started by evan_ohara, Jul 20, 2019.

  1. Peter77


    QA Jesus

    Jun 12, 2013
    The main point why I brought up TextMeshPro.SetText is because it does not cause an allocation. If you want to display a simple formatted text only, like the score example, and you don't have a reason to keep it as a string, I found using TMPro beneficial from a GC alloc point of view.

    string. Format or any other string concatenation features like StringBuilder.Format, string.Concat, etc all create new strings and thus alloc memory / garbage. Haven't checked the latest C# / .NET Framework though, but I doubt it changed.
    frosted likes this.
  2. Lurking-Ninja


    Jan 20, 2015
    Well. Though.

    I took this photo in the Computer History Museum in Mountain View, CA. All the computer languages are built on each other. Not too surprisingly.

    (Mobile photo was taken in 2013 I think, without flash and in somewhat dark, so it's not the greatest quality, sorry about that)
    angrypenguin likes this.
  3. Owen-Reynolds


    Feb 15, 2012
    Big fold-out posters like that used to be common. It's fun when they're in a CS Dept hallway, since everyone has an opinion how it should have looked. But someone who can program, even a little, is beyond it. They can see specific things languages borrow from each other, and why. Often some other language does a feature really well, and has the best explanation. StackOverflow also has plenty of nice "how do I do Y in language Q?" questions -- like how to make Java-style enums in C#.