SEO preference: does a site with WWW rank better than without WWW?

For SEO ranking purposes there is no difference between www and non-www. The www is just a subdomain of the main domain and Google considers subdomains and sub-directories equal (i.e. part of the same website, not special in any way).

You do need to pick one versus the other, though, as using both will cause you SEO problems. Since www.domain.com is a different URL then domain.com you can run into duplicate content penalties since you can pull the same information up using two URLs. To solve this:

1) Set up your web server to always forward either to the www domain or without it. This should be a 301 redirect. In Apache it would look like this:

Forward to the www

RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.|$) [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Forward to the non-www

RewriteEngine On 
RewriteCond %{HTTP_HOST} ^(www\.|$) [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

2) Make sure all of your internal links use the chosen form (even though the 301 redirect will catch this for you internal links do pass PR and help your rankings and 301 redirects dilute their value).

3) In Google Webmaster Tools tell Google to always use the www or not. It's under site configurations / settings.

The preferred domain is the one that you would like used to index your site's pages. If you specify your preferred domain as http://www.example.com and we find a link to your site that is formatted as http://example.com , we'll treat that link as if it was http://www.example.com . In addition, we'll take your preference into account when displaying URLs in our search results. It may take some time for changes to be reflected in our index.

4) You may want to consider use rel=canonical tags on your pages to make sure the search engines always know which chosen form is the right one but this is redundant since the 301 redirect should prevent them from seeing the other form.