FWIW, declares don’t have to be “difficult and time-consuming”… but you do have to be able to think in whatever the underlying language is in most cases because you may have to consider retaining & releasing and there really is no type enforcement for Ptr
.
And therein lies the rub for many people, including some full time developers using Xojo. One of the primary reasons many use plugins is to NOT need to understand the underlying interfaces. Or ramifications of things like memory management. Even when it appears you may have accomplished a certain objective with declares, if you do not understand nuances like memory management you can have a problem waiting to happen due to memory leaks or other issues.
Declares have their place too – don’t get me wrong – but the number of people who can correctly implement them (as opposed to using declares by virtue of good examples) is likely a small minority of people using Xojo.
The guy who asked “Do you prefer Declares or Plugins?” The Original Poster.
Love declares; never use plugins. For me the whole point is learning to understand the underlying interfaces for myself. In this sense, using a plugin would be considered cheating!
Time is money. Even when doing all the work yourself.
Could I do much of what is in the plugins I license? Probably; but the point (for me) is to NOT need to spend that time. Including the time for fixing it when underlying things change in the OS.
Same reason I have App Wrapper. Let Sam deal with the ever changing Apple rules. Could I? Probably but why should I when I can just license a working solution for much less than my time is worth to me.
I enjoyed working on declares in the past, but nothing beats plugins for a professional developer, in terms of getting quickly to a result.
It all resorts to productivity.
I don’t use any plugins, even the Xojo supplied ones. I can’t justify buying a bundle when I’m only interested in one or two. As for declares, the few I use are courtesy of folk here like Sam. Generally, they are just for a few nice-to-haves rather than essential components (with one notable exception), and of course are not cross-platform.
And when I was younger, I enjoyed working with machine code “for the fun of it”. Over the decades, I came to realize that maintainability of code is (generally) more important than the efficiency of it. Also the relative cost of hardware vs software development at the time. Those have traded places now, and if renewing licenses to some plugins saves me time, that is a trade-off that I am willing to make.
YMMV.
I’m with @Ant_Col - I can’t begin to imagine trying to work with DirectShow or CURL for example without a plugin. The painfully minimal MBS documentation is still far better than Microsoft’s API docs, which are a wall of gibberish to me. While I do enjoy the mental calisthenics of programming, the primary goal for me is to deploy a working app and get paid for it.
See my declares for libcurl (with documentation that blows MBS out of the water IMHO)
Thank you to everyone for your comments. The discussion has been insightful, and there is no ‘right’ or ‘wrong’ answer, just many shades-of-grey.
Warm regards,
Eugene
I am all in for declares.
Does anyone have any good guides to get started with Declares?
The books from Eugene Dakin about windows declares comes to mind:
“Implement API2 Declares With Xojo on Windows”
https://www.xdevlibrary.com/
As a “citizen developer”, after cost , that is the biggest reason I consider MBS plugins a last resort, and even then only for functionality I absolutely can’t do without.
-Karen
Recommendation: check the bottom of the page to see if used in any MBS examples, then I typically find the example projects more helpful than the example project code snippets shown in the docs. Although those can often be enough to get a better understanding of usage too. So I frequently check those first, then load the example project if still not clear.
Yes, I am aware of the example projects and in fact many of the plugin functions would be virtually impossible to figure out without the examples, despite their crypticness and minimal commenting.