Oatmeal & Coffee by Philip Regan
My programming language can beat up your programming language (and here's why)! 
Tuesday, July 1, 2008, 07:20 PM - Programming & Computers
Posted by Administrator
An old discussion on the REALbasic boards was bumped back to the top by a (relatively) new member of the boards, and it got me seriously thinking about the "My programming language can beat up your programming language (and here's why)." debate. To spare you the hassle of having to read it, the original poster posted some code that when translated line for line from REALbasic to Visual Basic runs significantly faster, and much debate ensued about the relative merits between the two with the bumping user concluding (very incorrectly) that REALbasic is, for all intents and purposes, useless relative to Visual Basic.

I feel that discussions comparing one language from another are subjective at best and unfair at worst. I'm not just applying that to REALbasic, but to all of them. It really is a ludicrous conversation to have, much like the Windows vs. Mac OS vs. Linux vs. [insert OS of choice] debate.

For example, the file cataloging code I posted from Simple Cataloger positively screams on my main dev mac at The Day Job, a Mac Pro with Quad Duo Core Intel Xeon, where if I ran that same code on the same sample on the spare G5 that sits behind me, it would run relatively much slower (but still performs well). I could just as easily see there being the same performance issues on the PC side as well. As pointed out by one of the posters there, each language has its strengths and weaknesses, and by logical extension, no single language is going to meet the needs of all developers in performance, syntax, robustness, etc. (because I think that if there were, we'd all be using it right now and not even having this discussion).

Even the venerable straight C, as popular as it is, I see derided on other dev sites all the time for all sorts of reasons (obfuscated code, lack of objects, niggling syntax). But, it has this devoted developer community that has tweaked and wrung out of it every efficiency that they possibly can. I see that as the balancing act common to a lot of languages. Much like the three directions for a project (Time, Quality, Resources) I feel there are (more or less) three directions for a language: Performance, Syntax, and Robustness.

Performance: How fast are the built-in libraries? How optimized is the language and the compiler?
Syntax: How easy is it to read? How easy is it to perform The Five Necessary Commands (Input, Loops, Conditionals, Subroutines, Output)
Robustness: How many different built-in libraries are out there? How deep is the developer ecosystem around the language or central product?

By working with those three factors, you could so some comparison between other languages, but you would have to keep in mind that you are picking one direction to go and sacrificing the other two by result. But really they could be used as a tool to help decide which language you feel would best accomplish the given project goals. These goals could be anything from cross-platform functionality to long term maintenance of code across multiple teams. I would pick REALbasic for one and a C-variant for the other.

Steve McConnell in Code Complete has a table that discusses the relative speed of various operations in both C and Java (it was surprising to see the jump whenever division was mentioned), but is very quick to point out that the factors shown in the table should only be compared within the language and not between the languages.

The same principles really ought to be applied here when making the VB and REALbasic comparison. There simply isn't a comparison, and it isn't necessarily a matter of one language being better than another, but rather one fulfills a project's needs the other can't. The argument can be made that we gain in great cross-platform functionality (the OP's method could work on all three) is lost to slower functions on the various platforms. I think it's a fair trade. I'm sure at some point, I'm going to want the Performance and Robustness given to me by Objective-C and Cocoa, but for now, I prefer the Syntax (and good Robustness) of REALbasic.
add comment ( 1 view )   |  0 trackbacks   |  permalink   |   ( 3 / 57 )
Lots of speculation on the future of Applescript all of a sudden. 
Sunday, June 8, 2008, 09:28 PM - Programming & Computers
Posted by Administrator
I forget how I found this article extending the idea of Apple's new and improved Javascript engine to making Javascript the scripting language of choice on the Mac. Bob Keeney had some interesting musings on the topic that I'd like to expand upon...

I don't know if I would go so far as Bob did to say that Applescript is a "failed" language. I have several 1800+ line scripts that increase the productivity of multiple departments at The Day Job that would love to discuss that particular assessment. I have yet to find another tool that allows me to script Adobe applications, Microsoft Office, and folder/file operations all in the same document. It really is quite amazing once one gets into the really complex work.

At the same time, I would say that Applescript isn't a very successful language, either. Apple had a really good idea (still has a good idea, too), but executed it very poorly.

It is touted as being a natural language syntax, yet it requires the same niggling amount of detail as REALbasic and Javascript, but none of the tools to navigate one's way through the particulars. The free Script Editor, in a word, sucks. Script Debugger by Late Night Software comes close to a proper editor but is still lacking some basic features like code completion (!). In addition, those are my only two choices it;'s both liberating and frustrating at the same time. I only say "two" when I know there is a third, Applescript Studio, but that's such a sign of failure on Apple's part that I just stay away from it.

Finally, I think Apple added too much syntactical variance (plural form of nouns and whatnot) and allowed too much control with the developer in supporting their app that I can totally understand why someone would bang their head and walk away fairly quickly.

I've always felt that Applescript has a very "Microsoft-ian" quality to it. Apple wanted an easy-to-learn scripting language native to their OS (System 7, I believe) and since one didn't already exist, they wrote their own. Over the decades it has been pushed and pushed into a wide variety of applications, and now it is in just about every major and medium-sized application. Certainly, any true Macintosh application worth its salt would have at least *some* Applescript supported outside of the defaults that every application should have (e.g. run, quit). Now that it is so embedded in so many companies' systems (largely print production based on the questions being asked on MacScripter.net), I think to swap its place on the scripting perch (essentially replacing it) would push a lot of media companies into action to get Apple to keep it where it is to ensure it remains fully supported. There simply isn't a replacement to Applescript that offers the same amount of saturation in the market. In my experience, I've only ever seen heavy documentation on scripting with Javascript in Adobe's Creative Suite (but they also support VB as well).

I agree that REALbasic would be a great addition to the Apple scripting family, much easier to deail with that Javascript. But I think REALbasic suffers the same issues as Applescript. It's a proprietary language that is useable in only one editor that doesn't even have clippings (!). With Javascript I can switch editors on the Mac to one that meets my particular needs (e.g. TextMate, SubEthaEdit, BBEdit).

I can easily envision Apple swapping Applescript with Javascript (not my first pick; RB would be my first pick), but it would have to happen over a long transition period. The fact that their new iWork applications have no Applescript support (Automator, yes, but that is doomed to fail from the start. Just wait.), I think, hints at such a future. I think the lack of Applescript support in some of their flagship apps also points to a just as easily envisionable future with no Applescript at all. I have my finger hovering over the http://www.petitiononline.com/ button just in case.
1 comment ( 22 views )   |  0 trackbacks   |  permalink   |   ( 3 / 83 )
Scoring a Wii Fit 
Tuesday, May 27, 2008, 09:21 PM - General
Posted by Administrator
I learned a long time ago (not the hard way) to never buy a hard-to-find video game from an online retailer selling it for more than retail price. Instead, find some completely out-of-the-way video game store. Luckily, I have one near The Day Job, stuck on a small state road nowhere near a freeway, mall, or downtown shopping district.

When I saw someone walk out of the store with a Wii Fit in their hands, I marched in and got one of my own. I asked the guy behind the counter how many they received, and he told me that they actually got 66 of them the day they were released on May 21st, but that I was getting one of the final three. I had half a mind to buy all three and sell them for a small profit on Amazon or eBay, but since I loath that being sold to me and the profit wouldn't be so hot anyway, I decided to stick with the one.

I fired it up and played with the initial exercises that are open in the game. I won't get into the details of it too much because all of the reviews out there do a pretty good job describing the experience1. It was fun, I definitely got some exercise, and before I knew it, over a half hour had gone by, and that's more than what The Team Of Expert Scientists say is good for you. I was just beat enough to not want to play another round of bowling, because there was one game (the ski jump) that I just had to master before moving onto something else.

What really caught me by surprise was the sensitivity of the balance board. It looks like a scale, but I was able to watch my center of gravity change and, in some of the games, if I even so much as twitched my toes, the board would react thus adding another dimension of playability.

Regardless of what some skeptics (and media wonks (see the footnote below)) may think, I think anything—anything—to get people to counteract all of the corn syrup they're ingesting is a good thing. I know I didn't feel so good about the beer I had after my first workout. Therefore, the Wii Fit is a welcome addition to the household. That and Wii Sports are definitely reasons alone to get a Wii. Nintendo definitely got it right.




1 However. pay no mind to the New York Times Personal Tech review. I'm not sure who they picked to review it, video game geek or not, had they no business doing so. Statements like
I hate working out. I’ve always thought the ideal solution would be for a workout enthusiast to telepathically connect with me and exercise my body while I slept, letting me avoid the discomfort and tedium of exercise.

...and...
I’m not a fan of aerobic exercises — I go dancing four or five times a week instead

don't exactly instill a sense of confidence in their qualifications to properly review such a device. If I were a kid who had a choice between playing with a Wii Fit or clubbing in NYC, I'd pick clubbing, too.

Instead, read the review in the Fashion & Style section. It's much more balanced because there it was reviewed by a working mom, a gym rat, a fitness professional, and a video gaming couch potato, all with their own different regimens (or lack thereof). After having played it, I have to say this is a much more relevant review.


add comment ( 1 view )   |  0 trackbacks   |  permalink   |   ( 2.8 / 53 )
Nintendo "Gets It" 
Sunday, May 25, 2008, 09:52 AM - General
Posted by Administrator
A couple weeks ago I celebrated my 00100101 birthday (but I prefer 0x25), and my mother in a fit of "let's spoil my kid rotten for no reason" bought me a Nintendo Wii. It seems that a couple months when were in Best Buy, she was conspiring with the sales guy while I was playing with the demo unit in the store. I'm reverting back to the being 13 (00001101, or 0xD if you prefer) again.

When I first heard that Nintendo was going to have motion sensitive controllers, I knew I just had to play with it. It was the next logical evolution in gaming that was a long time coming. However, I had other designs for my money, and since I was barely touching the game systems and traded them in for the PSP (which I still play because it's easy to grab), I knew getting another console was out of the question. But being the video game junkie that I am, I always joked that I would go out and by one whenever I had a trace of extra money.

The Wii is a blast and it really does open up video games to people who would otherwise not care to play. Renee never played video games outside of Solitaire on Microsoft Windows, but even that is more of a mouse learning exercise than what I would consider a proper video game. However, once I get the game set up and started playing with Wii Sports, everyone, including Renee, wanted to get in on the act.

My absolute favorite game so far just happens to be Wii Sports, and Nintendo has proven once again that game play trumps graphics any time. The graphics in the games aren't even cartoonish. Players are these funky wooden peg-like characters, sometimes with legs and sometimes without. But, that doesn't matter because all of the games, particularly bowling, baseball, and golf, are literally games of physical skill. That makes the depth almost limitless. Wii Sports and Wii Play were obviously created to show off the capabilities of the Wii, and they don't disappoint.

There is a certain amount of skill in each of the games that is taken care of for you. In golf you always hit the ball. In baseball every pitch is perfect. Bowling is the only one where you are truly left your own devices and that makes it, I think, the best one of the bunch. It doesn't require a lot of room to play, but you do really have to crouch down to get a smooth roll and the control allows you to get a spin on the ball. In fact all of my suckiness in real bowling has been transferred over to the Wii, and I'm able to work on my game (not that I play regularly or anything) in the comfort of my own living room.

The only problem* I've had so far came with Super Smash Brothers Brawl, and for that I partially blame Apple. I know, crazy, right? Apple has done a great job of taking complex interfaces and greatly simplifying them, but I feel that perhaps that particular pendulum has swung a little too far. Sometimes what ought to be obvious isn't and is so obscure that I have to really wonder why things were placed where they were.

The problem came up when I was setting up the game for Renee and I to play, and I needed to set up her controller. In Wii Sports and Wii Play, this is done in the game's menu system. It asks you to select a number of players, asks how many controllers (because you can swap with most games), and activate right before play, complete with confirmation. It's two (and a half) steps and blatantly obvious.

With Super Smash Brothers Brawl, there is no swapping of controllers in multi-player. Just like with most games in Wii Sports and Play, multiple controllers are a necessity. However other controllers must be added before you even get into the game out in the Wii's operating system, and even then, that has to happen at the title screen of the game and not out in the OS. There is no in-game menu item that allows the addition of other controllers, and with a 20-second lead in load time, this is a hassle should you forget.

Now it could be that my ADD-addled, 00100101 year old brain was thinking too hard about this, but it took a good half hour to sort this out and by that time, Renee was ready to move on to other things (as was I). But at the same time, I felt that if it was a Nintendo-created product that it should have the same interface as the rest of the Nintendo-created products on my shelf. Beyond that, the Wii has been a flawless experience.

Being the casual gamer that I am, this adds a nice diversion to the arsenal. All of the Sports and Play games are quick to load, easy to learn, and take honest practice to become proficient. Super Mario Galaxy has so far lived up to the hype, and once I get through that, I have the new Zelda waiting in the wiings. It is definitely going to make these long New England winters go by a little easier.




*Well, I have another problem with the Wii, and that is the name. The original name was "Revolution" but it doesn't exactly roll off the tongue. However, I don't think Wii fares much better either if only for the obvious puns that one can't help but fall into: "Hey, want to play with my Wii?" I think this goes right up there with Chevrolet selling the Nova in Latin America without changing the name. Although, the game play for the Wii is outweighing the inheirent curses of the name.
add comment ( 2 views )   |  0 trackbacks   |  permalink   |   ( 2.9 / 50 )
The Never Ending Battle Against Corn Syrup 
Saturday, May 17, 2008, 08:37 AM - General
Posted by Administrator
Several months ago (or maybe it was a year), I posted about the discovery of corn syrup in our wheat bread and our reaction of using a bread machine to make our own. We're still making our own bread, sans corn syrup, and every time we're forced to buy commercial bread (usually because I forgot to make a loaf), the store-bought bread tastes really disgusting. It's not like we eat bread all the time, I make bread probably once a month, but when we have it, it needs to be good.

That need for no corn syrup in our bread has now led to our battle to not have corn syrup in anything. It is simply amazing the things I find corn syrup in. For example, pretzels.

I love pretzels. Just plain, lightly salted pretzels. My favorite pretzels are Snyder's of Hanover Mini Pretzels. I can taste the flour and the baking soda and that salty, savory flavor is awesome. They have dextrose, which is sort of a concentrated sugar, but since the overall ingredients list both small and recognizable, and that is the only sugar in the list, I'm willing to live with that. But, I'm sure the dextrose can be removed without any real drop in quality, and if it was necessary, I would pay extra if they just used plain old sugar like I do in my bread to activate the yeast. Usually, I'm just getting the small bag from the vending machine for fifty cents at The Day Job. The only time I ever buy a big bag is when I'm on a road trip to New York or something, and even then a good portion of the bag is still left after both legs of the trip. Moderation is key, kids.

Last weekend, Renée and I were driving down to my mother's house, it was getting towards noon, and we were starving. So, we stopped off at the CVS, and all they had were CVS brand pretzels. For some reason, I didn't look at the ingredients list. I think I was too hungry to care. Well, I didn't eat them until went into The Day Job. As I was eating them, I noticed while they weren't bad, they weren't necessarily good either. In fact they had this kind of bland, almost neutral, flavor to them. So, I look at the ingredients list and sure enough, corn syrup. The nutrition label says "Sugars, less then 1g", but I think it really depends on what is packed into that "less than 1g". Into the bin they went. Life is simply too short to waste one's time on such nonsense.

Yesterday, I took the day off from work for various reasons, but basically it was slow and I needed the break to get my own affairs into some semblance of order. A mental health day, if you will. I needed to run over to Target to get a couple things, and I decided to add pretzels to the list. Target only had two brands: Rold Gold and their own. The ingredients lists were identical, and they both had corn syrup. And what's with the artificial flavor? What artificial flavor could they possibly add to enhance this? It's just dumb, and I didn't buy them.

My favorite example of the problems with corn syrup are Quaker Oats Oatmeal To Go. This is a product I find truly disgusting and great example of what is fundamentally wrong with most commercial food production systems. Now, as evidenced by the name of this site, I love hot oatmeal for breakfast, even in the summer. To top that off, I eat Quaker Oats oatmeal every day that I can't have Jordan's Porridge Oats from the UK. This is because they are the only choice in the stores and if I have a choice the only one that sells it in a size that I need. The ad campaign for Oatmeal To Go showed a guy on a bus sitting there with a bowl of hot oatmeal that magically changes into the Oatmeal To Go product, touting that you get the same nutrition in the bar as you would in a bowl of oatmeal. I call foul just by the ingredients list and the nutrition label. 19g of sugar from high fructose corn syrup (#2 in the ingredients list), brown sugar (#4), glycerin (#21), sugar (#23), and, lo and behold, corn syrup (#24). It's crap because the nutritional value of the oatmeal is pretty much negated by all of the corn syrup. It is outrageous that they just outright lied in their marketing campaign. You couldn't pay me to eat this stuff. Hell, they could probably hardly pay enough to the actor to eat it either. Stupid commercial for a dumb product that shouldn't even exist in the first place.

If I could afford to shop at Whole Foods all the time, I would. The food is better and I know I can pick most things off the shelf at random and really not have to worry about much of anything. I think it is simply a shame that it costs so much more to eat simply healthy than it is to eat the crap that companies like PepsiCo, General Mills, Kraft, et. al. stock our shelves with. I find it laughable that the new trendy marketing campaigns are going to be how "green" they are, when the reality is that they're dodging the real issue of the nutritional quality of the foods they're touting as healthy. It's a long standing statement, certainly one that's been around since I was a kid, but they really ought to be ashamed of themselves.

Now, I should disclose that I am not a saint by any means. I've been a long time Coca-Cola fan, and I enjoy the occasional bottle of Coke. In fact anywhere I see the classic glass Coke bottle, I grab one. End of story. But by "occasional, I mean that soda is, at best, a treat. One can or small bottle shared with Renée a week at most. Sometimes I drink a little more, and sometimes I can go weeks without touching the stuff. In my oatmeal I usually put in a couple table spoons of sugar at the beginning of cooking to negate the bite of Quaker Oats oatmeal.

There was this one time Renee and I were in the grocery store, and they had just finished stocking the shelves. There was hardly an empty space to be found. I was in the soda/water aisle picking up some sparkling water for a party were buying food for. I had turned the corner and for some reason I was just struck by the site of what was probably 30 yards of soda, all fully stocked and perfectly lined up. There was nobody else in the aisle, so I just stood there at the end of the aisle and stared at the endless rows and piles of bottles, cans, colors. I don't think I had ever seen so much soda in one place my entire life. Renee came up behind me and asked what was wrong. I said, "Nothing. But, look at all of that soda. It is truly an amazing world that we live in that so much time, effort, and energy is spent on something so completely useless. When I think about the infrastructure that is needed to create, distribute, and sell all of this soda, a 'food' with absolutely no nutritional value, I find it amazing and overwhelming." I think I stayed away from soda for a good month after that. It was fascinating and repulsive to see soda, of all things, on such a grand scale.

I firmly believe in the coming years, that corn syrup and other concentrated sugars like it, are going to be found to be one of the root causes of the obesity problems not just here in America but around the globe. I don't have any scientific evidence other than my having dropped twenty pounds since I seriously started on this anti-corn syrup (and anti-dairy) kick six months ago. There's something about corn syrup that just seems...I don't know...wrong, somehow. And it certainly doesn't belong in pretzels of all things.

add comment ( 2 views )   |  0 trackbacks   |  permalink   |   ( 2.9 / 47 )
I'm not one to take sides normally... 
Tuesday, May 6, 2008, 07:07 PM - Programming & Computers
Posted by Administrator
...but, for the life of me, I do not understand why Windows is still the dominant operating system. I mean how is it that millions of users and developers (of all people) have tolerated this nonsense for so long? Britney Spears' popularity I can sort of understand. But Windows? How to people tolerate this...this...dreck?

That is all. The Day Job-related rant is now over.
1 comment ( 12 views )   |  0 trackbacks   |  permalink   |   ( 3.1 / 71 )
The Computer Skill Everyone Should Have By Now 
Saturday, May 3, 2008, 01:18 PM - Programming & Computers
Posted by Administrator
When I was in junior high and high school, way back in the 1980s (shh...don't tell anyone I'm that old), computer classes were primitive by today's computing standards.

I had one when I was in junior high that I really don't remember all that much. The one thing I do remember is seeing a CAD drawing of a microchip for the first time. I still remember that moment like it was yesterday because I thought it was one of the coolest things I had ever seen.

My high school had two classes that we were required to take, and I think California was really progressive to make them a requirement at the time. One was on basic programming, and not just basic programming, but actually programming in the BASIC language in a lab full of Commodore 64 computers. I had one of those at home (and I still miss it to this day), so I was comfortable in the class. I was a big Bloom County fan so all of my assignments centered around Berkeley Breathed's humor, much to the chagrin of my computer teacher.

This was long before the days of ubiquitous hard drives and GUI file systems. I had gotten some of the plethora of programming books out there, but there it takes a special kind of person to have the patience to enter machine language hex code and having to start all over when one of the codes was wrong. All I wanted to do was play games.

It wasn't until my sophomore year that GEOS came out and really made the Commodore accessible to me. I used a joystick for all of the pointing and clicking. Up until that point I knew just enough file commands to load a disk directory (I can't tell you how many times I typed in LOAD "$",8,1 and hit "Enter"). I couldn't play games, but I dug the fact that I didn't have to type commands to do basic tasks. I've always been a very visually-oriented person, and it was the GUI interface that made the computer finally "click" with me. Seeing as how it was just like the Macintosh, I'm sure that prety much sealed the deal for my Mac OS enthusiasm to this day. Perhaps if I had gotten an Atari like some of my friends things would have been different. Regardless, the debate between the GUI and the command line is lost on me. I really don't see a reason for the command line anymore other than to do commands and run applications that can be run by any other means.

The other class I had in high school class I had was an old Acorn computers and focused almost entirely on word processing. This was done entirely on green monochrome screens where styles were applied using very simple tags (quite literally tags like /b/, /i/, /u/. I think you can sort out what those mean). It wasn't any different from the old typesetting systems I grew up around. By the time I got into that class, I was bored with using Bloom County as source material and moved on to Douglas Adams. We had to write stories as part of our exercises in the class, but no one said they had to be original.

It has only been within the past few years that all of that stuff from those classes have actually become useful. It is no secret that all of that old school tagging was the precursor to SGML and all of its markup language branches, and has everything to do with my being able to glom onto XML so quickly, no matter how frighteningly dull I think it is. But, hey, it pays the bills.

There was a typing class, but it was done on old electric typewriters, and I'm sure schools have since moved onto computers by now. At least I hope budgets have improved since then. You could always tell when there was a typing class during a given class period because of the amount of noise that emanated from the classroom. I'm sure there is a generation of deaf typing teachers out there. Typing is still a necessary class, if not more than ever, one that ought to be mandatory in schools if it isn't already, and one I wish I had the forethought to take back then. I can type now, but it is this odd combination of hunt and peck without looking at the keyboard. Some days are good typing days, and some days are bad. Yet somehow I manage to get through the day and write up 1200+ line Applescripts and REALbasic applications, with much gratitude going to the autocomplete feature. But back then, typing in BASIC code and machine codes by hunting and packing sans autocompletion really sucked.

The programming, though...not so much. I have to say that when it comes to programming, either you have it or you don't, which really goes against the optimist in me, but there is some hard science to back up that statement. So, to force some students to have to sit through hours of doing something that they have no hopes of understanding is mind-boggling to me. Not all computer users are created equal and so shouldn't be treated as such.

Someone once wrote recently, and I forget who, that the next great computer skill everyone will need to have is the ability to search effectively. (It was probably Jeff Atwood now that I think of it. This sounds like something he would write.) This couldn't be more true, and this is something that is woefully in need in schools starting now. See this example post to the REALbasic Forums:

Well I'm having a lot of trouble finding details on how to implement an actual interface in real basic. Typing in "interface" or "class interface" or "Implements" into the language reference links me to hundreds of things that all seem completely off base. I found this excellent article and I'd like to actually implement something similar in my code but it feels nearly impossible to figure out. Searches on these forums also seem to yield little help but its most likely because I'm lacking anything resembling a working knowledge of either the IDE or the language. Any help would be most welcome.


In particular, it is this sentence that I'm after:

Typing in "interface" or "class interface" or "Implements" into the language reference links me to hundreds of things that all seem completely off base.


The writer then goes on to state later in the thread that he finds it very frustrating that this information is hard to find in the documentation that comes with REALbasic. To be fair here, he admits that he is new to REALbasic and he was looking in the wrong place. But...

It seems to me that anyone with even a modicum of programming knowledge would really understand that words like "interface" are extremely nebulous. It can mean anything from the GUI interface of an application to an extension of a group of classes. To steal a bit from Donald Rumsfeld, I think this is a case of he didn't know what he didn't know, and the same could be applied to myself as well. We still have no idea what kind of an interface he wants to create, and we really can't be sure he understands either.

My concern comes in that I would find it distressing if the original poster walked away from REALbasic simply stating "REALbasic sucks" when all he/she needed was a refined search. There is a wealth of information out there aboiut REALbasic, but it doesn't do me, an experienced user, if I don't know how to sift through all of it.

Google has a great set of features for their search engine to do highly refined searches. The advanced search page helps, but it is the "The Essentials of Google Search" page that is positively buried in their help that really begins to show just how niggling one can get. I stumbled upon this page one day while working with another developer at the The Day Job and it was a revelation. I feel this is one of the most misplaced pages in all the World Wide Web. After reading this, "Advanced Search Made Easy", and the "Google Web Search Features" pages, I rarely ever find myself sloughing through past results page 3 for anything. As a result of this, I usually get "How did you find this?" thrown back at me quite a bit, and that's when I share those pages.

But, good, useful searching is a two way street. Bill Gates and Steve Ballmer absolutely have it right when they say search is the next big technology. A search engine is not only as good the person using it, but also the content it is searching. I'm finding some of the tools that Google has in place in other sites as well and get a little frustrated when a site doesn't have either the tools or any moral equivalents. If a site with scores of content has the capability of allowing highly refined searches, then it really ought to make an effort to allow it. Google gets this right but those that are creating content really need to step up and starting placing really useful metadata into their content.

It is astonishing just how much content is on iTunes. Already it has more than what any reasonable person could hope to view in a given lifetime. However, my needs, as the needs of other hard core audiophiles, are vastly different from other users, and iTunes does not address those needs. I'm not just a fan of certain bands, I'm a fan of particular musicians, record labels, and even producers. So, why, for all of iTunes power, can't I search by either of those parameters? It's the logical extension of their catalog. The closest thing I have to it is the "Listeners have alos bought:" section on every album page. But as I get into the more esoteric stuff, it is a massive gap in the information pool. If a piece of information is in the liner notes, it ought to be in iTunes.

So, back to the post that got me on this topic, it actually pains me to see these kinds of posts more often than not (not that much, really, it is more of a collective frustration, really). The content creators and computers companies touting search can only do so much tagging and advertising, so a lot of the responsibility will have to fall on the users to find what it is they are looking for. Luckily for this user and others like him/her, there are other experienced users much more productive on the REALbasic boards than I will ever be to help them out. If you read that thread a little further, you can see that I am trying to help point the user to the information they need. I've implemented several vastly different interfaces myself and I think I might be able to help the poster. If only I had a little information to go on.
add comment ( 2 views )   |  0 trackbacks   |  permalink   |   ( 3 / 79 )
Spring has sprung 
Wednesday, April 16, 2008, 05:18 AM - General
Posted by Administrator
...for the Bumpesses! (You remember them, right?) I know I said I wouldn't blog about them anymore, but when my sleep is interrupted on a Tuesday night/Wednesday morning at 2:00 in the freakin' morning to the sounds of a jacuzzi party with obnoxious teenagers and the parents that allow this nonsense, it is obvious that the weather is improving here in New England and that is worthy of comment. I'll add this event to the leaf buds on the trees and the re-emergence of birds, much like the first sign of summer by seeing the beer-bellied guy watering his lawn without a shirt on.

If there is anything I will eventually walk away with from the overall experience with the Bumpesses is a list of what NOT to do should I ever own a jacuzzi (and what not to do as a neighbor in general). And, hey, now we know spring is finally here!
add comment ( 1 view )   |  0 trackbacks   |  permalink   |   ( 2.9 / 42 )
Language Bingo 
Thursday, April 3, 2008, 04:55 AM - Programming & Computers
Posted by Administrator
Automating page layouts, even highly templatized ones, is not a trivial task. Doing this kind of a thing is something sometimes bragged about by design and marketing firms on Apple's site. But the actual work and resulting pitfalls involved are conveniently glossed over in the article. This post is about that topic. I'm going to dig deep into an actual production problem I'm working on that has exploded in front of me. This is going to be 1 part rant, 1 part brag, and 1 part "Hopefully, some other hapless Applescript developer will read this and get something out of it and avoid the same pitfalls I've run into."

I'm currently working on a couple composition automation projects at The Day Job that uses REALbasic, Applescript, XML, and XSLT to do it all. When I am in the code it all makes sense. When I stand back from it for a minute and look at what is being done, or try to explain it to people, it is absolutely maddening. When it works, it is actually fun to watch. When it is not working, I can get lost in the code for days sometimes no matter how much of Code Complete's canon I have followed. This is something that I've dine in past for other projects, but nothing at the current scale or scope. It sounds as if I am bragging (about it working, not about the endless hours in code). Perhaps I am subconsciously. But, at the same time, I wish I didn't have to use all of this language buzzword bingo to accomplish (essentially) one task: automating a marketing piece (e.g. a postcard).

Where I'm having the most trouble is with Applescript, and some of its weaknesses, both in the language and the community (Apple included), really shows here. Here is how it all plays out...

All of the Marketing information about The Day Job's products are stored a SQL database. The content gets downloaded to an XML file using a generic DTD. In my application, the XML file gets converted with XSLT to another XML file that is suited to the type of piece it is. An Applescript is run that takes the transformed XML file and places the information into a specially prepared template that gets collected and saved to another location. This isn't exactly rocket science, I'm sure other companies are doing this. If not, I am available for consulting gigs. Just shout.

REALbasic, I think, has done a marvelous job of integrating Applescript into a compiled app. I can run it as a command, method, or function, even with arguments. Troubleshooting the REALbasic portion of the application is a cinch with all of the debugging tools contained in the IDE. It is brilliant, and I hope it is a feature that they never, ever deprecate. It is troubleshooting the Applescript where all hell breaks loose. Applescript isn't even nearly close with what REALbasic can do. Not that I ever expect REALbasic to help me troubleshoot my Applescripts other than if it is there or not, but again I expected better of Apple in the recent upgrade to Leopard.

If you use Applescript in a professional capacity, then you more than likely use Script Debugger. If you don't, you do not know what you are missing. Apple's Script Editor gets the job done, but Script Debugger does it way better (and I think Apple knows this given how little the Script Editor has changed). It, more or less, offers many of the same tools that REALbasic's IDE does, and by result the scale of a script can grow considerably. I have some scripts that are 2000+ lines of code, and have created combined processes that are 3000+.

I've tried a couple times to use Applescript Studio (essentially XCode) to create and debug scripts. I was shocked to see that XCode didn't offer the same tools to Applescript as it does to other languages. Applescript Studio, near as I can tell, is just a wrapper for the Script Editor for (loose) integration with Interface Builder through XCode. So, really, it has a "who cares" kind of a vibe to it, and simply accomplishes reinforcing my feeling that Apple views Applescript as the red-headed step-child. I understand that Applescript Studio/XCode is free, but I think Apple should have done better. I might as well stick with Script Editor. If Script were a hammer being used to kill the Problem Ant, then Applescript Studio is a nuclear bomb without a guidance system to kill the Problem Ane. Just for the sake of argument, I run into Automator's limitations far too quickly for it to be useful (really, once you can code your own, there is no going back). The upgrade Applescript got in Leopard seems more of "Oops, sorry about that, guys" than anything. A lot of those things they upgraded really should have been done ages ago. But, I digress...

As a result of this workflow, I'm working with a lot of files: two XML files, one XSLT, on InDesign template, all multiplied by the number of templates being supported (and then multiplied by the number of marketing pieces being created at any given time). So, I rely a lot on file paths, and by result I have a very strict folder structure.

Applescript treats file paths relative to the application that is running a given script. For example:
  • If a script is running as an application...
    • ...then all paths are relative to itself.
    • ..., but I can't use it as a method or function through REALbasic; only a command, and that reduces its usefullness tremendously.
  • If a script is run through an application (e.g. a REALbasic app)...
    • ...then all paths are relative to that application.
    • ..., but oftentimes I need to run the script through the Script Editor to troubleshoot the script, so no arguments or returned values in that context.
  • If a script is running through the Script Editor...
    • ...then paths are relative to the Script Editor...
    • ..., but this is the only place where I can troubleshoot the script itself.


I can understand why Apple did what they did. Rather than limiting the developer to a single point of entry for file paths through the framework, they just let the developer deal with it. That might be an amatuerish way of looking at it, but it works for me. So, to work around this, I keep the script necessary for paging in a special folder in all of my paging applications, and I place in the script this subroutine:


on GetPathToMe()
set pathToMe to (get path to me) as string
set Applescript's text item delimiters to ":"
set pathArray to (every text item in pathToMe) as list
set Applescript's text item delimiters to ""
set CreationFolderPath to ""
repeat with x from 1 to ((get count of items in pathArray) - 1)
set thisDirectory to item x of pathArray
set CreationFolderPath to CreationFolderPath & thisDirectory & ":"
end repeat
return CreationFolderPath
end GetPathToMe


The "1" being subtracted in the upper limit for the repeat block is how deep in the script's path I want to go. I can stop at the main folder, or I can stop at the script. This, combined with another subroutine that pieces different paths together to get me what I finally need, has been a massive relief in sorting out all of the path issues.

However, when I work on a script and save it in Script Debugger, Script Debugger does something, probably a wrapper, that causes the file to be "un-openable" in the Script Editor. If Script Editor can't open it, then REALbasic can't open it either, because I'm sure it is hooking into the same framework that Script Editor and XCode are as well. So, to get around this, I have to go through some pretty extreme gyrations to troubleshoot the script. Actually, I have two versions of the same script. One is the script that is linked to the REALbasic application. This is what I call the RUNTIME script. The second is a script that I have in Script Debugger for troubleshooting so I can easily all of those bits that Script Editor hides from me. That one I call the DEV script.

I write very subroutine heavy Applescript code. I think it's the only way to fly. Every large script I write starts with an "on run" block. The "on run" block is there to quickly get the input and the script parameters to where they need to be. This allows it so that when I make changes to the DEV script, all I need to do is copy and paste all of the other subroutines from the DEV script into the RUNTIME script with minimal hassle, and minimize the bugs. At least that is the theory. Practice always yields some scenario that I didn't think of before, because the problem is that I'm forced to copy and paste as part of the build and test process.

I've looked at this every which way, and I can't sort out any other feasible way around this problem. (There are other issues that I know could be made easier, like talking to the database directly as opposed to creating that first XML file.) But, I say feasible rather pointedly because the unfeasible way would be to somehow incorporate REALbasic and the Adobe Creative Suite. It is possible because REALbasic can talk to scriptable applications with AppleEvents, but not feasible because the number of different AppleEvents in this one script weighs in at 300+, and then there is the problem of storing objects in variables as well. REALbasic has the AppleEventObjectSpecifier Class, so that might do the trick. But, when to get to all of that? There ought to be a better way.

It sure would be cool if all of the Applescript stuff could be ported over into something more robust. I've heard of Javascript being another way to do it, but I have to say that I'm not a fan of the syntax, and that doesn't solve the problem of one too many languages. Then, I could do away with all of these Applescripts and reduce the number of languages by 25%. Let's see Apple talk about that on their site for a change.
add comment ( 1 view )   |  0 trackbacks   |  permalink   |   ( 3 / 60 )
The Music I Listen to When I Code 
Saturday, March 29, 2008, 05:46 PM - Programming & Computers
Every programmer has their favorite kind of music to code to. It is my understanding that the vast majority listen to techno. I've tried that but it wasn't for me. I don't know why, though I think it had something to do with it sending my ADD into total overdrive. So much so that I couldn't think straight.

I tried jazz for a while. None of that modern smooth jazz nonsense, but instead old school Blue Note Records jazz. But I found it to be a bit dull and not up tempo enough to keep thinking along. Big band jazz was next, figuring there was some kind of a compromise there between tempo and distraction. But, alas, I like Buddy Rich far too much to not pay attention to the music. Some people can do it, but not me. It was just too distracting.

So, after countless experimental play lists on the iPod, I finally have sorted it out. I listen to pretty much anything by the following artists...

Annie Lennox
Erasure
Eric Clapton
Jam & Spoon
Meat Loaf
Pet Shop Boys
Peter Gabriel
Pink Floyd
Robbie Robertson
Rush
Seal
Simple Minds
Yes


I know. It's weird, huh? I think the reason why it works is that I've been listening to these artists for so long and so many times over the years that I really don't "hear" the music anymore. They just sort of act as this kind of whitewashed sonic canvas that I can do almost anything against. It's not too fast, not too slow, and it all plays nicely at the same volume.

I say this because I've been coding really heavily on MusicSketch for the past couple days, things are coming along really nicely, and I've been listening to this list constantly since I started, and I have yet to get tired of it. It has been a really productive past couple of days, and I attribute a large part of that to the music.
1 comment ( 11 views )   |  0 trackbacks   |  permalink   |   ( 2.9 / 66 )

<<First <Back | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Next> Last>>