Don't Forget About Xojo's Examples

As a long time Xojo user, I remember the days when the examples would be file items on your disk within the Xojo folder. It was helpful to have them around, but invariably I’d often forget about them as I had to go hunting down the folder and the items within that I needed.

I don’t recall when Xojo added this to the IDE (maybe this has always been in Xojo and I’m just remembering the Real Studio/REALbasic days), but for a long time now when you create a new project, within the sidebar at the very bottom is an item for examples. These days these are fetched remotely and downloaded.

As Xojo has progressed in this manner, my own workflow didn’t. But in the last 6+ months I’ve found myself remembering the examples and using them fairly frequently whenever there’s a bit of Xojo’s technology that I either want to learn more about or get a quick jumpstart on.

So just a reminder in case folks don’t know or have forgotten, how great and easily accessible are Xojo’s examples. As a nice edition is also the ability to filter them by Kind and Platform.

7 Likes

I have to admit - even as a long time user I had to really hunt around to find the examples, and then the one I ran didn’t work as expected. In my opinion, this user experience could use some reexamination.

Sure, they’re not perfect and I’m sure there’s bugs out there like in all software. But at least in my own experience, they’ve been great to see how say drag-and-drop works under Xojo, without needing to figure things out solely through the docs and reinvent the wheel.

Of course everyone’s mileage will vary, but at least for me I’ve been pleasantly surprised as to how useful the examples are and how easy they are to find and get to these days.

If there’s one place the code should be beyond reproach, it’s the examples.

2 Likes

If you have some issues filed against these examples, I’m happy to upvote/thumbs up.

The examples show bad code practices and use outdated code. I opened a random example and found this:

// Populate an array
Var firstNames() As Text = Array("Bob", "Bill", _
"Ben", "Brad", "Bart")

// Sort an array
firstNames.Sort

// Search an array
Var position As Integer
position = firstNames.IndexOf("Ben") // position = 2

It had been possible for many years to do declare a variable and initialise it at the same time. So why is position declared and initialised in 2 lines? Ever since the person doing the examples started with this style it has been used way more often here in the forum. And no comment on using text in 2024.

For myself, I prefer the two line declaration-assignment because it makes all assignments equal and searchable via “position=” instead of having to include the conditional “as integer”. Personal preference, and I don’t really consider it outdated.

2 Likes

I almost always put all my Var declarations at the top anyway.

  1. So I don’t have to search everywhere to see how it is declared, or indeed if it is declared here and not a window property or whatever.

  2. So the code is less cluttered.

1 Like

Good lord. is nobody ever happy on these forums?

I use the examples all the time. they’re a great resource even if they are a little out of date.

5 Likes

I worked in retail for many many years and all I can say is no, there will always be people that love one thing and others that hate it

Some people mad, some people sad and others happy

Just how individuals are?

I get it. It’s just that every time someone tries to post something positive here, there’s an immediate influx of people complaining about the product. I get that people have issues but we already have at least 20,000 complaint threads. Sorry, just tired of it.

3 Likes

I did not mean anything against the post you made
I understand being frustrated with the downside of everything

Trust me I get tired of the complaints also

I guess I just meant that no matter where, when or how something is meant to be positive there will be those that find negative

1 Like

I appreciate your frustration, but this was a particular pain point for me recently and it was right in the middle of making a decision to purchase an updated license. I had to search the web to figure out how to access the example projects, and once I did, the project I tried didn’t perform as expected.

Turns out the example in question, involving Workers, doesn’t work as expected until you buy a license - Workers are limited to a single thread if you are debugging, so if you don’t have a license, there’s no way to evaluate the Worker multiple-CPU functionality. Worse, there was no warning or explanation when debug-running the project, leaving me trying to guess if the example was just out of date, malfunctioning in some way, etc.

If I were a user who was new to the language and considering a purchase, understanding how Workers operate might be of great interest - but without a license and considerable existing knowledge of the language and IDE, you’d never figure it out. Not a good look for exactly the potential customers Xojo should be courting.

Your feedback is appreciated
Maybe there is a better way for Xojo to explain what is and is not included in every license?

Maybe submitting a feature request with what you explained could enhance the explanations of the different licenses

This is a technical limitation of debugging Workers, not a marketing or strategic decision. If anything, it’s a documentation issue (there is no mention of the single-CPU debug limit in the docs for Worker) and a feature request (add a warning when debugging that Workers will be limited to a single CPU core). I only discovered this limit by searching the forum.

Workers examples should contain a Note in the code and the UI that Xojo debug does not create real workers. That you need a Desktop License or higher to use them by actually building.

Xojo should take some time reviewing the examples to make sure they don’t suggest deprecated code.

1 Like

ok so put in a feature request for technical ?
Nothing can get better if you do not try.
There will always be voids that need to be filled but if we at least want to try and fix them Xojo way is to file an Issue

No, I think it would better take the form of a dialog you get while debug running that you can turn off if you wish. That way it will assist all users, not just those who open the Worker example project.

That’s a personal stylistic choice.

Just use the examples the same way you’d use an AI assistant - it will probably point you in the right direction, but you have to check its work :smiley:

1 Like

Good idea, open an Issue about this.