Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,591
    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. Well. Though.
    892012_10201781646437132_2059252129_o.jpg

    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

    Owen-Reynolds

    Joined:
    Feb 15, 2012
    Posts:
    1,992
    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#.