Naming Conventions

If you don’t have standard naming conventions in your Xojo (or any other language for that matter) project you need to start NOW.  I mean it.  Open your IDE of choice and start looking at your variable names.  Can you tell at a glance what type of variable it is?  Better yet, can you tell what it does?  Or do you have a bunch of x, i, y, and z’s floating around in your code?

What about your TextFields?  Do you name them so you can tell their function or do you simply use the default name that the IDE gives you?  How do you tell the difference between TextField1 and TextField2?

Literally, the first thing I do when handed an OPC (Other Peoples Code) project is to look at the control names.  If I see TextField1 and TextFieldX I will almost always turn the project down.  But if I see txtName and txtAddress I know that I can figure out the code without constantly having to look at the Layout Editor.  The point is that controls are referenced in Xojo code all the time so if you’re naming your controls so that their function is obvious, the code will be obvious too.

The same goes with variable names.  I will prepend arrays with ar so that an array of MyClass will always look like aroMyClass.  My dictionaries always have dict in the front.  Colors always have c prefixes and so on (see chart below).

Do I use the occasional i, x, y and so on?  Absolutely, but they are throw away variables that are inevitably part of a loop of some sort.  If I’m using that variable for any other reason I will always name it something useful.

Variable names are important.  Rarely will you see me using iTemp as integer.  Instead, I’ll use iTempIndex which will at least tell me something about the variable.

I dare you to look at a project you did a year ago and open up any random method in it.  Can you read the code without referring to the Layout Editor?  I know that I’ve refined my own coding standards because of this.  If you’re not learning from your past mistakes why keep doing what you’ve always done?

I can hear some of you now.  Standards…Pft!  I don’t need no stinkin’ standards.  Think again.  I’m not here to tell you what those standards are just that you have them and that you are consistent about them.

