Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 17.6 ('Xojo in Cologne')
Instant purchase and download via GumRoad!

FEATURE

Maps Part 2

Implementing Maps in Xojo desktop apps with the MapKitMBS plugin

Issue: 17.6 (November/December 2019)
Author: Markus Winter
Author Bio: Markus is a Molecular Biologist who taught himself REALbasic programming in 2003 to let the computer deal with some exceedingly tedious lab tasks. Some call it lazy, he thinks it smart. He still thinks of himself as an advanced beginner at best.
Article Description: Number> No d
Article Length (in bytes): 17,875
Starting Page Number: ea
Article Number: 17604
Related Link(s): None

Excerpt of article text...

I love code examples—following the code and especially seeing how somebody much more advanced than you solved a particular coding problem is a great way of learning how something functions.

That is also the reason why I gripe a lot about examples—because they often could be so much better.

For one thing, they could be much better documented: a method should have a comment at the start explaining what the method does, and code should be well-documented throughout.

For another, code examples should not crash. Code examples are supposed to teach you how to use something. But what if they also teach you bad programming habits? Wouldn't it be much better to learn from good code than from bad code? Wouldn't it be good to have defensive coding (like checking for Nil, checking that a row's index is larger than -1, etc.) become the norm and any beginner becomes immediately aware of it?

And finally, I also feel that with a bit more effort, code examples could be made much more re-usable. Imagine, if all the code examples in Xojo or MBS were written with re-usability in mind, where you could simply copy and paste a ContainerControl into your project? Where, thanks to the extensive comments, it would be easy to integrate that particular functionality into your app—now how would that increase productivity and value for a user?

This MapKit project is a perfect example—I will try to implement two ready-to-use ContainerControls that you can simply copy into your own projects. Which then begs the question: couldn't it have been like that in the first place? And I suspect the same could be true for many (most?) other example projects.

...End of Excerpt. Please purchase the magazine to read the full article.