If I were in charge of Adobe

Clearly, Adobe is losing the battle with Apple. There’s no Flash on the iPhone, iPod Touch and iPad and there’s no sign that there will ever be.

Apple is not a company that can be easily influenced. They do things the way they think is right even when everybody else disagrees. Even when everybody predicts is going to cost sales. They’ve been doing it for more than 10 years and it’s working very well for them, they are not going to stop now. For Adobe, Apple is a lost cause.

I actually dislike both companies. Apple is building an extremely proprietary environment. They are much worst than Microsoft. Apple’s tax not only includes the operating system, it also includes every third party application. Not only they get a part of everybody’s cake, they decide who have cake and who doesn’t by controlling which applications get approval and which get rejected. If Apple ever dominates the industry, it’ll be the dark ages of computers.

Adobe is not much different with Flash. Flash is a proprietary and it works well on one and only one platform; if it does at all. Everybody else is left out. Flash has been making the web inaccessible for ages. I would be very glad if we can get rid of Flash.

If I were in charge of Adobe I would do something that would help the company remain a leader on the web and at the same time make Flash good: open source it.

I never understood why Adobe hasn’t open sourced Flash already. The specs are more or less open, there are alternative implementations, and they are not making any money by selling Flash. They make money by selling the tools to build Flash web sites and that’s not going to stop if they make Flash itself open source.

Before or while open sourcing I would make agreements with two companies: Google and HP. Make sure Flash is going to be included in Android, Chrome OS and Web OS. I would also put those phones and tablets in the hand of my developers (that is, Adobe’s), for free, as a gift, with the goal of making the Flash experience is absolutely thrilling.

I think that is Flash’s only hope.

Advertisements

The iPad's lack of Flash is a win-win situation

It seems iPad lack of Flash support is the debate of the moment. On one camp: “You can’t use the web without Flash”, on the other camp: “We don’t need no stinking Flash”. Although I do realize how a technology like Flash is sometimes needed, I’m more on the second camp. The less flash, the better.

I think iPad’s lack of Flash cause two things to happen:

  • Slow down the adoption of the iPad: surely someone will say “No Flash, No iPad“.
  • Speed up the adoption of HTML5: surely someone will consider using HTML5 to support the tablet.

Giving that the iPad is a closed device, probably the closedest non-phone computer consumers ever had access to and that HTML5 is good progress for the web, I consider both results of the iPad not having Flash positive. If I have to say anything about it, it’d be: please, stop trying to wake Steve Jobs up regarding this, you’ll ruin it.

Ensuring the displaying of flash messages in Ruby on Rails

Ruby on Rails has a special object called flash which hold its contents for one more request. It’s particularly useful to show messages after a redirect. Since it’s good style to redirect after each succesful form post, that’s where you put the messages such as: “You’ve logged in”, “Thank you for your feedback”, “The book has been added”, etc.

This flash object looks like a hash table. I normally use two items in there: notice, for good stuff and errors, for bad stuff. I want these messages to be displayed in all pages, so whenever something bad or good happens, I just drop stuff in the notice or error and forget about it. This is trivial to do, I just put this:

<% if flash[:error] -%>
  <p class='error'><%=h flash[:error] %></p>
<% end -%>
<% if flash[:notice] -%>
  <p class='notice'><%=h flash[:notice] %></p>
<% end -%>

on the application layout.

The problem with doing that is that it doesn’t look nice. I expect error messages and success messages to be near the forms or UI elements I’m interacting with. That means that every view or page will put it in a different location. No problem, you just add that same snippet where you want the messages to appear.

Then there’s a second problem: you get messages twice. If you remove them from the application layout, then you have to remember to put in absolutely every view, even those that you don’t expect to never show an error or notice. I don’t trust myself to always remember to do anything, so what happens is that I can’t just drop something in the flash and expected it to be show, I have to check every time.

I’m doing this in for a pet projects with less than 10 views, but I think big. I think of the project having 100 views and three coders than don’t know all the implicit rules, like adding the display message snippet to every view they create.

I’ve came up with this solution. I created a partial view with this content:

<% if not @messages_rendered -%>
  <% if flash[:error] -%>
    <p class='error'><%=h flash[:error] %></p>
  <% end -%>
  <% if flash[:notice] -%>
    <p class='notice'><%=h flash[:notice] %></p>
  <% end -%>
<% end -%>
<% @messages_rendered = true -%>

That partial view is rendered from the views and also from the application layout, but it displays the messages only once. Thankfully Rails renders the partials inside the views first, so that the messages gets displayed according to the view, and if the view didn’t display them, the application layout will.