trying to understand classes, module, subs, functions

I would like to know the differences between a class and a module, and the difference between a sub and a function. I know how to use them. I've been programming for years. But I would like to know the deep details of them so I know where and when to use them. So I can have the most efficient programs.

Thanks


Answer this question

trying to understand classes, module, subs, functions

  • Nibbla

    So using subs and functions comes down to preference. Right

    Does anyone know about classes and modules

  • Mirronelli

    Oh, ok. Thanks!

  • Jeffclar

    sub and function is an artificial construct so that VB can avoid having a void return type. Apart from a function returning a value, there is no difference.



  • Mihir Vaidya

    No, it';s down to if you need to return a value from a function.

  • stillDesign

    Again a module is somewhat of an artifical construct. A module is in fact a shared class with all methods set to shared as well - which means that you dont have to instance the class to use the methods.


  • SanjeevBhatia

    ah, ok. So a module is good for using just in a project. But a class is good for say a dll. Because you have to make an instance a dll. Thanks for the help!

  • trying to understand classes, module, subs, functions