RSS ? Recent Blog Posts

Blogs » Archive for May, 2006

Extracting Rails code

by Tim Lucas

Ryan Carson has published his latest interview with Rails creator: David Heinemeier Hansson, where David mentions, amongst other things, that good frameworks should be extractions and not just abstractions. This isn’t exactly the first time he’s mentioned it, but you might find it interesting to note that he singled out Rails components as being an obvious culprit of high-level component bloat, a part of Rails I’ve noticed that I’ve refactored away from on numerous occasions.

I often hear requests for plugins to help with multi-step forms, and after having just implemented a multi-step checkout process I can tell you it’s definitely not a straight-forward extraction. Just figuring out form validation and storage is hard enough–do you use multiple ActiveRecord classes, one ActiveRecord class or ActiveForm objects; do you store them in sessions, cookies or the database; do you store the objects themselves or just the attributes? I think there’s just too many opinions you’d either have to account for or ignore, and either way it’d probably be better off just documenting the different approaches than a code library to encapsulate them.

On the flip side there were a few great candidates for extractions on that same project, either because I’ve reused the …

 

Another Rails blogger

by Tim Lucas

Hi I’m Tim Lucas and I’ve joined the team here at Sitepoint to keep you up-to-date with what’s going on in Rails land.

I come from a software development and usability background, a similar mix from where Rails started, and since hopping on the Rails train over 15 months ago I’ve developed a number of large applications for organisations in Oz, released a few plugins and can now be found stumbling around the hallways mumbling class def extend, deploy deploy!

It was a pleasure to meet you and be sure to stay peeled for more activity on the Rails blog from here on in.

 

Brion Vibber on Wikipedia and Mediawiki

by Harry Fuecks

Looking at the top 20 of alexa’s global 500 popular sites, one thing that stands out is the majority are primarily “read only” sites - news, search or otherwise where updates to content are primarily managed by those running the site.

The big three exceptions here though are myspaces (running .NET now I believe - was Coldfusion), ebay (have they migrated fully to J2EE yet or is some of home-grown C++ still around?) and wikipedia (LAMP). All of these are, in some way, collaborative sites where content is created primarily by users. In other words, they have to be able to support a significant volume of writes as well as reads. That’s interesting because, in terms of scaling, the more volatile the data you’re providing, the harder it gets to scale - it raises questions like “how do you cache?”, “how do you handle transactions / locking?”, “how to you distribute updates” etc.

Anyway that wikipedia runs LAMP makes it somewhat of a poster-child and, as you may know, the software used on wikipedia is mediawiki, written in PHP. Given the scale of the technical problem the wikimedia foundation has had to solve, what’s been a little frustrating in the past finding …

 

Tim’s comment challenge…

by Harry Fuecks

Tim Bray is considering the technology choices to add a comment system to his blog;

I’d like to take this occasion to learn at least one new technology.

Now he mentions Rails but reading his thoughts on the design would have to agree with his conclusion that that’s overkill. For a start why inject a long list of dependencies and a steep learning curve for a relatively simple application (that applies to any framework BTW - not just Rails)? Also as he’s leaning towards files not DB so no need for ActiveRecord etc.

Anyway - strikes me the most sensible solution would be just a CGI script (probably Perl) - he plans static output - the comments are “compiled” on approval - doesn’t need to handle high load but (to reduce the pain of that admin interface) needs to be easy to hack the UI once he can see where the time goes.

But wandering back to this discussion…

I should really buckle down and try writing a PHP app

