MBS Xojo Developer Conference 2017

Xojo isn’t having their annual conference as they’ve decided to switch back to spring events. Since they last did one in October of 2016 they are not doing one in 2017. It makes me sad that I won’t see my friends until 2018. Thankfully, Monkeybread Software is holding a Xojo conference in Berlin on May 4th and May 5th, 2017 to tide me over..

This two day conference, held in the heart of Berlin, Germany, will boast the biggest Xojo get together of the year. Several people from Xojo Inc will be attending and Geoff Perlman will deliver the keynote address where I’m sure we’ll hear about many of the upcoming features of Xojo.

We will be there too. Carol will be giving a Database Design Mistakes session that she was hoping to give at XDC 2016 but had to cancel due to a grandson showing up. I will be giving a Reporting in Xojo talk showing off Shorts and some of the new features we’ll have added to the product by then.

I can’t emphasize enough how much I love these conferences. It’s where we can learn some new things about Xojo, and, more importantly, make friendships that can last a lifetime. I can tell you, from experience, that meeting the people you’ve ‘talked’ to on the forums is a magical experience.

Carol and I have never been to Berlin so we will do some sightseeing. We haven’t set our flights yet but we’ll be happy to try and coordinate with our Xojo friends. Let us know what sorts of things you’re doing and dates.

See you in Berlin, May 4th and 5th. To register for the conference, please go to http://www.monkeybreadsoftware.de/xojo/events/register.shtml

May your 2017 be better than 2016.

The Power of Meeting Face to Face

In Kansas City this past weekend I attended MidAmerican 2, or WorldCon.  WorldCon is a Science Fiction and Fantasy fans dream come true.  Thousands of people from around the world attended hundreds of sessions covering television shows, movies, author readings and signings, many sessions on how to write, and much more.   It is a long convention at five days that culminates with the Hugo Awards ceremony (think the Academy Awards for science fiction and fantasy).

I am an aspiring science fiction writer (nothing published yet but I’m working on it!).  This convention was an excellent way to immerse myself with professional and amateur writers and learn.  There is something powerful about hearing people that have already “made it”.  Many of them still fight “Imposter Syndrome” and many have issues with the business of writing.  Writing is a solitary business and many are introverts and selling themselves is often nerve wracking.

Do these issues sound familiar?  They should.  In many ways, Xojo developers are much like writers in that they work in a vacuum with little feedback from others.  I know I personally struggle with Imposter Syndrome despite having done this gig for fifteen years and being ‘successful’ (whatever that means).  And much like writing, the only way to get better at Xojo programming is to do Xojo programming.

It seems a bit anachronistic to fly somewhere to meet with people.  After all, the internet makes this easier, right?  There is something powerful about being face-to-face with another person and being able to provide instant feedback.  We also tend to be much more polite in person than online and that’s a huge plus in my opinion.  I’ve met some wonderful people, in person, that online seem rude at best and sometimes simply belligerent.  The internet might make people more accessible but it seems to removal societal filters too, sadly.

In a month and a half Xojo is holding its annual Xojo Developers Conference (XDC) in Houston, Texas.  At XDC, Xojo developers from around the world will join together for three days of sessions covering practically every development topic you can think of.  And if you have a question that’s not covered you’ll be able to find someone to help you.  Besides the many amateurs and professionals attending you’ll have ample opportunities to talk to the Xojo engineers.

It’s not uncommon for businesses looking for a developer to attend XDC.  It gives them the unique opportunity to talk to many Xojo developers in a short amount of time.  We (BKeeney Software) typically speak to one or two prospective clients at XDC each year.  If you’re a consultant this conference should be on your ‘must attend’ list as it can pay for itself many times over if you land just one project.

Today is the last day to save $100 off the conference registration.  Sign up to learn and be inspired and to make some new friends.  See you in Houston!  http://www.xojo.com/store/#conference

 

There is No Easy Button

Most of us want an easy button when it comes to software development.  Out of the dark ages when you literally had to code everything yourself came the frameworks that did a lot of the dirty work for you and all you needed was to figure out what those framework calls were.  Tools like Xojo make this even easier because the framework has been around a long time, well known and documented, and mostly complete.  Add in the rise of internet searching and it’s quite possible to find huge chunks of code that do what you want.  Be wary, though, because that convenient piece of code you just found might have bugs in it.

