Archive

Archive for the ‘Programming’ Category

Review of REAL Studio 2010 Release 3

July 27th, 2010 Bob Keeney 8 comments

My review of REAL Studio 2010 Release 3 is up on the ARBP site.

Bottom line is that Cocoa isn’t ready for prime-time yet (obviously since it’s labeled as BETA), but it is nice to see what they’ve been working on.  I urge you to try it out and report the bugs you find (which shouldn’t be hard to find).  The more reports RS has on Cocoa bugs the better Cocoa will be eventually.

RBScript is still a mystery.  I don’t use it any of my projects and I don’t know of many developers using it.  With a new compiler (LVVM) behind it I expect it to break some projects.  Again, finding and reporting the bugs will help all of us.

Console applications being able to access the graphics classes seems like a recipe for disaster in certain situations.  If you use console apps a lot what is your opinion of this change?

What is your opinion of Cocoa, RBScript and Release 3 in general?  Did I get anything wrong?

Categories: Opinion, Programming, REALbasic Tags:

Serial Control in Windows Vista/7 Doesn’t Work Properly

July 9th, 2010 Bob Keeney 2 comments

I’ve had one of those weeks where I thought I was going crazy (crazier?).  My cross-platform application that works fine on Mac OS X was behaving very strangely in Windows but only sometimes.  This particular application talks to a hardware via a serial port.  My standard test platform is Windows 7 with Windows XP as the secondary and both of these are run in VMWare on my Mac.  So a bunch of things might be at fault but after trying this out on an old Windows XP laptop I quickly narrowed the problem down.

The data packet the hardware device sends is very small – 4 characters to be exact.  What I was experiencing was that RB captured the first character on the first send – but not the whole packet.  Then it would complete the first message on the 2nd message and only get part of the 2nd message.  It would go something like this:

  1. A
  2. B | A
  3. C | A
  4. D | A

Where A is common to all messages so they should be AB, AC, AD and so on.

These messages in the real world are sporadic and with the exception of a regular hardware pass message it might be days or weeks in between messages so as you can imagine, this problem mucks up the logic quite a bit.

If you are not familiar with the Serial control, the DataAvailable event fires when there is data available (duh) and there you can check what’s in the serial buffer by using the LookAhead function.  LookAhead in this case showed just the first character.  The other property to check is  BytesAvailable which should tell you how much is still in the buffer.  It simply returned zero so I should have a complete message.  Definitely something screwy going on there.

Invoking Serial.Poll via timer did not produce any different results.  Neither did forcing a ReadAll.

One other thing that I discovered was the Serial Port Monitors are worth their weight in gold.  Using one, you can at least verify that the data got to the computer.  A free 14 day trial was good enough but if I do any other serial projects it will be worth it.

The good news is that I wasn’t crazy.  The client is okay with Windows XP for now.  The bad news is that it might take a release cycle (or more) to get it fixed. Oh well, battles for another day….

For those that care, the Feedback id is 12723.

Guidelines

June 11th, 2010 Bob Keeney 9 comments

