Whats Missing In Vb Classic

Why are there so few data structures like stacks and queues, hash tables, linked lists, etc?

And of course, ImplementationInheritance is missing (see VbClassicImplementationInheritance).


There are no primitives like stacks, queues, HashTables, or LinkedLists built into the language because VisualBasic is designed to leverage existing ComComponents to get work done.

Make sure to check out VbDotNet for details on what's planned for the next revision.

--DrewMarsh


Where are the stack COM objects and Hash COM objects then? Am I missing something (Vb doesn't feel like home to me. I spend no time reading or thinking about Vb or COM and anything Microsoft outside of work)? COM objects are not great for these types of structures in my mind's thinking on the subject. That said, maybe I'll try converting StackModuleInVbClassic into a COM object and see how it works then.

The Collection class, that is built into VisualBasic, is one such example. You could easily create a CeePlusPlus ComComponent that wraps up an STL vector that stores Variants to accomplish this functionality.

You can also check out the "Scripting.Dictionary" (that's the ProgId) component for hash-table functionality. It is installed whenever you install WindowsScriptingHost or if you simply install the MicroSoft ScriptingEngine-s.

--DrewMarsh

The fact that every class instance in VB is individually reference counted is another headache; without a way to tie an instance to an owner instance, it's easy to get bogged down in circular reference problems. Some libraries expect the user to use some sort of close/destroy/dispose mechanism to ensure that circular references are broken down, but that sort of weakens the case for SmartPointers.


CategoryVbClassic

EditText of this page (last edited February 6, 2009) or FindPage with title or text search