The reality of programming is that any code that you didn’t write should be considered suspect.  That’s not the same thing as saying Other Peoples Code (OPC) is wrong, it might be perfectly safe to use, but you really should vet the code and thoroughly test it before putting it into your application.

I’ve seen it on the Xojo forums where someone whips out some code from memory and it contains a bug or simply doesn’t work.  The person asking the question then gets mad that it doesn’t work.  Normally the bug is simple to fix but it’s obvious that in many cases the developer getting mad didn’t even attempt to read any documentation.  Come on, people!  If it was that easy, we’d have created AI’s to do the programming by now.

Really, in the long run, you need to understand what you’ve copied.  Maybe it looks right on screen but it is horribly optimized, or worse.  Maybe it calls into the netherworld and summons Cthulhu.  Anything is possible, right?  Do you want to be responsible for the software Armageddon in your company?

Much of the example code given on the internet is lacking defensive coding for the sake brevity.  This can lead to runtime exceptions that can cause needless headaches.  If I had a $1 for every Xojo programming that’s wondered why their Recordset is coming back nil and not checking for database errors I’d could probably buy an enterprise license of Xojo every year.

It’s been my experience that any code you find you will have to tweak it (either a little or a lot) to fit the business requirements of your application.  If you don’t understand the code you’ll never be able to figure that part of it out.  Learn the individual bits of code and learn how to use the debugger for heavens sake.  The Xojo documentation has some great information.  The debugger is your friend!

When it’s your own code that you’re copying and pasting (especially in the same project) it’s a very strong indicator that you should refactor your code.  Perhaps making a global method or making a helper class makes sense.  That’s actually a good time to ask the forum on the best strategy because you’ll probably get two or three different responses.  Learning new techniques is good and in the in long run those will become new tools in your arsenal of programming tricks.  And remember that in a year or two you’ll look back at your coding today and be embarrassed (this is natural) because you’ve learned SO much since then.

There is no easy button when it comes to software development.  Even with RAD tools like Xojo you need to learn the language and the framework to bend it to your will.  Sure, use OPC as a way to learn how parts of it work but copying and pasting verbatim without learning why it works is a recipe for disaster.

Happy Coding!

ISA and Casting

One of the things that’s just not talked about much in the Xojo documentation unless you know where it is located is object casting.  ISA and Casting is so useful it’s worth devoting some time talking about it.

Let’s start with some common examples in desktop applications.  We all use the Window class.  Typically our new projects start with an instance of the Window class called Window1.  To put it another way, the Superclass of Window1 is Window.

The ImplicitInstance property of windows is subtly evil.  Subtle because if you reference anything in Window1 it gets created if it’s not already.  A lot of new Xojo developers will ask how can they tell if a window is open or not.  They’ll often come up with something like this:

if window1.visible then return true

If window1 is not open this line will actually create it!  So this is a bad thing and why I recommend that you turn off ImplicitInstance on all windows until you understand the implications.  I digress.

The better way to tell if an instance of Window1 is open is to iterate through global Window method.  You can do that by doing something like this:

for i as integer = windowcount-1 downto 0
   
   dim w as window = window(i)
   
next

This will iterate through every window, visible or not, that the application has created.  I used DownTo because many times you want to close said window and going UP will cause funky things to happen to your array of windows (I will leave this as an exercise for yourself).

If you put a public property in Window1, say, s as string.  You cannot do the following:

  for i as integer = windowcount-1 downto 0

dim w as window = window(i)

if w = window1 then
   
   w.s = "this is text"
   
end

next

The compiler will squawk with an error:  Type “Window” has no member names “s”.  This might seem mysterious, but the window returned from the Window array is a Window, not the subclass window1.  It’s an important difference.  The framework call to Window brings back a listing of all Windows even though each individual window brought back will be a subclass.  The array must all be of the same class type (Window) for it to work so the framework uses the Super.  To work with the Window1 properties you have to cast the window returned to an instance of Window1.

