Old style Collections

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Z3V5?=

    #1

    Old style Collections

    I find the Generic collection classes really usefull, so usefull in fact that
    I do not usually use the old style collections like ArrayList and Hashtable.

    In fact if I did need a collection of potentially anything I would use a
    List(of object) rather than an ArrayList.

    Are there any occaisions where the old collections are preferable?

    Guy
  • Tom Shelton

    #2
    Re: Old style Collections

    On Nov 8, 9:05 am, guy <g...@discussio ns.microsoft.co mwrote:
    I find the Generic collection classes really usefull, so usefull in fact that
    I do not usually use the old style collections like ArrayList and Hashtable.
    >
    In fact if I did need a collection of potentially anything I would use a
    List(of object) rather than an ArrayList.
    >
    Are there any occaisions where the old collections are preferable?
    >
    Guy
    None come to mind.

    --
    Tom Shelton

    Comment

    • =?Utf-8?B?QU1lcmNlcg==?=

      #3
      RE: Old style Collections

      I find the Generic collection classes really usefull, so usefull in fact
      that
      I do not usually use the old style collections like ArrayList and Hashtable.
      >
      In fact if I did need a collection of potentially anything I would use a
      List(of object) rather than an ArrayList.
      >
      Are there any occaisions where the old collections are preferable?
      I still have one such case remaining (all others converted to generics). It
      is a queue where each queue entry is an array of objects. By convention, the
      zero'th array element is a string whose value tells you how to interpret the
      remaining array elements. The dequeueing thread needs to operate
      sequentially on the queue (that's why a queue in the first place), and I
      can't see a good way to convert to generics.

      Comment

      • Tom Shelton

        #4
        Re: Old style Collections

        On Nov 8, 2:30 pm, AMercer <AMer...@discus sions.microsoft .comwrote:
        I find the Generic collection classes really usefull, so usefull in fact
        that
        I do not usually use the old style collections like ArrayList and Hashtable.
        >
        In fact if I did need a collection of potentially anything I would use a
        List(of object) rather than an ArrayList.
        >
        Are there any occaisions where the old collections are preferable?
        >
        I still have one such case remaining (all others converted to generics). It
        is a queue where each queue entry is an array of objects. By convention, the
        zero'th array element is a string whose value tells you how to interpret the
        remaining array elements. The dequeueing thread needs to operate
        sequentially on the queue (that's why a queue in the first place), and I
        can't see a good way to convert to generics.
        dim q as new queue(of object())()

        :)

        --
        Tom Shelton

        Comment

        • =?Utf-8?B?QU1lcmNlcg==?=

          #5
          Re: Old style Collections

          dim q as new queue(of object())()

          Well, sure, but I'd still have 'object' rather than something more specific,
          and I'd still be Ctype'ing. If my solution were just an Object rather than
          an Array of Objects, then
          dim q as new queue(of object)
          would be using a generic without purpose.

          I guess the more direct answer to guy's original question is this: a queue
          of diverse objects that do not have any common inheritence other than
          'object' and where their sequencing is all important.

          Comment

          • Tom Shelton

            #6
            Re: Old style Collections

            On Nov 8, 4:25 pm, AMercer <AMer...@discus sions.microsoft .comwrote:
            dim q as new queue(of object())()
            >
            Well, sure, but I'd still have 'object' rather than something more specific,
            and I'd still be Ctype'ing. If my solution were just an Object rather than
            an Array of Objects, then
            dim q as new queue(of object)
            would be using a generic without purpose.
            >
            I guess the more direct answer to guy's original question is this: a queue
            of diverse objects that do not have any common inheritence other than
            'object' and where their sequencing is all important.
            I was only funning you. That's why I had the :) in my message....
            Really with queue, you are probably not gaining anything - there isn't
            even the extra convienience of the new findx methods (it's queue,
            duh!). I might be tempted to do a performance comparison, just to see
            if there were any new optimizations in the new generic queue, but
            somehow, I doubt it.

            --
            Tom Shelton

            Comment

            Working...