The Problem with Technology Silos and Where Flash/HTML can Lead

There is a cool workshop being given by Jamie Kosoy called No Flash? No Problem and he had a great quote in the description:

There’s a long list of common complaints about the use of Flash, but many of the criticisms just aren’t true. Detractors say that Flash isn’t search engine friendly; Screen readers can’t understand Flash content; You can’t deeplink to specific pages…

You know what? They’re wrong. These criticisms are symptoms of misunderstanding by developers on the ways different technologies work together.

I think this is one of the biggest problems that Adobe has. Technology and development choices tends to be borderline religious in nature. And technology in general loves to have good guys and bad guys. That means the communities are very siloed and there is some resistance to incorporating or looking at other technologies. It’s HTML5 versus Flash, Microsoft versus Google, .NET versus Java, etc.

It’s also become a lot harder to be a generalist. Developers get rewarded (at least in terms of attention) for becoming experts in their niche. They’re asked to speak at conferences, they get better gigs, so becoming an expert has direct financial and publicity benefits. Who has time to dive into other technologies when there are so many advantages to drilling down into your own?

Because of that, I don’t think we’re seeing technology at its best. And it’s not limited to Flash. PhoneGap has been very successful by combining the iPhone with HTML/JS. But Flash suffers more than most. There are a lot of great integration points between HTML and Flash. We’ve got the Flex/Ajax bridge for Flex that lets you expose Flash methods to JavaScript and vice versa. We’ve got deep-linking support with SWFAddress that uses JavaScript and Flash. There are a lot of integration points but they don’t seem well publicized or well used. And there are no shortage of areas where Flash can augment JS/HTML to solve problems. File uploading, Webcam/Mic support, and charting.

But I also think Adobe is at fault. I don’t think we’ve done a good enough job of making it easy to integrate Flash and HTML. Even now internally you hear things like “HTML strategy”, or “HTML versus Flash” and I haven’t heard a lot of talk about how we’re going to take what we know about RIAs and web apps and apply that to both Flash and HTML.

But I think that’s changing. So part of the post is to give heart. We recently had a big re-organization and most of the Creative Suite web tools and the Platform (Flash/AIR/Flex,etc) are together in one business unit. I think that means you’re going to see a lot of Flash-knowledge applied to our HTML tools and hopefully you’ll see a lot more about using Flash and JavaScript together so we don’t need sessions like Jamie’s a year from now.

With the web design tools and developer tools in one place, I’m looking forward to talking a lot more about rich web solutions that provide some innovative examples of technology working together and encouraging HTML/JS developers to look at Flash where appropriate and Flash developers to think about HTML/JS when it makes sense. The easier we can make that for developers the more success we’ll have and the better applications we’ll see.

Picnik now Working with Picasa Web Albums

This hits two of my favorite things; Flex applications and in-browser RIAs. Picnik, the Seattle-based startup that was purchased by Google a little while ago built one of the coolest photo editing applications on the web and were very early users of Flex. I always loved the customization work they did to Flex and stopped by their offices a few times to talk with the founders and meet the team. I was really happy when they were bought by Google (they also moved closer to the Adobe offices in Seattle).

So it’s really cool to see the announcement today that they’re integrating with Picasa to allow Picasa users to edit their photos using Picnik. Combine that with the blog post by YouTube about how they’re using Flash and I think there is a lot of momentum for Flash at the worlds biggest web company.

And hopefully that means a lot more great browser-based RIAs. Google loves the browser and is pushing it further with things like ChromeOS. I still think the browser is the best way to deliver applications and content. Picnik is a great example that you can take Flash and build something very powerful with a great user experience but with all of the freedom and flexibility of the browser. That’s clearly the model Google likes and they’re moving forward on that front with whatever technology works best for the problem.

It’s going to be a good future.

And for those who like history, John Cook pulled up the original email that started Picnik where they discuss Flash and compare it to other technologies. It’s a cool trip down memory lane.

Now Available: Effortless Flex 4 Development – Great for Flex and PHP Developers

The official Flex team blog reminded me that Effortless Flex 4 Development is now available. It’s the perfect book for Flex and PHP developers and I got an inside look at it as I did the tech-reviewing for it. Larry is an awesome author who usually does a lot with PHP but recently started getting into Flex and in talking to him it sounds like he really enjoys it. So definitely go out and grab a copy. I think we’re going to try and buy some to give away as I go out and talk to PHP and Flex developers alike.

Charting data with Flex and PHP

This is a fairly straightforward topic but I did a quick DZone article on charting with Flex and PHP using the data-centric design wizards in Flash Builder. The wizards make it very easy to at least get the basics down and start using data in charts, and I covered some basic ways to add animations and interactivity.

I’m working on a more in-depth article with Zend that will cover grouping/sorting/etc on both the client and server side. It will provide some info on how to structure your data and make it more flexible for manipulating when it’s in the chart.

What I Learned About Presenting From Cirque Du Soleil