If you only have one window type (highly unlikely in a real app) you could simply cast any windows to window1 but that’s unrealistic.  Instead, you need to check what type it is first.  Using the ISA operator you can test what kind of window subclass it is.  If w is an instance of Window1 than you can do something with it.

  for i as integer = windowcount-1 downto 0

dim w as window = window(i)

if w isa window1 then
   
   //Do something here
   
end

next

The next step is to cast the window to the subclass.  This is as simple as wrapping the window variable, in this case w, with the name of the subclass, Window1.

  for i as integer = windowcount-1 downto 0

dim w as window = window(i)

if w isa window1 then
   
   window1(w).s = "Some Text"
   
end

next

If your code is wrong, or you try to cast it the wrong window type you’ll generate an exception at runtime that says Window1 cannot be cast to whatever the object you’ve put in.  For example, the following code generates that error:

  for i as integer = windowcount-1 downto 0

dim w as window = window(i)

if w isa window1 then
   
   window2(w).s = "Some Text"
   
end

next

This type of paradigm is common throughout Xojo.  We already know about the Window and WindowCount methods.  Another commonly used one is the Control and ControlCount on a Window.  Code like this happens quite a bit:

  for i as integer = 0 to ControlCount-1

dim c as control = control(i)

RectControl(c).Visible = False

next

This works fine as long as your control is actually a RectControl.  Not all items returned by the controls method are RectControls. Checking with the ISA operator before casting is important.

The ISA function and Casting can be an important tool in your application.  It can take what would be some tricky Introspection and turns it into a trivial piece of code.  It’s also one of those things that you don’t know you need it until you need it.

XDC 2016 Sessions Announced

Xojo announced an initial session list for XDC 2016.  The full list at http://xojo.com/xdc/HTML/sessions.html.  I’ve been told there are yet more sessions to be announced.

I’m doing a session on Reporting in Xojo and Carol is doing a session on eliminating common database mistakes.  Since we do a lot of database applications with reporting I think you’ll like our insights, processes and solutions.

I am impressed with the number of new speakers and the topics that have never been done before at XDC.  Want to learn more about developing iOS or Raspberry Pi applications with Xojo?  There are sessions on that.  Want to learn about REST web services or how to creating web API’s with Xojo?  There are sessions for those as well.

XDC is where you go to immerse yourself in Xojo for three days.  Since we are a smallish community we don’t often talk to other Xojo developers face-to-face.  XDC is where you will meet not only those that inhabit the forums but also the engineers behind Xojo.  This is the only place where you will find out about upcoming changes and additions to Xojo.

Last year Xojo recorded all of the sessions and those are available in the web store ($499).  I’ve not heard if they will record this years events but I found the recordings to be very useful because you can’t make every session.

They made this promotional video last year.  I think it’s pretty good so I’ll just let it speak for itself. I have a cameo at 1:47 or so.

Today is the first registration deadline and they are already sold half of the available spots.  More info at http://xojo.com/xdc/HTML/index.html.  Hope to see you there!

Upcoming Xojo Events

Next Wednesday, February 24th, I will be meeting with Xojo developers in the Palm Coast, Florida area. The location isn’t set yet, so check in the forums at https://forum.xojo.com/28686-central-florida-xojo-user-group and let us know if you can make it. We’re getting together at 7 PM and I hope to see you there!

March 11th, 2016 Christian Schmitz of Monkeybread Software fame is getting tougher with other Xojo folks in Chicago, Illinois near O’Hare Airport. More information at https://forum.xojo.com/28759-xojo-meeting-for-chicago-illinois. I had originally hoped to make this meeting and offer some training but I already had a commitment.

March 15th, 2016, Christian Schmitz is in Cleveland, Ohio. More information at https://forum.xojo.com/28758-xojo-meeting-for-cleveland-ohio

Monkeybread Software is hosting an event in Koblenz, Germany on May 19 and 20, 2016. Two Xojo representatives will be there for this two day event. I went to one of these events a couple of years ago and had a really good time. The Xojo conference was fun and the day after the event a number of us went on a tour along the Rhine River Valley. Fun had by all! More information at http://www.monkeybreadsoftware.de/xojo/events/koblenz-2016-event.shtml

