New answers tagged

0 votes

How to deal with Classes having the same name (different packages)

The standard Java classloaders don't support having multiple class with the same name. This is what OSGI allows you to do. OSGI allows you to have multiple versions of the same class. Without going ...
Tom R's user avatar
  • 1
0 votes

Is storing computed values always bad?

Just in case you have a calculated value where the calculation is expensive, and done repeatedly. So expensive that you favour speed over code complexity: Create a backing variable with the last ...
gnasher729's user avatar
  • 43.6k
3 votes

Is storing computed values always bad?

To make a true apples-to-apples comparison, modify the first version to make it semantically equivalent to the second, i.e. the class should encapsulate the calculation and not allow any outside to ...
Sebastian Redl's user avatar
2 votes

Does a `long` ban make sense?

Today I assume that char = 8 bit, short = 16 bit, int = 32 bit, long = 32 or 64 bit, no guarantee either way, long long and int64_t = 64 bit on any device that I write software for, with any compiler. ...
gnasher729's user avatar
  • 43.6k

Top 50 recent answers are included