As an evangelist, obviously a lot of what we do is presenting. I always wish I could make my presentations more interesting and more of a show so I’m always watching how other people present. A great example is Cirque Du Soleil, which came through Seattle as part of their Kooza show. At a basic level, the Cirque Du Soleil presentation isn’t too different from any other presentation. A lot flashier, a lot more badass, but still a basic presentation. As I was watching I noticed a few things that I wanted to jot down and (hopefully) incorporate in my future presentations.

Make the easy stuff seem hard

This one is pretty basic but the Cirque Du Soleil guys do a good job of it. At the beginning in most of the acts, the performers look a little tentative. There’s a bit of a dramatic flair, they look like they’re concentrating really hard (and they probably are) and setting a baseline for what’s coming later. By building up the suspense the audience is impressed right from the beginning. The stuff after that is just gravy. And when they break out the safety gear, you know stuff is going to get real.

Always mess up

I thought this was fascinating. In a couple of different performances, the performers screwed up the act. Once it was a high wire guy messing up a jump and another time it was during a giant spinning-dual hamster wheel act where one of the performers almost falls off. At first I wasn’t sure it was on purpose, but after asking around, they always mess up the same part of the show. Why? One, it adds dramatic flair. But most importantly, it adds to the perception that this is really hard stuff to do. Then when they go into the hard stuff and nail it, the crowd goes nuts. I’m not sure how to do this on the tech side, but I have a couple of ideas.

Know how awesome you are

These guys (and girls) do these acts on a pretty consistent basis. They’re so good they can create a fairly convincing fake mess up. At the end, they let you know it. They do a great job of selling what they just did and getting people to cheer for them. Ultimately I think this is about confidence, but it’s also about taking yourself outside of the bubble and remembering that not everyone can do what you do. When you travel with Cirque du Soleil all you see around you are people just like you, but you’ve got to remember that the audience can’t do what you do. And make them love you for it.

Have a theme

One of the reasons I love Cirque du Soleil is that every act has a theme. The costumes, the props, the music and the choreography all revolve around a central theme. Kooza had a definite South Asian feel and some of the acts played up that more than others. But all of it together helped tell a story and engage the audience more and each act built on the theme a little bit. This is probably a bit tougher to do in a technical presentation but I can think of some things I’d like to do that would be more thematic in my presentations.

If you get a chance to see Kooza, it’s a great show. Just watch for the mistakes.

I Hate That We’ve Gone Native

I love the web. I love web development, I love web applications, and most importantly I loved where we were going with web applications. I was obviously a huge proponent of rich Internet applications and capturing a better user experience inside of the browser. Combine a great user experience with all of the good things about running in the browser (deployment, ubiquity, cross-platform, free publishing) and I thought that was a winning combination.

Then the App Store came along. Now everything is about standalone mobile applications. It feels like the web has taken a backseat as developers plunge head first into building native applications and users download them in droves. What bugs me the most is that I’m the same way. Most of the applications I use on my phone have perfectly good browser equivalents but I use the native app.

Dancing With Wolves

So what the hell happened? I think it comes down to two things. One, the app store provided a much better economic model for developers. One problem with the web was the downward pressure it put on the economics of content. Actual dollars were replaced with eyeballs and people started giving away the content and making money on advertising. (Think about how this affects Google, the ultimate web company; With revenue driven by advertising, they get a cut. With revenue driven by the App Store, Apple gets a cut.) With the App Store, developers can go back to charging directly for stuff they create instead of giving it away. It’s also insanely easy. They don’t have to worry about taking a credit card, setting up payments, or anything else that developers don’t want to worry about. They just have to build software, set a price, and the checks come in. That’s incredibly compelling. Especially if you’re doing development in your free time as a hobby. Now you can easily get paid for it without having to do any of the business tasks that might bog you down if you tried to do it on your own. That frictionless entry has changed the game for a lot of developers and created a huge supply of native mobile applications.

But that doesn’t explain the consumer demand for applications. I think that lies in user experience of applications. Prior to the explosion in mobile apps, we were getting close to a native-like user experience with RIAs in the browser. The components were better, the user interactions like drag-and-drop were appearing, and we were tackling problems like offline access directly in the HTML5 spec. Even the browsers were one-upping each other to be faster so we could get closer to native performance. The gap between a desktop experience and an in-browser experience was closing quickly.

Then quality mobile devices came along and changed everything. Instead of a mouse pointer we were dealing with fingers. Instead of worrying about offline access we had a ton of new functions on the phone including built-in GPS, accelerometer, camera, and a compass. The fastest and best (and in some cases only) way to take advantage of these new features was with native applications. Furthermore, the web experience was very much stuck in the old “pointer” mode. Mobile Safari on the iPhone made HUGE improvements to the mobile browsing experience, but nearly all of the websites were built for big screens and mouse pointers. Using the mobile browser on the iPhone (or any smartphone) is a lot of zooming and dragging. Even worse, some of the things we worked so hard on when it came to RIAs, like drag-and-drop, didn’t work the same way (or at all) and became more of an annoyance than a great feature.