The big Xojo event of the year is October 5-7, 2016 in Houston, Texas. The Xojo Developers Conference (XDC) will have twenty-eight speakers, thirty-five sessions, and attendees from around fifteen countries. The entire Xojo development team will be there and what’s discussed at meals and events is just as important as the sessions. It’s not an inexpensive event, but if you want to learn more about Xojo and pick the brains of Xojo experts, XDC is THE event to go to. More info at http://xojo.com/xdc/HTML/index.html.

Getting together with other Xojo developers is a lot of fun.  I highly encourage you to find other developers in your area and start sharing the knowledge!

Presentation Tips

Giving a presentation for a room full of people can be a nerve-racking experience.  I remember the first time I gave one at the Xojo Developer Conference and I honestly can’t recall how I did.  They let me speak again so I must not have been too bad.

Years later I started doing Xojo training videos and had to edit myself speaking.  It was an awful experience to listen to myself fumble through words, use necessary filler words, and clean it all up.  It was after a couple of months of doing this that I decided to get some professional training.

After some training and many more presentations and videos I feel I’m much better (but still not perfect).  Here are some simple rules for making your presentation experience better.

Practice your presentation.  This seems like such a simple thing but I’ve seen way too many presentations where the presenter get up in front of the room and you can seem them searching for words to fill the time.  Most people, when they’re winging it, use their predominate filler words.

This should rarely happen and the easiest way to avoid this is to practice, out loud, your presentation.  Even better, practice it in front of someone else or record yourself.  Then get your listeners feedback or listen to it yourself and find out where you sounded awkward or stumbled.  Those are areas to go through again so they’re smooth by the time you do it live.

Don’t Read Your Slides.  Not only is reading your slides annoying to the audience but also makes it appears like you’ve not practiced.  Whatever you’ve written on the slide should be summarized verbally.  This way the user sees a slight variation from what you said and has to think about it a bit more.  And perhaps more importantly, they’re not annoyed that you’re reading to them.

Another way to do this is use short bullet-point text and what you say is the expanded version.  The bullet-point text on the screen is the summary and what you say is the expanded version.  Either way don’t read it!

Use the Equipment Before the Presentation.  Most computers and projectors work smoothly these days but it doesn’t hurt to connect up beforehand and go through some slides just to make sure it works properly.  This way your presentation starts properly and you don’t have to apologize and take time out to fix things.

As a software developer talking to other developers it’s common for me to give a demo that’s not in Keynote or PowerPoint so I’m switching from the presentation mode to the computer view.  When doing this make sure you have someone in the back of the room give you feedback on sizing of text and pictures..

I can’t emphasize this last point enough.  With todays high resolution monitors what looks huge on our big, Retina display may look tiny on the projector you’re using and impossible to read in the back of the room.  You might have to adjust the resolution on your computer to make it larger.  Make sure any application you’re using at this lower resolution works properly too and settings adjusted beforehand.

Another good habit to get into is look at the colors your using.  On your monitor they might look really nice but on a projector in a well lit room they may look washed out and impossible to read.  Using a dark purple on a black screen might be a bad choice as well as using green on a white background.

Any text you have on your slides should be as large as possible.  Despite looking awful on your monitor the people in the back of the room will appreciate being able to read it.

Never Go Off Script.  If you’ve practiced your presentation you should have it down pat.  Do not decide during the presentation to add additional information or demo something you didn’t practice.  From my own experience this where things go off the rails.  In the heat of the moment words can fail, filler words come out, and it’s an overall awkward moment in an otherwise good presentation.  On the flip side, if you can think of additional material add at the last moment you probably didn’t practice enough.

If you have a Q & A section of your presentation you can bring it up then or wait for someone to ask about it.  This is meant to be an unscripted portion of your presentation so people will give you some slack.

Breathe.  This seems simple, but I’ve seen a lot of speakers get up and be in such a rush to get their presentation underway that they forget to breathe.  Proper breathing technique means giving the audience a chance to process your information before going on to the next topic.  Wait a second or two before advancing your slide.

What seems like an eternity of empty space for you is good for the audience.  Silence does not have to be filled by you.  Respect your audience and give them time.  Respect yourself too because that pause to breathe is also time for your brain to start formulating your next thought.

