First of all, I would like to point out the advantages of procedural programming (PP):
- With PP find that I can just start, I don't have to have a complete algorithm design in my head. With OOP, you need a better conceptual understanding of the whole task and how split a task up into its components before you start. As such OOP can be harder to learn.
- Debugging OOP can be harder as inspecting variables within objects in ms-access is not possible when an app hangs (due to encapsultation?). I have to put break points in the class code if I want to debug a class interactively.
- From a theoretical perspective, it can be hard to validate OOP code as objects can be little black boxes subject to lots of influences which can interact in unpredicted ways. In mission critical disciplines where certainty is required the functional programming style is possibly better. As far as I understand things functional programming is just PP with lots of user defined functions.
I would like to have functions that return multiple values. If I want to show a photo on a web page, I want to know if the photo folder exists, if the photo exists, if the photo is portrait or landscape and if a thumbnail of the photo exists. The web page will report one of the following:(folder missing – folder name), (photo missing – photo name), or (show the photo with correct height and width). Usually I have a success flag as well, for cases where the input data was rubbish and no result could be returned.
Functions generally return only one value which makes handling tasks like the one above difficult. I can return an array from a function, but splitting up the items is messy. I can also use several simple functions that each return one value, but then I have to write more code in the calling procedure, when what I want to do is push these details to a lower level.
Is there any reason why a the return value from a function in a procedural language can't have several parameters just as the call to a function can have several parameters? If this was the case, then one of the attractions of OOP would be reduced.
Ms-access has controls which are objects, which means that when I do something with a control, several items of information are automatically generated. If I select a value in a list, the selection items ID is recorded and if the list is a data bound list, the dirty property is set indicating that the record has been edited. I wonder how I can deal with similar situations in PB, where one simple user action triggers several concurrent changes that each need to be handled. The fact that ms-access has controls that are objects means that the developer does not have to worry about managing lots of the low level detail, which are represented by control properties in ms-access. Unbound forms can also be used in ms-access but they take a lot of coding to create. I think that forms in PB would be similar to unbound forms in ms-access. In summary OOP seems to allow for objects to coordinate with each other automatically in certain cases such as with data-aware controls and this takes some of the burden off the developer. I don't know the answer to this, I just hope that there is elegant solution out there that has not been found yet.
I would like controls to be objects even if the language is not OO so that they can automate some of the fiddly stuff and keep it behind the scenes.
I can't remember my user defined function names as my projects get larger. The self documenting capability of OOP becomes really important to not creating duplicate code. PB's modules may achieve something similar. I understand that functions defined in a file are added to the intellisense list in the IDE in PB (they are not in ms-access).
I welcome any contribution from anyone who can tell me more about the pro's and con's of PP and OP in a construction conceptual way that relates to how things can and cannot be done in PB. The outcome for me is that PB will probably be a learning environment where I develop the conceptual frameworks that allow me to advance in other languages and environments. PB has greatly lowered the barrier to learning application design for me and this is what its purpose is. I would be happy to write apps in PB but I need to know how to deal with complex items like photos or database records that have lots of properties before I do so.