As you start to code all day, every day, you start to develop your own set of guidelines.  I’d call them rules, but since I break them often enough I have to call them guidelines.  Since I deal with my own code and Other Peoples Code (OPC) on a regular basis here are my guidelines (in no particular order):

  • Name any control you reference in code.  It needs to make sense to you.  If you have a bunch of Pushbutton1, Pushbutton2, etc. pushbuttons you are causing yourself grief in the long run.  You’re coding not only for right now, but for 5 years from now when you’re not intimately familiar with your UI and you want to make a change or fix a bug (or hand it off to a consultant).
  • If you find yourself copy/pasting code over and over again you should think about a global method or perhaps a subclass.  I’m talking about the MessageDialog alerts, the ComboBox helper code, etc.  The reason this is a problem is that if you have the same code all over the place and you have to change it, you then have to change it everywhere.  The chances of missing one hase big bug implications and your clients/customers may not appreciate the bug.  This is called, by the way, refactoring and it’s not a bad thing to do.
  • Big, huge, monolithic methods/functions are not good.  My general rule is that if my method is over a screen length I start looking at ways to break it up into smaller chunks.  This makes it easier to debug too since the runtime exception doesn’t have line numbers on where a bug occurred.  All it can give you is what the error is and where it occurred (and even sometimes that’s not reliable).
  • Name your variables something that make sense to you.  You need to come up with your own guidelines, but the reason is the same as naming your controls.  You should, at a glance have some level of understanding of what the variable is for.  I don’t name loop variables (i, j, k, x, y, etc) unless I have nested loops.  Some would argue that prefixing your variables is a dumb idea because RB is very strongly typecast and if you change the type you then have to change the prefix.  Um…sure…that’s what global search and replace is for.  But I can tell at a glance what type the variable is.
  • Name your methods/functions something that make sense.  Same reasons as above.  If you can’t figure it out at a glance what it does, then you might need to rename it.
  • One that keeps haunting me (in other words I haven’t always learned the lesson on this) is to use a thread whenever there’s a tight code loop.  It always seems that during testing I have far less data than I will in real life so that tight loop that only takes a blink during development takes seconds in production and causes the app to ‘freeze’.  Threads are a natural way to solve that problem.  I urge you to not use refresh statements in your loops – instead use a thread.  Of course threads aren’t perfect in that you then have to worry about how you update UI but if you have the Thread in the window you’re generally pretty safe.
  • Test your cross-platform apps on each platform.  Don’t assume that your Mac OS X application created in RB will look good on Windows and vice versa.  Trust me on this one.  Depending upon what you’re doing, Windows can be hugely different performance-wise than the Mac and Linux.  Double-buffering is standard on Mac OS X and Linux but NOT on Windows so that really great looking custom control on Mac/Linux looks just awful on Windows because of flickering.
  • Project organization is important.  As your project gets bigger and more complicated having the big monolithic list of objects becomes harder to find things.  I generally start with Application, BKS, Others, and Assets folders in my projects and put everything in those folders.  The assets folder is icons and any other graphics for the projects.  The application folder has all app object, all the windows and application specific objects.  The BKS folder contains my own toolset of classes, subclasses, extensions, etc that I’ve written and use in most projects (I generally try to retain rights to any code in this folder).  In the others folder is my toolset of objects that are from others and I don’t claim that I wrote.  Some of these are encrypted and others are not.  Keeping your project tidy is a good thing.
  • Code first for functionality and once it’s working you can test for efficiency.  I’ve found that some things I thought would be slow weren’t and some things I thought would be ok weren’t.  Get it working first and THEN worry about it.

Those are mine off the top of my head.  What guidelines would you share with someone new to coding and/or REALbasic?

Visual Studio For the Mac?

May 26th, 2010 Bob Keeney 5 comments

Interesting little blurb at http://blogs.barrons.com/techtraderdaily/2010/05/26/apple-will-steve-ballmer-show-up-at-the-wwdc-keynote/ about Microsoft presenting at Apple’s World Wide Developer Conference (otherwise known as WWDC) to show off Visual Studio for iPad/iPhone and general Mac OS X development.

Geeze.  How many levels of wrong is this rumor?  You think Apple is going to trust Microsoft with the keys to their iPhone/iPad kingdom?  I don’t think so.  Apple has worked too hard building xCode and Cocoa Touch to let a 3rd party develop for iPhone/iPad.  If this does happen, then Apple might as well give Adobe a call and let them know they can restart their iPhone/iPad programs too.  And we all know where that feud isn’t over yet.

Where this might make sense is desktop applications.  Microsoft, while doing all that work to write Microsoft Office for the Mac in Cocoa, wrote their own Cocoa libraries and other Mac GUI editors and put it into Visual Studio.  Seems like an awful lot of work with minimal gain for Microsoft unless they’ve decided to make a push in REAL Software’s corner.  They certainly have the knowledge and resources to do such a product.

While I don’t think this rumor has legs it does make you think.  No doubt Microsoft is feeling the pinch of developers learning Cocoa which does nothing for Microsoft.  If they developed a cross-platform Visual Studio it stems the bleeding because now developers don’t have an either/or decision to make.  Learning a new development tool and frameworks suck and letting all those Windows developers develop for Mac and Windows using their tool keeps Microsoft in the game.  It doesn’t help them with iPhone/iPad development (now) but in five years who knows.  If it does happen it will generate some serious buzz which is something Microsoft wants (needs?).

