Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Friday, June 24, 2011

SEO changes forever (or so I've read)


But you have not, as SEOs, we never really had to think as much or as broadly about, "What is the experience of this website? Is it creating a brand that people are going to love and share and reward and trust?" Now we kind of have to think about that.

How Google's Panda Update Changed SEO Best Practices Forever

This, in a nutshell, is the problem I've always had with SEO. People have seen SEO as a bullet list of things to do, a checklist of fairly mechanical steps that, if you closely follow the steps, your page rank will go higher. I read the above as an admission that the SEO consultants themselves have (until now) viewed SEO the same way. I've had clients ask me if they should spend the money on a dedicated SEO consultant and my answer was always "ehhhhh..." Following the SEO checklist might move your page rank a couple spots, but if you want your site to rank substantially higher, you need to substantially change your site. If Panda transforms "SEO consultants" to become "user experience consultants" that's probably not a bad thing.

Thursday, July 01, 2010

Visual Studio: My build actions are missing


Since this seems to be a faq without an answer: In Visual Studio 2008 (and earlier?) if your project files are missing their Advanced properties - like Build Action - it probably means you were handed a "web application" that is actually a "web site" in Visual Studio parlance. You have to create a new "web application", copy over the source files, and a few other steps to complete the conversion. Some relevant links:

VS 2005: Converting a Web Site Project to a Web Application Project in Visual Studio 2005

VS 2008: Converting VS 2008 Website to Web Application

VS 2010: Converting a Web Site Project to a Web Application Project

Friday, May 14, 2010

Adobe is becoming the Jay Leno of developer tools


Adobe needs to take a page from David Letterman: "You get fired, you get another gig! You go across the street and you punish them and you make them eat your words!"

Adobe is trying to leverage public opinion - and even government intervention! - by portraying itself as the victim of a monopoly power. They start with the assumption that the iPhone is the only gateway to the mobile web, and of course it's not. The high road would be to make a Flash runtime for Android that kicks so much ass that Apple has to change their stance or be left behind in the market. This duplicitous war of words is a low road, a beggar's stance. A Jay Leno move.

Saturday, April 17, 2010

Interactive Debugger for PHP


If you're looking for a free (zero-dollar) debugger for PHP, I've stumbled onto the combination of Xdebug installed onto the server and MacGDBp on my workstation. My favorite part is that I don't need to have a copy of the source tree on my workstation to do source-level debugging. It's transferred to me on demand by the magic of DBGP.

UPDATE: If you don't mind dropping a little money, I've been happy with the debugger in PHPStorm. You still need Xdebug installed on the PHP server for PHPStorm to interact with it.

Tuesday, January 27, 2009

Rails: Database-less ActiveRecord models


It's not unusual in Rails projects to have one or two model classes that don't inherit from ActiveRecord and don't require an associated table in the database. But what if we want half of that? What if we want a model that does descend from ActiveRecord but doesn't exist in the database? I finally found some code for doing exactly that. Here's an example:


class Feedback < ActiveRecord::Base
  validates_presence_of :mailfrom, :comment

  def self.columns
    @columns ||= []
  end

  def self.column(name, sql_type = nil, default = nil, null = true)
    columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
  end

  column :id
  column :mailfrom
  column :comment
  column :ipaddr
end
I derived this from the code at Caboose's blog. He says he got it from Techoweenie but I can't find it on Technoweenie's site anymore.

So anyway, why would you want this? In Rails, the ActiveRecord class is super powerful. It is of course an ORM first and foremost, but it has other great features. Also, other parts of Rails, ActionView in particular, function at their best if you can provide them with an object descended from ActiveRecord. If you don't have an ActiveRecord object, you have to use form_tag() instead of form_for(), text_field_tag() instead of text_field(), etc. You don't get to use error_messages_for() and you don't get the nifty pre-fills of the model's existing values when you error flash back to the same form.

In my case, I was creating a very simple feedback form so a visitor could provide their email address and leave a comment. The comment would be mailed to the site admins via ActionMailer. I actually had a seperate model, which was descended from ActiveRecord, that made a database record of the time, date, and IP address, but there was no requirement to store the comment itself in the database, so I thought that the Feedback object didn't need to inherit from ActiveRecord. Mistake! Cutting myself off from the best helpers that ActionView offers, something that should have been a dead-simple one-page form became a tedious slog[1] to program. I finally came to my senses and googled around until I found the above code.

I've used ActiveRecord-less models before, so at first I was surprised by my unpleasant experience. Then I thought about it and realized that none of my previous ActiveRecord-less models involved user interaction. They were all "plumbing" and I never needed, or missed, the ActionView helpers. If you're making a view for a model, and that model doesn't inherit from ActiveRecord, you're not doing it The Rails Way.

 [1] "Tedious slog" being relative. I find that Rails raises the bar for ease of (web) programming, to the point where it's actually a shock to deal with the same level of drudgery that PHP inflicts on me on a good day.

Tuesday, January 13, 2009

The Palm Pre SDK, or, In Defense of Javascript


So the Palm Pre is generating a lot of (mostly) positive buzz.[1] There are still a lot of unknowns around it, details of the SDK are still vague, and it may yet all turn out to be sound and fury, especially since no one is allowed to touch it yet.

Most of the negativity so far has targeted the choice of Javascript as the programming language. Personally I've never had a problem with Javascript the language. I think Javascript gets a bum rap. It's a dynamically interpreted, loosely-typed, object-oriented language. Functions are first-class objects, and it has an eval() operator. Sounds a lot like... Ruby. Or Python. Or Perl. What more do you want? Closures? I suspect the Javascript hate comes out because most programmers only work with Javascript in the context of emitting Javascript code from their C# or PHP on the server side, and/or dealing with the inevitable cross-browser inconsistencies of the various Javascript runtimes. Those things do suck, but that's not the fault of Javascript the language. When I heard about an SDK with an Eclipse-based IDE that uses Javascript for programming and HTML5 for UI, my first thought was "Oh, okay, just like Flex Builder, Actionscript, and MXML."

Okay, back to the Pre: the party line is "it's just like building a web app", but we also know the Pre has features that have no analog in web app development. I'm curious to know how they handle things like the camera, or playing sounds, or playing videos. I'd guess the SDK comes with a library of Javascript APIs for interfacing with such things, but again, we don't really know yet.

 [1] I don't like that name though. "Pre", by itself, implies that something newer and better is already imminent if you wait for it. A Palm exec said they wanted to communicate the idea of "the beginning of something new." It took Thomas 5 seconds to think of "okay, how about 'Premiere'?"

Monday, September 01, 2008

Google Chrome


Google Chrome

John Gruber is on target when he says it sounds more like an application runtime than a browser. But the key point is that it is an application runtime optimized for the kinds of web applications that already exist. They're not trying to make a "next generation" browser like Ubiquity or push some new kind of embedded applet ("Rublets - now you can make RIAs with Ruby!") Based on this one comic book-style presentation, Chrome is monomaniacally focused on making the existing crop of HTML+Javascript+AJAX based web applications run like lightning. And by extension, expand the viability of that platform into the near-term future. Which makes sense, considering how much Google has invested into that platform. Reading between the lines, it seems like the Google Gears developers said "here's what we could do with Gears, but the existing browsers are too slow/too crude/etc." So someone at Google said "fine, let's make our own browser so that the Gears guys can go nuts."

Tuesday, June 12, 2007

Safari on Windows, continued


John Gruber was the first person - that I saw - who points out that Apple makes money on Google searches done with Safari's built-in search-box. (i.e. not just browsing to google.com.) That's the angle I was trying to fill in. Apple didn't port Safari just to grow browser share. They didn't do it just to help develop for the iPhone. They did it to make cold hard cash, even if it's not obvious how.

John Gruber's angle and my angle are not mutually exclusive. In order to grow Safari's market share, and the associated search revenues, Apple has to do more than just put it out there and say "we've got the better browser." Firefox and Opera have already been doing that for years. Firefox has had some success with that, Opera less so. Safari now has to compete not only against the incumbent Internet Explorer, but also Firefox and Opera. To entice people, Apple has to create some perceived advantage to using Safari to access some part of "the cloud." .Mac can be the way to do that.

Wait a minute... "perceived advantage" of one browser over another? Isn't that what started the standards wars in the 90s? Well, yes, but that's not at issue here. In the standards wars, Netscape and Microsoft were fighting to control the de facto standards of the entire World Wide Web. If Apple wants to add value to their own web site when viewed with their own browser, so what. Especially if the browser is a free download. Do you feel outrage that the YouTube video player only plays videos from YouTube's own site? Nope.

Helping to develop for the iPhone may be a secondary motivation, but it's not the primary one. I just don't buy that, and here's why: If you're developing a web app with Safari on Windows, you're not developing for the iPhone. You're developing for Safari on Windows. Any web developer worth his salt will tell you that you can't develop for browser X on platform Y and just assume that browser X runs the same on platform Z. Differences in the way the application interacts with the underlying platform APIs can cause subtle bugs. (Or not so subtle!) You must cross-test against each combination of browser and platform. Indeed, the initial surge of Safari/Windows exploits hinges exactly on this fact:


On the OS X platform Apple has enjoyed the same luxury [...] namely intimate operating system knowledge. The integration with the originally intended operating system is tightly defined, but the breadth of knowledge is crippled when the software is released on other systems and mistakes and mishaps occur.

- Thor Larholm


URL protocol handlers on the Windows platform work by executing a process with specific command line arguments. When Apple released Safari for the Windows platform they neglected to implement a proper level of input validation for these arguments

- Thor again

Plus, to take advantage of the iPhone's new hotness, like making calls, you need an iPhone to test that stuff! So you may as well do your early work on the browser with which you are most comfortable. Would Apple like that browser to be Safari? Of course. But from the developer's own perspective, having the iPhone as a deployment target is not a compelling reason by itself to do your early work in Safari.

Monday, June 11, 2007

Safari on Windows - where is this going?


At the D5 conference, Walt Mossberg asked Steve Jobs about iTunes on Windows. Steve Jobs said there have been hundreds of millions of downloads of iTunes for Windows, to which Mossberg said "that makes Apple one of the larger vendors of Windows software." Given today's announcement about Safari on Windows, you almost wonder if Mossberg's question at D5 was a plant.

While Safari on Windows is a neat idea, you have to wonder what Apple is trying to get out of it. iTunes on Windows is a no-brainer - that's the only way to shop the iTunes store, so Apple clearly makes money on it. But what do they get out of porting Safari? Are they trying to take control of the de facto web standards? No, certainly not. In order to do that they would have to (a) take substantial market share from Internet Explorer, which is something that Mozilla hasn't been able to do in 10 years. And (b) they would then also have to wrest enough market share from Firefox so that Apple could dictate standards. Not only is that not going to happen, it's not even worth fighting for, because the RIAs are coming (i.e. Flex, Silverlight, and whoever else jumps into that ring.)

It seems more likely that in the near future, .Mac is going to gain some new capabilities, and even though it will remain cross-browser, I suspect you'll see the really super whiz-bang extras only work with Safari. Since Safari now runs on Windows, this makes every Windows user a potential .Mac customer. When they see their friend with the Macintosh using the super cool .Mac whiz-bangery, some small percentage of them will go ahead and sign up. And as the Long Tail tells us, the Internet is so damn big that a small percentage of any global market returns big bucks. In short, Safari is about to become the loss leader for .Mac in the same way that iTunes is the loss leader for the iTunes store.

If this plays out like Apple wants it to, not only will it grow .Mac revenues, it will also continue to grow the halo effect.

I mentioned this to a couple people and they considered this strategy to be a stretch. And they're right, it is. But it's a stretch that incurs almost no risk to Apple. With iTunes and Boot Camp, Apple has fostered a group of veteran in-house Windows developers. Porting Safari was not a large investment. If Windows users start buying .Mac, hurray, if not, nothing is lost.

Saturday, October 28, 2006

babble + log



This is exactly the problem I have with the "blogging uber alles" crowd. They talk about conversations -- and spend all of their time lecturing. you think Scoble actually spent any time figuring out what was going on? No, he took a sound byte he could play with and started babbling. That's conversation?

- Chuqui 3.0

Sing it brotha! Sing it to the mounTAINS!

Saturday, September 30, 2006

VBScript == teh SuxOrz


VBScript sucks in so many - oh, so many! - ways.

The interaction between VBScript and ADO is particularly non-intuitive and bug-ridden. Let me make a note of this one in particular, before I push it down into the part of my brain where it will become just another mote swirling around with all of the other instances of VBScript sucktitude in my memory.

Sometimes you want to know if a field of a database record is NULL, because some VBScript functions like Replace() will choke if you pass them a NULL field. This does not work:


for objField in rsQ.Fields
  if IsNull(objField.Value) then
    strValues = strValues & "NULL,"
  else
    strValues = strValues & "'" & Replace(objField.Value, "'", "''") & "',"
  end if
next
ASP will crash out saying "invalid use of Null: Replace()" even though the value passed the IsNull() check. This, however, works fine:


for objField in rsQ.Fields
  scratchVal = objField.Value
  if IsNull(scratchVal) then
    strValues = strValues & "NULL,"
  else
    strValues = strValues & "'" & Replace(scratchVal, "'", "''") & "',"
  end if
next
One of the nicest projects I ever inherited was from a guy who had done a site in "old" ASP (pre-dotNet) but he did all of the scripting in server-side JScript. It helped that he was a good programmer, but with JScript you spend less time fighting the language. Unfortunately, you can only combine VBScript and JScript under some narrow conditions, so if you inherit a site already done with VBScript you can't just start writing all of your changes in JScript. Even if you fit inside those narrow conditions at the beginning, you'll probably very quickly reach a point where you need to include some JScript into VBScript at a very specific point or vice versa, and the necessary ordering of the code just isn't going to work out.

What you can do that's better yet is to start a gradual migration to ASP.NET, using this really great trick for sharing session state between ASP and ASP.NET on the same server.

Monday, August 21, 2006

boundlessly accessless


So I made this Blogger/Blogspot/Google Blog account a couple weeks ago, and for the first several days I had been making sure to login to my Gmail account and then go to blogger.com, because I was sure that the Gmail login page is secure, while it's less obvious that the blogger.com login page is secure. The URL is http://blogger.com, not https, and there's nothing in the login form that says "we'll use SSL, promise." As it turns out, they do submit the password via SSL:



If I was only risking access to my blog I might not have worried so much, but I was using a password that, if intercepted, would give someone access to my Gmail. Why doesn't the login page mention SSL? Have we reached an era when people just assume sites are keeping their logins safe? (I hope not, cause it's not a safe assumption.) Or is Blogger just being sloppy?