My own personal issue with this is in the Q & A session.  Because it’s off script and somewhat random it’s easy to rush into it.  Try to take a deep breath before starting the answer and take another one after you’ve finished.  Again, this is as much for the audience as it is for you!

Get Training.  All of these tips are incredibly hard unless you practice.  You can learn them on your own and I’ve met some very talented natural speakers that can do this.  Most people aren’t naturally talented enough and have to work at it.  I highly recommend joining an organization, like Toastmasters, that can help train you on public speaking.  They are an international organization and there are chapters everywhere.  Their entire purpose is to help you succeed with public speaking.

Giving a presentation doesn’t have to be a stressful experience for you or your audience.  Use these techniques to polish and put a shine on your presentations.

What presentation tips do you have that I missed?

Listbox and Tag Options

The Listbox is a very powerful control, in my opinion.  Out of the box it doesn’t have a lot of capabilities but it’s easily extendable and it’s possible to create some complex grid-like applications using the standard Listbox.  Is it perfect?  No, but it’s more than adequate for most developer needs.  There are a number of options for showing and storing data.

A new user to Xojo recently asked me about the various tag options in the Xojo Listbox.  She wasn’t sure when you’d want to use RowTag versus ColumnTag versus CellTag.  It was a good question – I hadn’t given it much thought.  I like questions like this because it forces me to think like a new Xojo developer.

Most Tags in Xojo are the Variant datatype and that means they are very good at storing whatever you want in them.  We often say, “just stash the data in the tag”.  Since you can put practically anything in a variant it’s very convenient to use it.  I suspect that whenever the new framework makes it into UI elements the tag will turn into an Auto variable (which will lead to interesting problems but that’s a post for another time).

When it comes to the Xojo Listbox, I know some Xojo developers like to make columns of zero width and put data in these hidden cells.  I dislike this approach for several reasons.  One, it limits what the listbox GUI can do.  A zero width column means that you probably don’t have column resizing on (and if you do the columns are accessible to the user).  Two, it’s not how the control was intended to be used.  Three, we have Tag options to eliminate the need to do this.

We predominantly use the Listbox.RowTag property to store our data.  A vast majority of our projects are database driven and since we use ActiveRecord a lot we almost always have a class object (the ActiveRecord object) that has our record stashed away in the RowTag property.  The listbox may only have 2 or 3 visible columns of data but the ActiveRecord object might have dozens of properties (which reflect the fields in the table).

This gives us the advantage that we only have to query the database once and that’s to load the listbox.  Subsequent edit/update and delete operations simply use the object that’s already in the RowTag.  The user selects the row, we get the object out of the RowTag property and then pass it on to whatever method needs to work with it.  This fits 95% of everything we ever do with a Listbox.

The CellTag comes in on projects where we’re not using ActiveRecord.  Things like preferences come to mind where it’s data but not database related.  We load the Listbox cell data with what the user can edit.  Then, in the CellTag property put a copy of the visible data so later on we can compare the Cell text to what’s in the CellTag.  Even in this case, though, we still use the RowTag property for identification purposes.

Using the CellTag and comparing it to the Cell text is convenient when doing inline-editing of the Listbox data.  The comparison can happen at the Cell Lost Focus event or in a generic Validate method before saving the data.  Either way, the CellTag data is ‘hidden’ and the user can’t mess with it.

The ColumnTag has been around a couple of years and I can’t say we’ve used it much.  I can see the benefit of using it, however, to make things like Pivot Table using the Listbox.  This isn’t a trivial task, mind you, but I would treat it like the RowTag.  It’s there for use and I’m sure someone out there has a reason to use it.

If you find yourself making zero width columns to store data in your Listbox you should look at the various Tag properties.  Trust me, it will make your application work better and be safer with your data.

What interesting things do you use Listbox tags for?

Xojo Conference in London

With a little over a week to go there’s still space available at the MBS Conference in London the 27th of November.  It will be held at the Antoinette Hotel in Wimbledon which is a part of greater London.  The conference homepage is at http://www.mbs-plugins.de/archive/2015-11-11/Schedule_for_MBS_Xojo_Conferen/monkeybreadsoftware_blog_xojo.  There are still spots available!