So almost overnight all of the user interface paradigms the web had moved towards were rendered useless for this generation of mobile browsers. There were some initial attempts at fixing the issue, the best example is iUI by Joe Hewitt, but most people moved towards native apps. With better access to all of the new features, who could blame them?

The Light at the End of the Tunnel

So what does this mean for Flash developers? To be honest, I’ve been a little nervous. There is a huge drive to get Flash on mobile devices when the world seems to be crazy about apps. If you want to build apps with Flash, you can do so with AIR for Android (and eventually other platforms). But I don’t want apps. I want the web. Up to now, a lot of the interest/debate has focused on consuming basic content in Flash. People want Flash on their devices so they can watch video and play games. But we were making huge progress on in-browser RIAs with Flash. I want that momentum back in mobile form.

But what if we can revolutionize the in-browser mobile application experience the way Flash helped revolutionize RIAs on the PC? There is already an undercurrent of anti-native sentiment in the development community. Take a look at Sencha Touch, which is a fantastic looking mobile application framework designed specifically for i-devices and the mobile browser. And their first marketing campaign is even better, declaring the “end of native” at WWDC.

That’s exactly what the Flash community should be striving for. What’s so great about native? The performance? The user interface? Those are both things we can overcome with better technology and better design. Is it that it’s so easy to make money? Then the web is ripe for a better business model. The biggie is feature access. But here’s where Flash has always led the pack. We’ve had camera/microphone access forever and have always led the way in expanding the functionality the browser could take care of. If we can follow that trajectory on mobile then Flash developers are in a great position to make mobile browser apps a reality.

And that’s what I’m excited about. Screw native. I’m a web developer.

WebSocket Charting Demo with HTML5 and JavaScript

One of the PHP demos that goes over pretty well is my Flex socket demo. It used to be that Flex/Flash was really the only way to take advantage of WebSockets but with browser vendors implementing bleeding edge support for HTML5, developers can now use the WebSocket API in JavaScript. I wanted to combine that with the Canvas API and try to recreate a basic example of my Flex socket demo in HTML5/JavaScript. It mostly works (demo embedded at the bottom).

Code

  • socket.html – HTML/JS file for connecting to the socket server
  • socket.php – PHP file that creates the socket server

Who Can Run This

It’s been kind of cool to see the browser vendors really move forward to implement support for various bits of HTML5 and CSS3 without a defined spec. That can be problematic because the spec is still changing, causing code to break in new versions of browsers, but in general it means that web developers can live on the cutting edge for most browsers. Currently, the WebSocket API (and this example) should work in the latest version of Chrome and the Firefox 4 beta.

Differences in WebSockets with Flash and HTML5

Overall the WebSocket API is pretty easy to use. I took my existing PHP socket server code that works in Flash and tried to use it for the HTML5 version but all I was getting was the “close” event. The problem was that I wasn’t thinking about the handshake. Flash uses a policy file to determine whether or not it can connect, but the WebSocket API uses a handshake. I was able to grab some example code, change my PHP server to add the handshake then everything basically worked. The only other small change I had to make was to add a character (chr 0 and chr 255) to either end of the message I was sending through the socket_write method. I’m still not entirely sure why this is, but my onmessage event wouldn’t fire until I added those.

Charting with Canvas

I’m very excited about the Canvas API in HTML5. If you’re a Flash developer who has been working with the Flash drawing API, you’re going to be able to do some very cool stuff. The APIs are fairly similar with some syntax changes that you have to be aware of. The biggest pain I found was that once something is on the canvas, it’s on the canvas. You can’t reference specific drawn elements like you can in ActionScript. That makes doing things like the hover effect on specific charting points basically impossible.

Partly because of that, and because I’m still getting used to JavaScript I went with a very scaled down version of the chart. All this chart does is draw some grid lines and then plot the points as it gets them from the socket server. When you get to the end, the points are drawn off the page. I also couldn’t really figure out how to add to a path in a function call so I just went with the points instead of making it an actual line graph. I’m fairly sure that most of these are due to my JavaScript incompetence and not a limitation of Canvas.

Conclusion

It was both a lot of fun and very painful to go back to JavaScript. It’s an incredibly powerful language but if you come from Flash, you’ll find yourself banging your head against the wall because of subtle differences. The one thing that keeps tripping me up is figuring out how the DOM works compared to Flash. Another sticking point is the tooling. We have very good tooling on the Flash side compared to JavaScript. Chrome’s developer tools and Firebug both help a lot, but there’s no tool out there that provides code completion for the Canvas drawing API. When you don’t know the API that well, it means a lot of Googling, and a lot of the examples are pretty basic. I think a tool with basic code completion for Canvas would make it a lot easier to start creating complex content in.

It’s definitely rough to go from Flash to JavaScript but hopefully I’ll be playing around with the new stuff in HTML5 more, especially as Dreamweaver gets more support baked in.