-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[To discuss] Explain the difference between arithmetic- and storage- primitive types #15
Comments
An interesting case is things that are denoted with numbers, but are primarily used as symbols.
|
@dkhalanskyjb I believe that timestamps are API types (for example, LocalDateTime), while their storage counterparts could be very different (for example, most probably DBs will store them as Longs). I would go with API, not arithmetic types if we're talking naming. |
I have a different question: if our API type is Integer, while storage is in, say Shorts, don't we make our application more fragile? |
@asm0dey, you can find things like |
This is definitely something I would not recommend to in the guide :) |
It would be nice to explain and provide recommendations regarding usages of various types in public API.
The overall recommendations should make a clear distinction between arithmetic types (e.g.
Int
,Long
andDouble
, ones that folks do arithmetics around) and storage types (e.g.Short
,Byte
,Float
, ones that are rather a memory layout optimization), as well as provide a recommendation what should be used in public's API and whyAlso let's deprecateChar
while we are hereThe text was updated successfully, but these errors were encountered: