Archive

Posts Tagged ‘Programming’

Cocoa Tip

May 13th, 2011 2 comments

I’ve been playing around with Cocoa in Real Studio.  It’s come a long way in the past couple of releases and I urge you to start testing your apps to find those pesky Cocoa bugs.  Real Software is making a huge effort for the 2011 R2 release to fix as many Cocoa bugs as possible.  It’s that close.

Yesterday I ran across a problem where my app was crashing immediately upon startup.  The crash log gave a very odd error message:

Dyld Error Message:  Library not loaded: /System/Library/Frameworks/user32.framework/user32

Wha?  User32?  That sounds like a Windows library and certainly nothing I’ve ever seen on Mac OS X.  I actually wrote the ‘bug’ up and sent it in via Feedback and then did some more research.  The answer wasn’t really all that surprising.

I have a lot of old code that I’ve developed, bought, and found over the years that make it into most of my projects.  It’s there and I don’t even think about it.  One of the pieces of code that I bought from someone works cross-platform Mac/Windows and so it has a ton of #if statements.  Things like this:

#if targetcarbon then

//Do Mac stuff

#else

//Do Windows stuff

#endif

See the problem?  If I wasn’t making a Carbon application, which Cocoa most definitely is not, it attempts to run the Windows code.  So now the crash log makes total sense.  I suspect that a lot of people will have a similar problem.

Check your projects for compiler switches like this.  If you’re developing cross-platform applications you’ll probably have this problem.  In the long run all I did was do a simple global search for #if targetcarbon and replaced it with the target for Mac OS.  That won’t work for all cases, but it should get you close.

Ideally I would love for the Real Studio compiler to give me a warning for this case but I don’t think that’s even possible.  Really, how many libraries are there in the world to know about for each platform?  Impossible I say.  At a minimum, however, I would think that it would be possible to get a better runtime error.  Sort of like how you get error messages if you don’t have the plugin libraries where the executable expects them (much more of a problem in Windows if you move the Libs directory).

What say you my fellow REALbasic geeks?  Have you tried Cocoa yet with 2011 R1.1?  Any major problems?

Yeah, Right. You Can Do It

July 8th, 2009 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?