This is a sort of design question, and I'm sure there are people who do it both ways. But in your opinion, is it better to assign a variable in the class or in the constructor? For example (regardless of syntax or language, this is just to explain):
public class Example
{
private final int TIME_STAMP = Now();
private int num = 2;
}
OR
public class Example
{
private readonly int TIME_STAMP;
private int num;
public Example()
{
TIME_STAMP = Now();
num = 2;
}
}
Please disregard the mix of different languages and syntax... Which is preferable and why?