I was just going through their main page and it says,
A type-safe HTTP client for Android and Java
Why Retrofit advertises itself as being Type Safe while other libraries(many other popular ones) don't?
Before you answer...
There is an answer to this same question here. It says,
Type safety is the extent to which a programming language discourages or prevents type errors. A type error is erroneous or undesirable program behavior caused by a discrepancy between differing data types for the program's constants, variables, and methods (functions), e.g., treating an integer (int) as a floating-point number (float). This is common in statically typed languages such as Java and C
Thus Retrofit prevents errors of this type
If this is truly the answer then many libraries prevent these kinds of errors but none of them advertise as Type-Safe. Is it a marketing thing then?
I consider the above answer inadequate because the definition of Type Safety has not been taken seriously.
Anyway, there is another post with the definition of Type Safety. They give out examples:
Type safety means that the compiler will validate types while compiling, and throw an error if you try to assign the wrong type to a variable.
Some simple examples:
// Fails, Trying to put an integer in a string String one = 1; // Also fails. int foo = "bar";
This also applies to method arguments, since you are passing explicit types to them:
int AddTwoNumbers(int a, int b) { return a + b; }
If I tried to call that using:
int Sum = AddTwoNumbers(5, "5");
As per the above definition, it would be the language(Java) and NOT the library that is specifically TypeSafe.
So, I ask, again, why does Retrofit advertise itself as a Type-Safe library?