14 Common Misconceptions About you can substitute a generic type with a primitive data type.
This is a really important point, and it’s something I’ve often wondered about myself. I’ve read this concept a million times, and I’ve never really understood it.
This is a really important topic because it is one of those rare concepts that not only has great value, but it is also one of those rare concepts that actually makes sense.
There are many reasons why you may not use a generic type over a primitive data type. For one thing, generic types tend to be more verbose (or verbose like you would expect them to be). They can also be more difficult to use, as the name implies. For another thing, generic types can require you to write a lot of extra code to create them. For another thing, they tend to be harder to test and more error prone.
The problem with generic types is that they require you to create extra code to achieve them, and it’s often harder to test. For instance, the code for a generic object in C++ is actually quite long! In Java, you can write a generic class, but in Java, you have to write a lot of extra code to create a generic class. In fact, it’s very hard to write a generic class in Java.
It makes it hard to test because the code you actually write is much harder to test than the code you write with a generic class.
Java does make it easier to write generic classes, because you don’t need to write the actual code for them. In fact, it may even be easier for you to write the code for the generic class because the code is already written and testable. In fact, in Java, the code you write with a generic class can be tested with the same code you write for the generic class with the real object implementing the class’ interface.
The downside of writing a generic class is that you have to write the generic code for the generic class yourself. When you write a generic class, you have to write the code for the generic class. When you write the generic code for the generic class, you have to write the code for the generic class yourself. It can be a pain.
In Java, we can write generic code and test it. In C++ we can write generic code and test it. In Perl we can write generic code and test it. In PHP we can write generic code and test it. In Python we can write generic code and test it. In Ruby we can write generic code and test it.
I can’t think of anything else. For something that seems so close and so fundamental to our world, we can’t write generic code that tests it. Even if we wrote generic code that tested the generic code, we would still have to write the generic code ourselves, so we’d have to do more work than we would have to do writing the generic code.
In other languages, we write generic code that tests it. Python, Ruby, and PHP all have a set of generic code that tests it. Java has a set of generic code that tests itself.