kamagra how much to take

Generics And ArrayList (Object Array), Let’s Fight

I got in a fight, mentally. I love generics, but a lot of the times when I get my code review’s occur, people ask me why I didn’t use an object array when it would have sufficed?

So in this, I am talking about instead of using this:

  1. ArrayList list = new ArrayList();

Using this:

  1. List<T> list = new List<T>();

It’s a good question I suppose, but I gotta admit, I favor the use of generics heavily, and although there is a load of piddly crap that could be brought up between the two, I think that it all boils down to the performance differences, from both doing the development (since you don’t have to copy to an external collection to make freakin updates) to running the god damn application itself. I have heard in the past that there have been compiler problems with this generics. Is this true? I have no clue. I would be interested to know if it was though. Anyways, why do I think that generics are better then object arrays performance wise. It basically boils down to the heap. In the end, a generic from what I understand, there is no boxing and reference created to the boxed value, which is the case with an object array, and therefore, because of this lack of creating a piece of allocated memory on the heap instead just puts the god damn value in the array. That makes better sense to me.
I could point out more, but I want to leave work now.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>