Do what makes sense to you.  I looked at hungarian notation (http://en.wikipedia.org/wiki/Hungarian_notation) and I can see why people call it a different language.  While I’m sure it has many fine qualities it seems to make more work for me in figuring out what the variables are doing.  It’s way too complicated for Xojo.  For me, at least, simpler is better.  Plus, I’m not sure that a strongly-typed language like Xojo is in need of such strong naming conventions.

Using naming conventions for your controls and variables is an easy way to simplify your life and your clients’ life (if you’re handing code over).  Remember, you’re not just coding for the here and now, you’re coding for someone that will look at the code 6 to 12 months from now.  That someone might just be you!

Below is values right out of our new developer introduction document:

Variable Prefixes
Datatype Prefix Example
string s sName as string
integer i iCnt as integer
double d dAverage as double
dictionary dict dictNames as Dictionary
date dtm dtmModified as New Date Assumes I care about the time
date dt dtToday as new Date assumes I do NOT care about the time
class reference o oMyClass as new clsMyClass
color c cHighlight as color
folderitem f fPic as FolderItem
private property m miCnt as integer
boolean b bVisible as boolean
memory block mb mbBuffer as MemoryBlock
window win winMain
class name cls clsMyClass
array ar arsNames() as string ardAverages() as double aroMyClass() as clsMyClass
Control Prefixes
Control Prefix Example
Pushbutton btn btnSave
Label lbl lblCaption
Listbox lb or lst lbPeople or lstPeople
StyleGrid sg sgPeople
TreeView tv tvSections
TextField/TextArea txt txtPassword
CheckBox cb or chk chkEnabled
BevelButton bb bbSelect
ComboBox cbo or cmb cmbUserType
PopupMenu pm pmState
ProgressBar prog progUpload
Scrollbars see example common practice to use vScroll and hScroll
Radio Buttons rb rbOption1
Canvas cvs cvsGraph
TabPanel tab tabMain
Toolbar tb tbMain
PagePanel pp or page ppSection
Menu menu menuPopup
Container Control cc ccDetails

Xojo Webinar: Xojo Consulting

For some time now Xojo has been doing webinars on various topics.  It’s a great way to learn about Xojo.  In addition to being live (where you can ask questions) they are recorded too.  As time goes on the webinar archives become a really nice resource for new Xojo developers and even experienced developers can learn a few things too.  If you’ve never been to the archive, check it out!

Join me at the next Xojo webinar, Tuesday, July 22,  where I’m guest host!  I will share my 13+ years of Xojo consulting experience.  Learn some of the great things (and not so great things) about being a Xojo consulting.

Come prepared with questions!

Register now at http://xojo.com/support/webinar.php

Classic Visual Basic Is Truly Dead

Developers love Visual Basic.  The site http://www.classicvb.org/petition/ has received well over 14,000 signatures since its inception in 2005.  In the user forums for Microsoft Visual Studio there is a place where developers can make suggestions.  This one http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3440221-bring-back-classic-visual-basic-an-improved-versi wants to bring back class Visual Basic.  Since December 2012 it had received over 7,400 votes.  Microsoft essentially told VB6 developers to kiss off this week.

The only bit of good news, in my opinion, for VB6 developers was that the VB6 runtime will continue to be supported through 2024.  So, VB6 users, you’ve got 10 years to figure out what’s next.

The VB6 runtime it is still a component of the Windows operating system and is a component shipped in Windows 8.1. It will be supported at least through 2024.

The 1100 (and growing) comments to this post are pretty much what you’d expect.  There are a lot of frustrated VB6 developers that feel Microsoft has abandoned them, at best, and, at worst, actively screwing over one of the most vibrant developer communities on the planet.

Many VB6 developers feel that .NET is inferior to VB6 but yet Microsoft is confident that VB6 developers will somehow migrate to .NET.  I just don’t see this happening.  Oh, I’m sure some will bite the bullet and learn .NET but the prospect of learning a new language and rewriting their apps does not make many happy.  VB6 was effectively killed 10 years ago and yet there are still lots of VB6 developers out there.

Many will be looking at alternatives because Microsoft is not the 95% market share behemoth it once was and VB6 was, after all, Windows only.  I you have to go to the trouble to learn a new language and rewrite all of your apps why not look at something that can work on Windows and Mac and possibly Linux as well?

I spent many years working in VB6.  I liked the language, I liked the IDE.  It had some awful quirks that drove us nuts but they were well documented quirks and were relatively easy to work around.  When I first encountered Xojo (then REALbasic) I felt like I found VB’s kissing cousin.  The IDE’s were similar, the language was similar and it was relatively easy to convert code and community was outstanding.

After twelve years of using Xojo I can say it’s superior in some ways.  First, it’s kept up to date and gets roughly 4 updates a year.  This is both a good and bad thing.  Good because when Apple (and to a lesser extant Microsoft and the Linux Distro’s) change things you’ll know that it’s just a matter of a few months, usually, before a new version of Xojo is released.  Unfortunately this makes Xojo a moving target which is part of the reason why there aren’t any books on Xojo.  It gets written and by the time it’s published it’s already out of date.

There are a number of things that VB6 was just not good at.  Subclassing controls was impossible and we never got threads to work right without causing serious crashing issues (I believe I recently saw a post where they got threading working properly in VB6).  But that still leaves all the other things that were feeling their age in VB6.

I’m biased for Xojo.  I think it’s worth taking a look at if you’re a VB6 developer.  Is Xojo perfect?  Hell no.  The developer community is much smaller and there aren’t nearly as many control options.  And some of the controls, the grid in particular, are inferior to what many are currently using in VB6.

Xojo is, in many respects, a compromise.  All of those fancy grids you see in Windows apps usually don’t exist on Mac OS X and Linux.  Mac OS X apps are generally built with a different UI mindset so the the grids aren’t nearly as busy.  If you planned on doing the same thing in Xojo you will be in for a rude awakening.  Not that you can’t make a complicated grid, but you’ll spend a lot of time getting it to work and even then I’m not sure you’ll be happy with the results.  Plus, Mac users are a finicky lot and if it looks like a Windows port they might reject your app.  But then again, does the utility you wrote for your company really need a fancy UI?

Xojo is very cool sometimes.  The ability to remote debug applications from my Mac to a Windows or Linux computer is very handy.  And the fact that a Windows machine can build for Mac OS X and Linux, for console, desktop and web apps, is also very nifty.

Take a look at Xojo (it’s free to try!).  It might be a good solution for you.  My advice is to not try to ‘convert’ your VB6 app using The Migration Assistant or any of the conversion tools available.  There are just too many language and control differences to make this feasible.  From experience, you’ll spend more time fixing code than if you had just started from scratch.

My other bit of advice is to not assume Xojo and Xojo made apps work just like VB6.  They don’t.  Take the time to read the documentation, look at the example apps, and visit the forums when you have questions (you’ll have many).  The Xojo community is very welcoming and eager to help.

Finally, I am a consultant and if you need assistance getting into Xojo we can help.  My team has rewritten dozens of commercial VB6 apps over the years.  If you’d like a quote feel free to download our VB6 analyzer tool at http://www.bkeeney.com/vb2rbconversion/.  We also have over 50 hours of Xojo and Real Studio video tutorials available to subscribers at http://xojo.bkeeney.com/XojoTraining/ where we’ve helped thousands of developers get a handle on Xojo.

If you are a VB6 developer, Xojo might be for you.  Welcome to the Xojo community!

 

New Web App Training Series

BKeeney Software is proud to announce a new 4 1/2 hour video training series for subscribers at http://xojo.bkeeney.com/XojoTraining/.  The new LinkShare Web App series takes budding Xojo developers from nothing, to a fully functional web application.  This eight part series is designed to familiarize the beginning and intermediate developer on how Xojo web applications are created and how to create the basic infrastructure required for most modern web applications.

Just a few of the topics covered:
• Project organization
• Database integration using ActiveRecord and ARGen
• Safe password handling, storage and login procedures
• Sending emails and how to communicate with the app via URL parameters
• Basic WebStyles
• Basic WebPage, WebDialog and UI layout and interaction
• Much, much more

The series comes with source code the Xojo developer can use in their own projects.

BKeeney Software has 183 separate videos, with over 52 hours of Xojo and Real Studio training video and source code at http://xojo.bkeeney.com/XojoTraining/.  The site is a Xojo web app and has served up over 7,750 hours of streaming video to thousands of developers since it went live.

More information at http://xojo.bkeeney.com/XojoTraining/ or contact Bob Keeney at support at bkeeney dot com.

Last Call for Training Day

The response for our XDC Training Day in Las Vegas hasn’t been as good as we had hoped.  If we don’t get a few more attendees, we will need to cancel the event.  That would really bum us out.

The Training Day is a huge commitment for us since we have our entire staff at the event helping answer questions.  Not only does this include an extra day of lodging and meals it takes away from our consulting business.  As a consultant if we’re not coding we’re not getting paid!  On top of all that, I do a bulk of the preparation and much of the training.  Not only does that take away from my consulting time it takes away product development, writing, and video production of training videos.

This year is a little different too.  Attendees get to help choose the agenda.  We are running out of time available to incorporate agenda changes into the syllabus.

We need a few more attendees or it just isn’t worth it for us.  To entice a few more people we’re rolling back the pricing for another week.  The price remains $350 until Saturday, February 22nd.  Attendees also receive a complimentary three month subscription to our online videos – that’s over 40 hours of video and over 100 Xojo and Real Studio project files you can use in your own code.

We want to see you the day before the Xojo Developer Conference!

More info and to sign up please see http://www.bkeeney.com/xojo-training-2014/

XDC Conference and Training Day News

Xojo sent out a notice to speakers this morning about due dates for session presentations for the Xojo Developer Conference.  You don’t need to care about the presentation deadline but that’s just a reminder that I need to get my act together because not only do I have two presentations to prepare for BKeeney Software is doing an entire day of training before the conference (note to self, start talking to myself all day long to get voice in shape).

They passed along another nugget of information that I thought was interesting.  They only have 10 spots left!  If you’re thinking about attending the biggest Xojo developer conference of the year, NOW is a good time to register.  February 14th is the deadline for early registration.

Speaking of deadlines, our pre-XDC Training Day early registration ends on February 14th as well.  This years training day is more hands on then last year and we are getting attendee feedback ,when they sign up, about the topics they want covered.

The morning session is all about desktop applications and so far we have some great suggestions that include Containers are Your Friends, Reducing Windows Flicker, Preferences, Updating UI from Threads, Window Menus, Remote Debugging, Power PostBuild Scripting, and more.

The afternoon session is all about web applications.  Great topics here, so far, too.  Suggestions so far:  Basic Web Application Concepts, Web Security, Dynamic Web Dialogs, Sending Emails, Special URL Handling, Reporting, Containers are Your Friends, Communicating with Desktop Apps, and more.

I think we have way more material than we have time but hopefully we can help some developers with their particular questions.  Our entire team will be there so we should be able to show some love to everyone.  Each attendee also gets a complimentary 3 month subscription to our Real Studio/Xojo Training Videos.

I LOVE the Xojo developer conferences.  If I have not met you yet, please make sure you introduce yourself.  Maybe I can answer a question for you, or perhaps direct you to another developer that knows a topic better than I do.  You will find no bigger density of Xojo developers at any single gathering than this conference!  You can talk about Xojo all day long and well into the night.  Cheers!

2014 Training Day Early Registration Price Ends Next Week

Bob KeeneyThe early bird pricing for our 2014 Xojo Training Day ends on December 31st.  Save $200 off full price for our full day of training.

Join us in Las Vegas, Nevada on Tuesday March 25th (the day before the Xojo Developer Conference), at the Monte Carlo Hotel and Resort, as the BKeeney Software staff walk you through creating desktop and web applications using Xojo.  This is a great opportunity to ask questions about your own projects and project needs.  Join the BKeeney Software staff as we share our experience using Xojo (and Real Studio) for the past thirteen years.

More information can be found at https://www.bkeeney.com/xojo-training-2014/.  More information on the Xojo Developer Conference can be found at http://www.xojo.com/xdc/

Place a sure bet with BKeeney Software.  See you in Vegas!

Training Video: Charts & Graphs

We have a video request form at our Xojo Training area.  The number one request was for a video on how to do charts and graphs in Xojo projects.  Today we uploaded the 34 minute video giving you a few of the commercial options available.

We then use ChartDirector from MonkeyBread Software to create a simple bar and line graph (project included).  We decided to use ChartDirector simply because we use it in our own products as well as for our clients.  It’s kind of pricey, but it does 30+ types of charts and graphs, is high configurable, and is fast. It also runs in desktop and web apps on Mac, Windows, and Linux.

One of the things that I enjoy about doing the videos is learning some things myself.  I’ve always just sort of hacked my way through ChartDirector by copying/pasting code from the many examples.  ChartDirector has a ton of options and is rather complex.  Hopefully my short video helps you out.

Direct Link for Subscribers:  http://www.bkeeney.com/XojoTraining/xojotraining.cgi?video=322

As always, please ask for videos!  It helps me set my priorities.

Training Day Video Online

We held a full day of training the day before the Xojo Developer Conference (where we couldn’t use the term Xojo yet) on April 23rd.  We had over a dozen people at the training day where we discussed what we knew about databases.  We did that for most of the day and then spent the rest of the day going over 3rd party plugins, controls, libraries, and utilities to help you get your Real Studio/Xojo apps going.

We recorded all of it and have rendered it all (except a 30 minute portion where the mic wasn’t on) and made it available for our Real Studio/Xojo subscribers (as well as attendees who got a year subscription for attending).  It is now available online at http://www.bkeeney.com/RealStudioTraining/realstudiotraining.cgi

Because it’s Friday and I don’t feel like doing any real work, I decided to pull some stats about our Real Studio training app:

It was originally written in a fairly popular web CMS framework.  It was re-written using Real Studio Web Edition (because we could) and went live in late 2011.

We have 39 hours 44 minutes of Real Studio training video available.  A little over 6 hours of it is available to non-subscribers.

We have served up over 4,800 hours of streaming video since we began tracking it.

We have a little under 1000 registered users on the web app with about 100 current subscribers.

Web Edition has been interesting.  The training area has been our test bed of new for new versions of Real Studio Web Edition and now for Xojo.  It continues to grow as Web Edition gets better.

Browser stats actually surprised me a bit.  FireFox is stronger than I anticipated and Chrome is much higher than I expected.

Likewise, platform usage surprised me a bit with Windows users at 41 percent.  I know very few Windows-only Real Studio/Xojo users so perhaps this just indicates that I travel with a Mac-centric crowd or a lot of Windows users are looking at Real Studio/Xojo and need some additional help.  When I get a chance I’ll have to see if I can figure out the stats of subscribers vs. non-subscribers.

Browser Usage

 

Platform