This is during the Thanksgiving Holiday weekend for the United States but if you want to avoid your crazy relatives join us in London and get your geek on.  Airfare is reasonable this time of year to London.

Give it some thought and think about joining us.  I went to one of the conferences in Koblenz, Germany a few years ago and had a blast.  There is nothing like getting together with like minded people to chat about your favorite development tool.

I’m going to give a presentation on BKS Shorts and the new Report Designer that will soon ship.  I think people will be very happy with the ability to embed a report designer into their applications AND have the ability to modify the UI as they see fit.

You Don’t Need to Be A Rock Star

I have been a Xojo consultant for nearly fourteen years.  It’s crazy to think it’s been that long and it’s sometimes hard to remember back to the early days of how I knew nothing and didn’t even realize that I knew nothing.

It also tickles me to no end that people consider me an ‘important’ person in the community.  Some might even consider me a ‘rock star’.  I claim no fame in the Xojo world other than I’ve stuck it out when many other developers have left the Xojo ecosystem.  Let’s just say that at times I feel like I’m the Last Man (consultant) Standing.

Can you become a Xojo consultant?  Absolutely!  There is nothing special about what I’ve done and you can do it too.  I have an electrical engineering degree so it’s not like I’m an idiot and it wasn’t until I met my wife who happened to be a software developer that I was given permission to change careers.

In retrospect that was the best thing that ever happened to me (besides meeting the love of my life).  I was an uninspiring engineer and I dreaded many of the tasks that I performed on a daily basis.  Software development, on the other hand, inspires me.  I wake up every day and (usually) can’ wait to start coding.  The fact that I get paid to do it is just icing on the cake.  To get paid to do what I love?  Sign me up!

If you know a little bit about Xojo you can become a consultant.  First, ask yourself WHY you want to be a consultant.  If it’s for the money don’t expect it to happen right away.  I think it was two or three years before we really made any money at it.  It took six years before I hired a second developer and ten years before a third and twelve before bringing my wife on as a software developer (she had always been doing those pesky taxes and payroll things that I hate doing).

So if you do become a consultant don’t expect to make money right away.  Or if you do, don’t expect the money to be consistent for a number of years.  Even now we fight with cash flow so it takes some discipline to ride out the really good times when cash flow is great and the not-so-good times when cash flow is poor.

The road to becoming a ‘name’ is not a quick one.  I spent many years in obscurity.  The first developer conference I went to I was a wall flower and barely talked to anyone.  By the third conference I co-hosted a session with another consultant because I didn’t feel like I was qualified enough to do it on my own.  Now I’m a regular presenter at the developer conferences.

One way to become a recognized name in the community is to teach others.  I’ve written a fair number of tutorials and example projects and I decided to doing video training and so far I’ve got about sixty-two hours of video available for streaming (and offline use now) with hundreds of individual videos and project files for new developers to learn from.

I think this is the part that makes people think that I’m a ‘rock star’.  I get people coming up to me all the time at conferences and engaging me in conversation and thanking me for some forum post, tutorial, or training video that made a difference for them.  It’s gratifying and sometimes a little scary (as an introvert) to have people do that.

Here’s my dirty little secret on those tutorials, example projects, and training videos.  Those are my way to learn something about Xojo and leveraging that experience for others.  Put another way:  The best way to learn something is to teach it to others.  If you are not doing something like this (maybe not for sale but for yourself) you should be.  That’s the only way you’re going to learn parts of Xojo you don’t know as well.  You really don’t want to learn new stuff on client projects (though it does happen occasionally).

As a consultant I don’t know everything.  There are still things that I’ve never touched in Xojo and things that I touch so rarely that I have to go relearn it.  Those small projects become invaluable review later on.

I don’t want to discourage anyone from becoming a Xojo consultant.  It’s not an easy road at times and it is sometimes frustrating and you put in long hours and you deal with bad clients and all the really bad things that come with consulting.  But the money can be good, it can be fun, it can be rewarding, and some clients you’ll be friends with for many years.  If you love, truly love, coding and enjoy the mysteries of it and putting the pieces of the puzzle together then maybe you, too, can become a rock star consultant.

Happy coding!