Tempest
How to tell if a variable is a reference or value data type
Yeah okay fair enough. I was reading msdn last night and learned that if your variable is less than or equal to 3 words a ref is bigger anyway. Okay, looking at my code base there are only a few instances where im passing anything larger than a primitive. I think I'll do some benchmarking today and see how big the performance hit to using in and out is because if its free or negligible there are only a few areas where it would be even vaguely appropriate anyway.
27 replies
How to tell if a variable is a reference or value data type
Okay it's just I've been writing code like this lately:
Class BankAccount{
Int balance
}
Class BankAccountReport{
Int balance
}
void displayBalance(BankAccountReport r){
}
To get around accidentally changing variables I shouldn't be changing. I'm probably over engineering there but I'm trying to get better at writing secure code
27 replies
How to tell if a variable is a reference or value data type
yeah it might just be my old c++ brain, const was such a flexible keyword and we tended to use it everywhere, it felt like good practice back then but I'm aware that things have changed a lot in all that time
27 replies