Alex Pooley's Blog

Hello there, my name is Alex Pooley and I'm a freelance web developer residing in Perth, Western Australia. My passion is in the development of web sites that solve everyday problems. Here's a gallery of some of my notable work. If you need a web site designer or developer, contact me with further details. Lastly, you can read more about me.

Web Stew

May 25th, 2006

Why don't you subscribe to my blog while you're here? I'm a freelance web developer and I blog about Ruby, Rails, and business online.

Go ahead and subscribe to my RSS feed. Thanks for visiting!

I’m beginning to become very irritated with the low-tech developments methods we’re stuck with for web development.

The problem is that the view portion of web applications are applications in themselves. They also follow the MVC pattern inside the applications MVC pattern. Each view ‘thing’ has data, view (css, html), and control (javascript). We’ve gone and complicated everything by throwing other programming languages in to the stew - PHP, Ruby, ASP, Java. So when you go to create a view of your site you need to hang the following technologies together *somehow*:
* XHTML
* CSS
* Javascript
* Ruby (or your language of choice)

Let me get this straight, by weaving Ruby with all the other technologies we have _increased_ the complexity. The solution? Ruby needs to replace, and not merely complement the other technologies. Here’s an idea… replace Javascript and XHTML with Ruby. So then you have:
* CSS
* Ruby

Beautiful! That’s _two_ less things to think about while coding. OK, is it possible? Yes. You will need to weave HTML and Javascript behind Ruby, but that’s the point!

Here’s an example of what I’m after.


p1 = p {’This is placeholder one’}
p2 = p {’This is placeholder two’}
p2.hide
link do
p1.toggle_visibility
p2.toggle_visibility
end
link.value = ‘toggle’

This turns in to something like

This is placeholder one

toggle

That’s a big difference in my opinion.

Note how you will have to programmatically assign HTML ID’s to elements that are referenced. This would then bind the HTML and Javascript.

Leave a Reply

buy mp3 music uk vpn