So taking a PHP tack - some random thoughts / discussion points;

  • Do we recommend Tim use a forms library? E.g. QuickForm or Patforms (related point - where do we point him for help installing PEAR if …
 

Warming up to Yahoo! UI

by Harry Fuecks

Kevin’s written a couple or times on Yahoo!’s User Interface Library. With endless new DHTML and AJAX libraries and frameworks being released every week, you could be forgiven for being less-than-excited by yet another.

But scanning the slides of Simon’s XTech talk (PDF here) and, in particular, looking at what they’ve done with their Grid CSS stuff (which seems like a major breakthrough for those, like me, that struggle with CSS layouts), finding myself getting really interested. The impression from scanning the code and examples Simon provides in his talk is they’ve really managed to strike the balance between doing too much and too little - that yui has has genuine value but remains “low fat”.

Think there’s also an interesting story here about the development team that put yui together. In some areas Yahoo! seems to be fumbling the ball and while reading Jeremy’s blog, get the impression of a company being sucked dry by middle management. Despite that, the yui team do seem to have pulled off something pretty impressive - some reading on them here as well as an interview with Thomas Sha (the lead) here.

Anyway - only just starting to experiment / climb the learning curve so …

 

The IE Word Wrap Doppelganger Bug

by Alex Walker

Amongst IE6’s usual Guillotine and Peek-a-boo bugs, it’s almost refreshing to see it still has the ability to throw something truly unique and creative at you.

This is a new bug we located on the SitePoint cover page this morning . The XHTML for the feature article isn’t particularly remarkable in any way that I’m aware of:

- DIV#feature is set at a percentage width to scale with the page
- the illustration is placed immediately before the title and floated right
- the H1 title, H5 author credit and P blurb all wrap to the left of the illustration

As images can’t resize themselves, you would fully expect the text to wrap around the illustration as you scaled down your browser window.

And you would be right… to an extent.

IE Word Wrap Bug

As you can see, when a word in the title link runs out of space in IE6, it wraps to the next line, but also leaves a partial copy of itself on the original line — an evil doppelganger.

Bizarre — it’s like the word is torn between taking the plunge, and sticking things out on the line it knows, hoping things will …

 

Write Java Web Apps in Visual Basic (or JavaScript!)

by Kevin Yank

More from the JavaOne 2006 keynotes…

One of the new key features in Java 6 (Mustang), available now in beta and weekly snapshots and slated for release in October, is support for alternative languages running on the JVM. In particular, Java 6 will ship with support for running JavaScript code as a first-class citizen, with complete access to the Java class libraries and the ability to call back and forth between Java and JavaScript code within a single application.

At JavaOne on Tuesday, Sun took the wraps off of two new projects that are taking advantage of this capability in a way that will be of interest to web developers. The first, Project Semplice, brings the Visual Basic language to the Java platform. Not meant for porting existing VB apps over to Java, but rather for allowing Visual Basic developers to transition to the Java platform while leveraging their existing skills, Semplice lets you write code using VB syntax (including all the automatic type conversion, support for properties implemented by methods, and other niceties that VB developers love so much) that compiles to Java classes that will run on the Java 6 VM. As J# is to Java, Semplice is to Visual …

 

Microsoft’s Web Standards Motivations

by Kevin Yank

Though there is still a long road to travel before we get adequate support for web standards in Internet Explorer, Microsoft has started down that road again with the upcoming release of Internet Explorer 7. As a result, organizations like the Web Standards Project (WaSP) have shifted gears from their traditional role of lobbying against Microsft and have begun working with Microsoft on this effort. Developers are, understandably, suspicious.

In a recent interview, WaSP Group Lead Molly Holzschlag defended the developers in the trenches at Microsoft, fighting the hard fight to produce a standards-compliant browser in the face of the business realities at Microsoft:

Hate Microsoft if you want, but please don’t ever think that the developers themselves are anything but our colleagues fighting the hardest fight of all.

This interview garnered a stream of comments, some expressing concern that WaSP is taking a soft approach to Microsoft these days, others questionning just how committed to standards Microsoft really is.

On his blog, Chris Wilson (Group Program Manager of the Internet Explorer Platform team) expressed the frustration he feels when he reads these sorts of accusations. Aside from venting, however, Wilson took the time to explain just how important it is for there to …

 

A very disappointing marketing campaign — and lessons for you

by Andrew Neitlich

I’ve been curious about large-scale opt-in email houses and what kinds of results those sorts of lists generate, and so I tried two campaigns. I’m very disappointed with the results.

First, the house I use is based in the USA and works with high-profile corporate clients — brands you would recognize. They get their names via opt-in sites. They meet Can-SPAM requirements, for instance by listing the sender’s name and address on the email. So they are as legitimate as these firms get (go ahead — post away about how this is still SPAM; the point of this blog entry is to share results, not get into what’s appropriate and what isn’t).

I tested two messages. The first shared information about a free social networking site I run. It targeted 2 million opt-in small business owners.

The second shared information about two parenting sites I run.

Both emails made a soft-sell. They were educational in nature. For instance, the email to parents notified the parents about two great sites for busy parents that make parenting easier. Each email was brief and to the point, and invited people to visit the site(s).

I purchased 2 million email addresses on the first (online business networking site) mailing. …

 

Sun: Open source Java not whether but how

by Kevin Yank

Sun has conceded: Java will be open sourced.

During his opening keynote at JavaOne 2006, newly annointed Sun CEO Jonathan Schwartz welcomed to the stage Rich Green, Executive VP of Software, with the hard question: “Are you going to open source Java?”

After a little mock evasiveness, Green explained Sun’s latest thinking on the matter, ending with the bottom line: “It isn’t a question of whether, but a question of how. And so we’ll go do this.”

Green did take the time to point out that, from the perspective of community involvement and contribution to the development of the Java platform, Java is already effectively open source:

There’s two battling forces here. There’s the desire to completely open this up–complete access–I mean, so many changes of the licenses have been made that it’s virtually all there. But there is the sense of wanting to complete the program. The flip side is compatibility really matters. I don’t think anybody wants to see a diverging Java platform. One of the great values of Java has been that we’ve been able to keep it together–something you can all rely on in terms of its consistency and value and evolution. And the challenge, going forward, is how to …

 

Sponsored Links

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.

Logo Design, Web page Design and more!

99designs

  • Custom logo designs created ‘just for you’.
  • Pick the design you like best.
  • Only pay if you’re satisfied with the result.