What does this do, if true, to our favorite development tools company located in Austin?  I don’t think it would be good news.

Learn REALbasic With Video Training

April 16th, 2010 Bob Keeney Comments off

We (BKeeney Software) updated our REALbasic Training Videos today with H.264 video as the default rather than Flash.  This allows access for iPad and iPhone users.

We have over a hundred videos and around 20 hours of training videos.  Our Journal Entry project, a simply diary application, goes through the process of creating a REALbasic database application from start to finish.  While we do all of the development on Mac OS X, we regularly go into Windows and Linux and explore the differences between controls and how to workaround those differences.

If you’ve ever wanted to see how other people use REALbasic, this is an excellent opportunity.  We have around two hours of free video (with registration).  Subscriptions are available and if you’re a student or educator, contact us to get up to 40% off full price.  ARBP paid members can get a 20% discount.

So far we’ve been getting excellent reviews!

[Updated]  Part of my motivation to moving to H.264 was to view the videos on my iPad.  The iPad is a really good medium for video training because it can run beside the desktop/laptop computer and you can do the same things in REALbasic while I’m showing it to you in the video.  Video on the iPad is gorgeous!

REALbasic for iPhone Revisited

April 8th, 2010 Bob Keeney 12 comments

The iPhone 4.0 SDK was announced today by Apple.  It has a ton of new features and most are welcome.  It’s not all good news, however.  Stuck in section 3.1.1 of the new iPhone Developer Program License Agreement is the following:

Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).

Wow.  I find this to be simply, and utterly, the most arrogant thing that Apple has done in my many years of being an Apple fan.  I find this to be distasteful in the extreme.  Words can’t describe how angry/disappointed I am in the “Think Different” company.

Now lets talk about the debate we had a while back of REALbasic making apps for the iPhone.  In my debate with Marc Zeedar for March/April 2010 issue of REALbasic Developer Magazine I said this:

An iPhone version depends on the willingness of Apple to let REAL Software play in their court. I have my doubts that Apple would do that simply because all of those 140,000+ iPhone applications they’re touting were developed on a Mac. Letting go of those hardware sales is not in Apple’s best interest economically. Not only that, but letting RS create iPhone apps now makes Apple dependent upon a third-party to issue bug fixes in the framework and be up-to-date whenever a new SDK is released.

I think today’s new license agreement proves my point.  Apple is going to control everything and if you don’t want to learn Objective-C and use XCode and CocoaTouch too bad for you.  Apple controls the entire ecosystem and they are not going to let anyone play in their court.

Much will be said in the upcoming weeks and months about the new license agreement.  The anti-Apple folks will use this to bludgeon the advancement of the iPhone and iPad into the corporate environments.  What will pro-Apple folks do?  Shut-up and start learning xCode and Objective-C because there’s not much to defend.

Will it always be this way?  I don’t know.  But I do know that nothing will change unless Apple starts losing money and by all accounts that’s not going to happen any time soon.

Categories: Opinion, Programming, iPhone Tags: ,

What Does ‘Feature Complete’ Mean?

February 7th, 2010 Bob Keeney Comments off

Someone asked me the other day what ‘feature complete’ meant.  I replied that I felt it meant that everything you intended to put into the application is there and not missing.  Other people gave other responses but it got me to thinking.

Here is the definition of ‘feature complete’ from Wikipedia:

A feature complete version of a software is not yet final, but contains all intended functionality of the final version.
Usually a feature complete software still has to undergo testing and bug fixing as well performance or stability enhancing before it can go to release candidate and finally gold status.

I think the semi-permanent beta status of open source and web software skews our expectations.  We’re so used to the term ‘beta’ being applied to software we’ve really lowered our expectations of software.  It used to be that software at the ‘alpha’ stage was feature complete but functionality could significantly change with usability testing.  ‘Beta’ stage was when all functionality was complete and usability testing started, usually by allowing a bigger group to test it.  Any bugs get fixed and a new beta version is released to make sure the bugs were fixed and no new bugs introduced.

