Search Unity

More or Less Scripts

Discussion in 'General Discussion' started by The Ghost, Aug 3, 2013.

?

Which is better?

  1. A few long scripts

    2 vote(s)
    40.0%
  2. Many short scripts

    3 vote(s)
    60.0%
  1. The Ghost

    The Ghost

    Joined:
    Jul 7, 2012
    Posts:
    188
    In general is it better to have fewer, but longer scripts or many short scripts? Does it affect performance in any way?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    There's no "in general" or "better"; it all depends. Use whatever is most appropriate for what you're doing.

    --Eric
     
  3. GenericGame

    GenericGame

    Joined:
    Nov 26, 2012
    Posts:
    206
    Some days, I will write an elaborate library. Other days, I might just start creating tons of mini scripts deriving from monobehaviour. I think, as long as I don't use Update for everything, there is no harm in creating tons of extra classes. At least, I've never seen any issues with it. It did, however, take me a while to realize, hey, I don't need an elaborate library for these little things.

    I guess it depends on the day and the scope of the project.
     
  4. The Ghost

    The Ghost

    Joined:
    Jul 7, 2012
    Posts:
    188
    Ah, ok. I tend to lean to creating more scripts because it's faster for me that way, thanks for the answer.