Considered
New member
Hello everyone,
I just found this forum today - nice to meet you all in advance!
I hope that some enlightened programmer here can really help me out
...A few years ago I cross-trained myself from VB6 to VB.Net. I was the only VB developer and had very little time to do this (employer's orders) so I bought a book by Francesco Balena and proceeded to make the transition at the speed of light. The very first thing I thought was "right... how do I do classes and collections". So I got classes, no problem... But when I came to look at collections I found I had several options:
...I looked at the definitions of each one, decided they were limited in comparison to VB6 style collections, so I figured out how to code the VB6 style collection in VB.Net and wrote it all the "old-fashioned" way. I couldn't understand why they weren't an option in the book? But I didn't have time to contemplate it...
So, a few years down the line I, finally, have some breathing space - and I'm taking this time to go back through VB.Net, from first principles, to make sure I didn't miss anything important along the way. I've been reading a book called "Mastering Microsoft Visual Basic" and have come to the section about "collections" - I've found the same 4 options as before:
So...
I'm not too concerned about Lists and ArrayLists - basic collections of information without a key aren't usually "proper objects" in my experience - and I always store collections of objects with keys as a force of habit.
Dictionaries look ok, and, on fairly quick contemplation, they trump Hash Tables because they're typed.
...my question is - why have we stopped using "Collections" (like VB6 collections) at all? Why don't the books mention them? Why do I hear a general concensus in C# and VB.Net circles that they're redundant?
When I write an application with collections of objects I generally like to write a "ReadAll" function, and have had many experiences where it's been advantageous to apply a procedure to the complete collection. So, in my mind (as it stands) it makes sense to have an object which has space to group any necessary procedures with the collection. And I thought this was one of the principles of Object Orientated Development? Sure I could achieve the same thing by having a Dictionary inside a class...but if I'm going to do that, wouldn't it make sense to write a VB6 style collection?
You're thoughts are more than welcome here.
(Sorry that went on a bit... I just wanted to give a background on why I might have missed that in the first place, and where I've got to today )
I also prepared to have my thinking changed on this, it's just, that, at the moment I can't see any reason to move away from the old-fashioned VB6 style collection.
Many thanks in advance from a humble "VB6 style VB.Net programmer"
I just found this forum today - nice to meet you all in advance!
I hope that some enlightened programmer here can really help me out
...A few years ago I cross-trained myself from VB6 to VB.Net. I was the only VB developer and had very little time to do this (employer's orders) so I bought a book by Francesco Balena and proceeded to make the transition at the speed of light. The very first thing I thought was "right... how do I do classes and collections". So I got classes, no problem... But when I came to look at collections I found I had several options:
- Lists
- ArrayLists
- Dictionaries
- Hash Tables
...I looked at the definitions of each one, decided they were limited in comparison to VB6 style collections, so I figured out how to code the VB6 style collection in VB.Net and wrote it all the "old-fashioned" way. I couldn't understand why they weren't an option in the book? But I didn't have time to contemplate it...
So, a few years down the line I, finally, have some breathing space - and I'm taking this time to go back through VB.Net, from first principles, to make sure I didn't miss anything important along the way. I've been reading a book called "Mastering Microsoft Visual Basic" and have come to the section about "collections" - I've found the same 4 options as before:
- Lists
- ArrayLists
- Dictionaries
- Hash Tables
So...
I'm not too concerned about Lists and ArrayLists - basic collections of information without a key aren't usually "proper objects" in my experience - and I always store collections of objects with keys as a force of habit.
Dictionaries look ok, and, on fairly quick contemplation, they trump Hash Tables because they're typed.
...my question is - why have we stopped using "Collections" (like VB6 collections) at all? Why don't the books mention them? Why do I hear a general concensus in C# and VB.Net circles that they're redundant?
When I write an application with collections of objects I generally like to write a "ReadAll" function, and have had many experiences where it's been advantageous to apply a procedure to the complete collection. So, in my mind (as it stands) it makes sense to have an object which has space to group any necessary procedures with the collection. And I thought this was one of the principles of Object Orientated Development? Sure I could achieve the same thing by having a Dictionary inside a class...but if I'm going to do that, wouldn't it make sense to write a VB6 style collection?
You're thoughts are more than welcome here.
(Sorry that went on a bit... I just wanted to give a background on why I might have missed that in the first place, and where I've got to today )
I also prepared to have my thinking changed on this, it's just, that, at the moment I can't see any reason to move away from the old-fashioned VB6 style collection.
Many thanks in advance from a humble "VB6 style VB.Net programmer"
Last edited: