Today is a good day to code

WebKit Nightlies With Local Storage and Wild CSS Functionality

Posted: December 31st, 1969 | Author: | Filed under: java, Programming, Uncategorized | Tags: | No Comments »

WebKit Nightlies With Local Storage and Wild CSS Functionality

Picture of IrvinMy head is still spinning after downloading the WebKit nightlies and messing around with the local SQL Lite storage, and the css animation and transitions. Man, this stuff has my head swimming with the possibilities for interesting applications.

More importantly, when is this going to make its way to the iPhone. I hope we don't have to wait for Apple's next big cat to be released for us to get some of these features. I know the SQL Lite access is really early, and also that most of these features are HTML 5 things being given to us early by the webkit staff, but for early features, they sure are pretty complete looking at first glance.

I don't know what the what3g is in an uproar about, with Apple starting work on HTML 5 in their browser. To me it looks like innovation. It isn't always tidy, but it is always welcome. I haven't been this excited about the web since gmail hit and AJAX started taking over!

Anyway, please check out the nightlies at: WebKit Nightlies I am not sure if it will work with PC Safari, I think those are earlier builds, but if you have a Mac, have a field day. Also, check out Drosera, the JavaScript debugger, and the Web Inspector in the debug menu, if you are using databases, you can check out the contents with that. Boy Safari has come a long way in a short time. I think the battle will definitely be WebKit and Mozilla, I wonder what Firefox is going to come back with. The new WebKit stuff is really strong.


Coding Using Mides the PHP IDE for iPhone

Posted: December 31st, 1969 | Author: | Filed under: iPhone, java, mides, Programming, Uncategorized | Tags: , | No Comments »

Coding Using Mides the PHP IDE for iPhone

Picture of IrvinSo I have been checking out twitter, and it seems that people think that I am either crazy or sadistic for writing Mides so that one could code using PHP, JavaScript, and HTML on iPhone. The truth is that I am neither, well perhaps a little crazy.

What made me write it is that I was thinking it would be awesome if I could work on my sites on the iPhone. Everyone has downtime every once and a while where you wish you could do a little work. Mides does that for me. Working on projects here and there, it is amazing how much one can get done.

The way I came up with it was actually working in NetBeans and playing around with the code-collapse. That started the thought process that lead to the code collapsing metaphor present in Mides. I know that some hate it, and others love it, but for me it seemed to be a quick easy way to drill down into your code. Also, an additional benefit was that it allowed me to focus on the class, function, or loop that I was writing.

To me, the keyboard has never really been too much of an obstacle. I understand that for others it can be a problem, but having had my iPhone since it came out, the last time I thought about the keyboard was about two weeks after I had bought it. I really wanted a flexible bluetooth keyboard for blogging from the phone, but later I really didn't need it.

While not perfect, the code completion does help a lot, and once you get used to it writing markup can be really quick. I will keep working on ways, other than the ones already present, to allow Mides to accelerate text entry.

Some of the things that frustrate me while using it, even though I wrote it, are that I can't easily look up reference material on code that I am writing without leaving the code. Clearly copy and paste would be nice, and I wouldn't be surprised to see it in a subsequent release. The ability to debug JavaScript, and a real HTTP server running locally would be awesome, to help with resolving absolute paths. Ideally, I'd be able to process PHP directly on the iPhone, but that is complicated for a number of reasons.

Many of these features will be coming, but actually most of the effort has gone into thinking about how to achieve the complexity of a full modern IDE, while keeping the UI cluttered. I feel that I have succeeded in many places, where others need work. It is my aim, however insane, to build Mides into as feature complete an IDE as is possible given the hardware and software stack provided by Apple.

I used Mides to build the mides site, including all of the canvas tag work. I think I only did about 5% of the coding on the Mac. There were some interesting incidents working with alpha quality code trying to build a site on the iPhone.

Well, feedback is always welcome, and I am not above listening to rational criticism. I want Mides to be useful to everyone, and am looking forward to the day when I can do just about all of my work from my phone!


HTML 5 Simplification: Fixing HTML by Douglas Crockford Response

Posted: December 31st, 1969 | Author: | Filed under: java, Programming, Uncategorized | Tags: | No Comments »

HTML 5 Simplification: Fixing HTML by Douglas Crockford Response

Picture of IrvinIn almost every way I agree with Douglas Crokford's Fixing HTML. I think in many ways, XHTML has started to take us down the wrong path. CSS was great, but it is now rapidly becoming a mess, largely unusable for anyone except experts. HTML is the same way. This becomes rapidly evident when you start trying to create a browser.

I really love the idea that we can abolish doctypes. They are arguably the most misunderstood element of HTML, and quite probably XML for that matter. That the browser should be responsible for determing if the markup matches a doctype element, after having to fix unclosed tags and improper syntax is part of what leads browsers to be so complex, error prone, and vulnerable to attack.

The best part of giving the html tag a version number, in Douglas' proposal is that no longer do browsers have to figure out what version of html you are coding for by looking at the doctype and your markup. If you tell it your page is html version=”5″ then if it doesn't conform, it shouldn't render. There would need to be more robust built-in error checking and descriptive error messages in browsers, but for the most part, this should be in there anyway.

Having only one scripting language allowed on a page is just common sense, I suppose there could be a justifiable business case for using more than one, but in almost all day to day use it is not practical and should not be supported.

JavaScript should never execute before the page has finished rendering. I can agree with processing scripts included in the head once the /head is encountered, partially. I don't think any scripts should be executed until everything has rendered. I know that this may limit the flexibility of designing pages where the JavaScript creates elements without explicitly calling an “init” method at the bottom of the page, but this is really, IMHO, the proper way to kick off your scripts.

