Friday, May 20, 2011

Digital Evolution

65 million years ago, environmental conditions on Earth changed radically when an asteroid collision made it impossible for the dinosaurs to survive. They couldn't adapt and natural evolution is too slow a process to even have given them a chance. In contrast, transitions in technology can change the landscape just as dramatically as an asteroid though they usually give us more time in which to adapt and evolve.

In the mid 1980's I bought a compact disc player along with about 10 discs. I never bought another vinyl record again. Movies went digital about a decade later and after buying a DVD player, I never bought another VHS movie. Last year I bought a Blu-Ray player and I only buy Blu-Ray DVDs now. And of course I already know that eventually I won't even be buying physical media at all. I certainly don't buy music on CD anymore. Print however, has been much slower to go digital but it appears that it's finally reached a tipping point.

Yesterday, Amazon announced that they are now selling more ebooks than printed books. Amazon is a very smart company. They knew this transition was going to happen and if they weren't prepared for it, they would be left behind. They went a step further and even decided to help make it happen by creating the Kindle.

Barnes & Noble is trying to make this same transition and offer their own ebook reader, the Nook. However, I think it really only appeals to the hardcore Barnes & Noble fans and they are almost certainly more interested in printed books since Barnes & Noble has such a big retail presence. Of course Barnes & Noble is also going through a transition as they have recently received an offer to by acquired for a $1 billion. For a chain that has over 1300 stores, that doesn't seem like a lot of money. Barnes & Noble has about $4 billion in assets and $3 billion in liabilities. Subtract one from the other and you get $1 billion, so they are being bought for their book value. That looks like a fire sale to me and could mean the beginning of the end for Barnes & Noble. It feels to me that their effort to transition to ebooks (if they even looked at it as a transition rather than just some additional way to sell books) was half-hearted at best. Don't get me wrong. I like Barnes & Noble and if they go away I will miss browsing the bookshelves. But books and magazines are transitioning to digital and it's looking more and more like digital is the asteroid that will take out Barnes & Noble. An article on the Huffington Post from April suggests that Barnes and Noble should go all digital and close their stores.

Borders was too late and filed for bankruptcy last February.

Blockbuster Video should have seen the transition coming for video and bought Netflix when they had the chance years ago. By the time they realized their mistake and tried to create their own online copy of Netflix, it was too late. That mistake has cost them everything.

These types of transitions happen in every business but they happen most and quickest in the information business and that's what music, video, books and magazines are: information. Here at Real Software we are constantly looking at what we need to do to transition as well. We have recently added the ability to build web applications and are making preparations to support mobile platform as well. You have to be constantly on the lookout for how things are changing so you can adapt and evolve.

What changes are going on in your environment? How are you evolving and adapting? Share your thoughts.

Wednesday, May 18, 2011

Another way to enter a property declaration

You probably add new properties to a class, module, window or webpage by typing the name, pressing the tab key, typing the property type, etc. But did you know that you can do all of that in the name field? Just type the entire declaration ("Status as Boolean" for example) into the field where you type the property name and the IDE will parse out the declaration and put everything in the right fields for you.

So you can type:

And then get this after you press tab:

Monday, May 16, 2011

Inline IFs

Have you ever wanted to be able to conditionally add something to the middle of a statement without lots of if-then or select statements? Here's a trick that I've used in many of my own projects.

In a module, define a method (IIF = Inline IF):

Name: IIF
Parameters: Condition as Boolean, TrueValue as Variant, FalseValue as Variant
Returns: Variant

If Condition Then
Return TrueValue
Return FalseValue
End If

Here's a quick example of how you might use this in your code. Imagine you wanted to display a different confirmation message based on how many records the program was about to delete:

Dim msg as String = "Are you sure you want to delete " + IIF(n=1,"this record","these records") + "?"

If MsgBox(msg,4) = 6 Then
//…Delete Record(s) here…
End If

If n=1, the message displayed will be:

"Are you sure you want to delete this record?"

Otherwise, it will read:

"Are you sure you want to delete these records?"

Friday, May 13, 2011

So why did Microsoft buy Skype?

Since we create cross-platform development tools and our customers build cross-platform software, I tend to closely follow other cross-platform software products. Here at Real Software, we use Skype daily so when it was announced that Microsoft is buying Skype, my interest was piqued.

I think Bob Cringely got it right. Microsoft needs to transform itself and buying Skype is one of many ways it can do this. It's not clear if there is a specific strategy at Microsoft however. In this particular case, the strategy may very well be to simply keep Google from buying Skype. There's never only one prospective buyer and the reason Microsoft paid such a high price is no doubt related to Google's interest in Skype. The fact that the Microsoft antitrust decree ended on Wednesday with little fanfare is more evidence that Microsoft just isn't what it used to be.

But since we use Skype daily, my biggest concern is what will become of Skype. Microsoft has not had great successes with purchasing a product and then improving upon it. If you're were a FoxPro user, you know what I'm talking about.

Wednesday, May 11, 2011

Are web apps the key to cross-device access?

This is an interesting article by Tim Bajarin on the idea of apps running on multiple devices. If you need an app to run on multiple devices, a web app is a really good solution in many cases. There are certainly times when a native app is a better solution but for a lot of apps, especially business applications, a web-based application saves development time and money.

Monday, May 2, 2011

Shell Differences on Windows

I ran across a bug report a while back which claimed that the Shell class on Windows was broken. Thankfully, the reporter was nice enough to enter what client app he was running which made him think the Shell class was broken on Windows. The culprit in this case was Microsoft's ftp app. The issue was that no output could be read from the app, even though it appeared that sending input to it worked just fine. The short answer to this issue is Microsoft's ftp app uses Console Input/Output. The technical details are...

On Windows there are two approaches to console I/O. In Microsoft's terms, there's the high-level approach which enables simple character stream I/O, or the low-level approach which gives the app more flexibility and access to the console's input and screen buffers. Microsoft's ftp app uses low-level console I/O which means it is directly poking the characters to the console instead of streaming it through the standard I/O mechanism. There is no way for our Shell class to pick up the low-level console output that the ftp app is sending so what you get back is nothing, which is what this particular user was encountering. Notice that Microsoft's telnet app also uses low-level console I/O.

So what's the solution? Well for those adventurous enough to explore this further you could spawn the ftp app in a hidden console window and read its input using the low-level console I/O functions as described here:
However, for most people I'd suggest finding some good REALbasic ftp classes or adjust the way you're using the ftp client (maybe you don't need it to be interactive. Microsoft's ftp app can be scripted quite easily). You could also try to find a different ftp app that doesn't use low-level console I/O.