Finally, the ‘Final Candidate’, or ‘Release Candidate’ was a fully functional version of the software that if everything worked properly it would be released to the public.

The Wikipedia definition for ‘Release Candidate’:

The term release candidate (RC) refers to a version with potential to be a final product, ready to release unless fatal bugs emerge. In this stage of product stabilization (read QA cycle), all product features have been designed, coded and tested through one or more Beta cycles with no known showstopper-class bug. When a version get to the Release Candidate cycle, only one iteration should be necessary.

Obviously, these definitions are fluid – at best.  Problems discovered late in the beta stage could seriously affect functionality and certainly a major flaw discovered in a Final Candidate could (and should) push a public release back.  If you have a ‘set in stone’ release date, however, how does that affect your releases?  I imagine that it severely limits your flexibility if major problems are found – especially if you have some sort of contractual obligations to release.

Is this your understanding of the software process?  Or is software now so complex and so fluid that we need lowered expectations of what software should be capable of doing for us?  Is it okay to release with known bugs as long as it’s ‘good enough’?

Registration Systems For RB

July 14th, 2009 Bob Keeney 2 comments

Product registration and licensing systems is a fairly common call for help on the REALbasic forums.  I know I’ve rolled my own registration system and used various commercial solutions over the years.  In fact, we came up with a solution that works with desktop apps using a licensing system meant for servers.  That solution has worked well, but time goes on and what was good for years might not be such a great idea now.  Software grows old and stale and new solutions are born.

To me it seems that there are a couple of issues to deal with.  The first is keeping casual piracy down to a minimum.  I have no doubt that someone determined enough can pirate any piece of software.  It’s just a fact of life-get over it.  This means that if someone pays for the software they can’t post the registration code and have it go all over the internet.  Or if they do, it quickly gets squashed and it’s no longer valid.  Another consideration is that I don’t want to piss off my good customers because my licensing scheme is so draconian (I’m looking at you Microsoft).

The second part of the equation is getting paid.  People want to use PayPal or their credit card (and occasionally checks via snail mail) but setting some of that up on your own is a pain.  PayPal is probably the easiest but I know there are segments of the population that refuse to use it.  Plus I want my money sooner rather than later.  If someone else is handling my money will I have a waiting period or minimum balance before I get to see the money?  Is it an automatic transfer or is it via check?

The third part of the equation is administration of the system.  How easy/hard is it to add coupon codes?  Can I get detailed sales reports?  How easy is it to issue to refunds?  Can I email customers with news?  And do those customers have an easy way to opt-out of future emails?  Can customers retrieve their licenses without manual intervention?

The fourth part is how easy/hard is it to integrate into my application?  Do I have to come up with my own registration code algorithm?  How do I convert existing customers over to the new system?  Does it work on Mac, Windows and Linux?

So I want it good, reliable, cheap and fast!  No pressure there!  ;-)

Kagi and eSellerate seem to be two fairly common solutions.  Both take a chunk of money from the sale price and until I saw the Apple app store I thought their commission was a little high.  Perhaps it’s worth the hassles leaving all of the server details to someone else (after having dealt with server issues in the past six months it might be worth it!)

FWIW, I used Kagi several years ago and was not very impressed with their responsiveness to support issues.  I also found their interface for making a webstore to be very clunky.  Hopefully they’ve changed, and if so, I’d love to hear about it.

What are you using for registration systems?  Do you like it?  Was it easy to integrate into your application?  Has it helped income or hurt it?  What sort of problems have you had?

Yeah, Right. You Can Do It

July 8th, 2009 Bob Keeney 9 comments

I ran across this post today:  http://blog.bitquabit.com/2009/07/01/one-which-i-call-out-hacker-news/ The basic story is that the author is refuting the claim that StackOverflow.com could be replicated “easily”.

I think this is an awesome post because it’s a warning to others and reminder to myself that everything is not as easy as it seems.  Often we look at an application and say, “I could do that.”  Yes, you could.  Without a doubt.

Here’s my advice though:  Take your estimate of weeks and make it months and turn months into years and you’ll probably be closer to the truth.  Even copying user interface and data structures verbatim I think most people would still have a hard time replicating an existing application quickly.

