Computers, Programming, Ruby on Rails, Technology, Web Programming

Clarifying my position on ASP.net

One of my most read (and most commented on) posts was the one claiming “ASP.NET sucks”, which only goes to show being a little offensive goes dissapointingly far on the internet. Since it has now been five years since I posted that, I thought a quick follow-up was in order.

I stand by most of what I said my initial post, but with a little specificity. It’s not ASP.net that’s the problem but Webforms. Unfortunately at the time Webforms was all you ever saw. There are alternatives around today (and may have been back then but none were especially high profile and none were by Microsoft).

These days of course Webforms are very much out of fashion. Following on from the success of Rails (and then many) Microsoft realised that Webforms weren’t an idea that could keep up with modern web development. A quick glance at the ASP.net home page today shows four out of five articles talking solely about ASP.net MVC and one article talking about both MVC and Webforms (of course that will vary by day I but I doubt the result will be very different).

So taking into account a minor title change (ASP.net Webforms suck!) I’d say my original point stands…

Computers, Entertainment, Ruby on Rails, Technology

Nokia 770

My recently ordered Nokia 770 has arrived :o) For those that don’t know, it isn’t a phone – Nokia market it as an “Internet Tablet”. Basically it’s a PDA running Linux with WLAN, Bluetooth and an 800×480 touchscreen display. There’s too much about it that’s cool for me to go into right now, so I’ll leave you with the picture 🙂

Apparently the term “UMPC” is being used by a few people to describe the 770 (and similar devices) – “Ultra Mobile PC”.

Computers, PHP, Programming, Ruby on Rails, Technology, Web Programming, XML

Zend Framework

<![CDATA[Zend, the commercial endeavour of the people who brought you PHP have a produced a framework, cleverly called the "Zend Framework". It's basically a lightweight MVC framework for PHP. Lightweight in this case is good. It doesn't do as much as Rails does for Ruby (although it is significantly younger) – the most notable hole is a object-relational-mapping system. But it does provide URL rewriting for Rails-esque view/controller access.

I started writing my clever language thingy in it.

The biggest problem I had was getting it to work with IIS. Which I couldn’t. I decided since I had IIS installed I’d give it a go. Unfortunately you require mod_rewrite which IIS doesn’t have. So I installed ISAPI_rewrite, a version for IIS. After an hour of trying to get it to work I went and downloaded Apache 2.2. Which was my second mistake You see it seems PHP doesn’t work with Apache 2.2. Not sure why but I found a vague mention of it on a forum after trying for another hour to get it to work. So I got Apache 2.0 and everything worked.

Of course there are reasons not to use PHP 5 with Apache 2, but meh.

There is one little problem with the Zend Framework, I think. It seems to be printing a space somewhere before any other output. It wouldn’t be a problem except I need it to output XML and a space at the beginning makes Firefox (and probably Internet Explorer) explode.

Apache, IIS, Zend, Zend Framework, MVC]]>

Computers, Javascript, PHP, Programming, Ruby on Rails, Technology, Web Programming, XML

BackBase really pushing AJAX

<![CDATA[BackBase is another AJAX toolkit. This one is different though. It’s not really an AJAX toolkit, more a toolkit powered by JavaScript taking advantage of AJAX. The clue is the price. Yes it has a price – $2000 to be exact. There is a “community edition” that is free for personal use though.

Anyway, I don’t have time to run down all the features but basically it defines a whole new bunch of tags allowing you to create complicated content in a declarative HTML style way. These tags are then translated into proper XHTML on the fly by the back end JavaScript engine. Since the clever work is actually handled by the browser, you’re free to use whatever you like on the server (PHP, Ruby) including static HTML pages – outputting BXML is no different to outputting HTML.

In fact BXML has a very ASP.NET feel to it and embedding BXML into an XHTML page along with ASP content could have the ultimate cleanness about it (syntax isn’t one of my complaints about ASP.NET). It should be noted that Microsoft are working on Atlas which could be something very similar but I haven’t looked into it…

It all seems very clever.

BackBase
BackBase Demos
ASP.NET Atlas

ASP]]>

Computers, Galaxia, Games, Javascript, MPOGs, Programming, Ruby on Rails, Technology, Web Programming

AJAXy Scriptaculous goodness

<![CDATA[Scriptaculous is a Javascript library used for doing AJAX stuff and certain visual effects. It’s very well written, has excellent cross browser support and best of all there are cool functions in Ruby on Rails for using it.

One of the coolest features is drag and drop. I’ve already implemented it in Galaxia Ruby for adding ships to fleets 🙂

AJAX, Javascript, Scriptaculous, Ruby, Rails]]>

Galaxia, Games, MPOGs, Programming, Ruby on Rails, Technology, Web Programming

Tree structures in Ruby on Rails

This is becoming a trend – another built-in feature of Rails that will seriously help Galaxia development.

You can use acts_as_tree in a model to make it, well, act as a tree. What this means is you add an extra field to the database called parent_id that tracks object’s parents. Rails automatically manages this for you and adds extra methods for dealing with trees (things for accessing parent, ancestors, children etc.). Just like the post on type, this is something I was already doing with Galaxia but managing myself.

Galaxia, Games, MPOGs, Programming, Ruby on Rails, Technology, Web Programming

Using “type” in Ruby on Rails

<![CDATA[By default Rails applies special meaning to certain fields in a database table. One of these fields is "type". The type fields is used by Rails to create a "single table inheritance model". This sounds fairly complicated and is best explained with an example:

Imagine a forum system. A forum will have threads and replies. Threads and replies are different and have different functionality, but certainly share a lot of characteristics. So you might create a class message with two sub classes: replies and threads.

In Rails you can store all these in one messages table with a type field set to either reply" or thread. When you load a message it will actually create either a reply or thread object (in stead of a message object). When you create a new object it stores it in the messages table with the correct type.

This is ideal for Galaxia. In fact it's the model I used all along – I just had to write the functionality myself.

Single Table Inheritance, OOP, MVC, Ruby, Rails]]>