Define a list while declaring vs in Start()

A list can be defined by using List<T> list = new List<T>(); We can also do something like:

List<T> list;
list = new List<T>();

My question is, what will the difference be between this code:

public class SomeClass {
    List<T> list = new List<T>();
}

and this code:

public class SomeClass {
    List<T> list;

    void Start() {
        list = new List<T>();
    }
}

There is quite a difference.

When initializing the class variable when declaring it, its value is set when the constructor is called (before Awake is called)

Initializing the variable in the Start function will be done latter in the life cycle of the object. It will be done after the object is created, after Awake is called, and the first frame the object is enabled.

So, it’s up to you, it all depends on your needs.