One project I worked on was a QuickBooks-like accounting application.  On a four person team.  Five days a week.  For FIVE YEARS!  And we had QuickBooks as the blueprint, if you will, for the accounting side of the application.  Guess what?  Even though I’ve moved on they’re STILL adding to and modifying the accounting engine.  QuickBooks is a moving target and I wish my old teammates luck in striving for it.

Every now and then someone gets a hair up their rear end and brag that THEY could do REALbasic better than REAL Software (because some bug has really pissed them off).  It’s quite possible that someone out there is working on an awesome RB clone and someday release it.  But don’t expect it anytime soon.

The same goes with claims of “I could easily make the RB IDE do this or that!”  If it was easy no doubt RS would already have done it.  Let’s face it, software is often a case of the mistakes of the father now make our lives a living nightmare.  This is not to knock our forefather developers just that what seemed like the best way five or ten years ago is woefully inadequate in today’s terms and to make it do ‘x’ (which seems easy) isn’t because the infrastructure isn’t there to do it.  So the whole thing has to be redone and done so you don’t break backwards compatibility.

Again, sorry for the blog about another persons blog.  I hope you find these discussions helpful and thought provoking.  Thoughts?

Why Pay Someone to Develop Software?

June 30th, 2009 Bob Keeney 4 comments

As a software consultant I get asked by non-software developers why do people  have me write custom software when there are easy-to-use tools out there, like Microsoft Access, FileMaker, Visual Basic, and REALbasic?  It’s a tricky question to answer because they aren’t software developers nor or they power users.  They use their computers to write documents, email and surf the web – not exactly the rocket science apps of the world.  So I came up with an analogy that people understand.

This comes from the world of ‘Do It Yourself Home Repair’.  In my younger days (you can read that as not having a lot of money) I would always take a stab at doing all those little projects that come with owning a house.  Faucet needs replacing?  No problem!  I’d go size it up as best as I could, go to the hardware store and pick up what I thought were the parts and tools I needed.

Some of you know where this is going.  On the second trip to the hardware store I’d get the parts I REALLY needed to do the job and on the third trip to the hardware store I’d pick up the things I had no clue I needed to begin with (or possibly to fix what I broke in the process of fixing the original problem).  The final trip to the hardware store is to return all the unused parts.  And all that is assuming I don’t find a leak in the next day or two (or two weeks later).

Did I get the job done?  Sure but it took three trips to the hardware store and an entire day to do it.  I called a plumber to do the same thing recently and they were in and out in 30 minutes and if I’m not happy or something doesn’t work right they come back out (typically for free because I’ve already paid).  My job isn’t too much different than the plumber.

When people come to me for a project I can guess how much work is going to go into it a project before I’m done reading their requirements document (if they have one).  I’ve worked on three accounting applications and the ones that don’t like their current accounting app get excited about that.  I tell them that unless they’re willing to spend a boatload of money and wait a year it won’t happen.  Applications of that complexity are huge, hairy monsters that take time to develop and even then there are yearly (and sometimes monthly) updates (especially if you want payroll taxes calculated automatically).

Sometimes it’s a shame that there are easy-to-use products like FileMaker, MS Access and to a lesser extent Visual Basic and REALbasic.  FileMaker and Access are  powerful tools that let mere mortals do some complex things with a database.  Just like me having a set of minimal tools doesn’t make me a plumber these tools give the user the false impression that they’re a full-fledged database developer when in reality they know how to use some tools.  That’s not to put these folks down because they’ve done some really cool and complex work.

The plumber has a truck full of fittings and miscellaneous parts.  He or she also has a set of specialized tools to aid them in their work and have years of training.  Likewise, software developers have  specialized tools to help us as well and we have years worth of miscellaneous code, controls, libraries that we’ve learned to use.  And perhaps most of all, the software developer knows how to use the tools and parts together.

So sure, you could do your software project yourself and you’ll learn how to do preferences, file I/O, database operations, error handling, licensing and registration, automatic updates, custom controls, and a million other little things.  Software developers already know how to do that.  In the long run, how much is your time (and frustration) worth?

Thoughts?  Did I use the best analogy?  What other benefits are there to having a pro write your software for you?  Do you have any drawbacks?