There should definitely be no more document.write, and no more javascript:// urls. That was always just terrible, and allows for easy scripting attacks.

Largely, the changes that Douglas Crockford proposes for the script elements in HTML will result in faster more scalable JavaScript. If the browser always processes the scripts in the same way, and doesn't have to worry about processing the script elements at the same time as it is rendering the DOM, the execution of the script will be more predictable, and the page more robust.

Clearly frames, framesets, and iframes have to go. Although it would be nice if they are removed, to allow for, either the browser treating XHRs and scripted DOM changes as though they were page refreshes to maintain the back button's functionality, or give the scripting language a safe API to handle the back button press in the browser. The module tag that is proposed could easily replace the functionality lost by removing the frame metaphor.

I totally agree with him on the need for CSS content to be standardized, but I think that by allowing scripts to grab document elements by their CSS selectors, as well as improving encoding, the application of CSS can be cleaned up fairly nicely. CSS 3 and its support for namespaces could simplify the application of CSS as well, but the trick is to get all of the major browsers to support it.

I don't agree about empty tags, I think that they should be required to self-close. In writing browsers, it would allow standard DOM parsers to be used to process the markup instead of having to go through the document, close the tags, and then feed it to the DOM parser. Doing this in Java, even with JTidy, as fast as it is, still has too much cost relative to the benefit of just self-closing the tags.

Custom tags and custom attributes are a must. CSS is robust enough now to fully control how the item displays, whether it is a block element, or inline, etc… I worry a little about overuse of these things, and how to enforce they not interfere with microformats, etc… but in general I think that allowing flexibility as long as the custom tags and attributes meet the requirements of HTML should be OK.

Originally I was really in the XHTML 2.0 camp, but I can see the need for more robustness in the basic markup tags than can be allowed in XHTML. HTML blows up the encapsulation of data, logic, and presentation in many ways, but it needs to remain and become an easy way for relatively un-expert individuals to create rich pages. It is currently far too complicated, and the proposed methods of handling mixed HTML 5 / 4 / XHTML pages sound scary and prone to exploits. I hope this little treatise doesn't fall on deaf ears. Are you listening what3g?


The Web as Google”s Data Source

Posted: December 31st, 1969 | Author: | Filed under: java, Programming, Uncategorized | Tags: | No Comments »

The Web as Google's Data Source

Picture of IrvinOne of the things that Google is doing to the web is that it is, I believe by design, deterring individuals from doing things that make the presentation layer richer. The method by which they crawl and index pages leaves out Flash and AJAX content entirely. When a company that bases their revenue on pageviews and or visits is designing a web property, doing an all AJAX / Flash / Silverlight / etc… implementation of the interface is often swept off the table because Google and other search engines can't crawl it. It makes more sense for these companies, financially, to do a tidy looking crawlable interface.

The interesting thing about doing a “SEO friendly” interface is that it often isn't the best from an architectural perspective since your presentation and business logic are tied up in your controller. Technically speaking, you can't change one without the other changing on the application server. I talked about this a while ago in an article discussing the MVC pattern and application servers. Instead what you get, minus any JavaScript and CSS, is a nicely formatted, structured document, ready for ingestion into a massive database, i.e. Google's, and presented through a much nicer UI, i.e. Google's.

When looked at this way, it becomes apparent what the future of the web looks like. At first I was against things like AppEngine and doing SEO based pages until I realized that much of what is happening around us, RSS readers, and the like, are really interfaces that aggregate web content and taylor it to the way I want to see it in an often native interface. When you imagine the web as a massive data source you begin to understand the need to impose formatting rules on the interfaces. Not that crawling AJAX sites wouldn't be a daunting task, but with Google's technology, they could accomplish it, but I don't think it would be in their best interest.

If Google can get everyone to insert their content into the App Engine, then it saves them a step because your content would be inserted directly in their database, no need to crawl. Then Google could create optimized mashups of your content with other content to create superior applications. Anyone using AppEngine, or anything of the sort has to be aware that this is a possibility. If they want to control the creation of mashups, they should not use it.

My recommendation to build a future-proof site would be to build a clean simple version for the web, per Google's guidelines, and then build a desktop and mobile version that can digest your content and present it in a more flexible way. This may change as runtime web scripting languages become more powerful, but in some ways I think that we would be worse off without Google's webmaster guidelines. The web as a data source is a powerful concept, one that I'm sure is not lost on Google, or Vint Cerf. I just don't know how much that concept jives with the way people currently think of the web as a platform.


Do We Really Want Flash for the iPhone

Posted: December 31st, 1969 | Author: | Filed under: java, Programming, Uncategorized | Tags: | No Comments »

Do We Really Want Flash for the iPhone

Picture of IrvinI've been thinking about this for a while now, and I believe, I'm still not 100% sure, that I do not want flash on the iPhone. This is not because I don't like flash, it is more because I have seen what JavaScript does to the CPU of the iPhone, and I have also seen my iPhone rarely exceed 60Kbps. I don't want my iPhone downloading flash ads that prevent the rest of the page from loading, or tie up my CPU, or make navigation difficult.

The bigger issue is do we really need flash on the iPhone with the canvas tag, SVG, the techniques collectively known as AJAX, QuickTime, MP3, and AAC support? I'd argue that I do not. I like flash, but as with anything it is being misused to put questionable ads on sites, and I normally don't mind too much until it starts slowing down my browsing. If EDGE were 3 Mbps then it still wouldn't be too big a deal, but as it is I think I'll pass on flash for now.