Sometimes, languages scare the hell out of me. Read jack herrington’s article about using dynamic php for database access to see what i’m talking about. A feature of php 5 is the ability to add member functions and variables to a class at run-time. In Jack’s article, he uses this to create a dynamic class for database access which morphs depending on which table it’s based off of.
I’ve worked with Jack and he’s a brilliant guy, especially since he added many disclaimers, and this quote to his post: “as integrated development environments (IDEs) become more intelligent, they may experience problems with dynamic classes such as these because when they look up methods on a class, they won’t find them.”
That’s the first thing that came to mind when I read his article and he brings up a great point. As scripting languages become more prevalent, IDE’s need to get more intelligent. And this kind of intelligence is not limited to PHP, but is also relevant to the world of RIAs and Web 2.0.
Take Flex for example: one of the great features of Flex is the ability to use web services. Just look at what yahoo did with it.
In the Flex world, you send off an asynchronous request and wait for a ResultEvent object that contains your data

When you attempt to get code hints on event.result (which contains the data from the web service), Flex Builder 2 is only smart enough to know that event.result is of type Object. While this is good support, i think we could still do better. In a perfect world, Flex Builder 2 would know all of the properties of your web service data and hint them.
For IDEs to really succeed in the Web 2.0 world, or even in the dynamic scripting world, they need to understand more than just languages. They need to understand everything that the language understands and for Flex, that means data.
i’m not promising anything here, but I could imagine Flex Builder 2 having intelligence like this in the near future…


While AS3 is mature, I really hope Adobe invests further in prototype language development. All of the problems with prototype clashing, and mixins could easily be solved if an IDE knew how to handle them properly.
My argument against using ActionScript 1 style prototypes in projects is that it doesnt’ work well with teams.
…why not? Because no one knows if a prototype has been mangled by someone else, nor where to find it. Why is that, and how can we make an IDE to fix that? Tons of ways!
Same with mixins. Other languages allow abstract classes; why can’t we take that a step further from the opposite angle. Instead of creating a class solely for being extended, we create a class solely for being mixed into others, and other classes to share their methods. There is a lot of room here for an IDE to help in that realm.
Slow code? Sure, but this is high level stuff, speed at runtime isn’t the key, speed during development is!
What I’ve Been Doing…
I haven’t finished the migration post I mentioned weeks ago, the one related to Embedding HTML in a Flex application in AS3, as life has been busier than usual here lately. It’s at a 80% done point where it may……
Similar to PHP 5′s run-time method additions, check out Ruby’s abilities for that. There are others of course, or half-breed’s like Objective C’s categories which are not added at run-time, but are a way to add methods to a class.
But in particular, Ruby on Rails makes extensive use of this, and uses it extremely well – it is a case where the design is well done and is a nice use of such a feature (other uses can be scary indeed). When I first saw all this I thought it a bit odd, but in particular after seeing how Rails takes advantage of it, it’s really just phenomenal, and makes you wish Java and others had such features.
Talking about an intelligent IDE, I’d suggest to steal a feature from Dreamweaver. When you edit an XML document in Dreamweaver and you start to type a new tag like “some stuff” then when you type “”. Very simple but very useful.
Sorry, my last comment did get screwed because I didn’t encode the tag brackets as > and <. I just wanted to mention that I’d like to see Dreamweaver’s auto-completion for XML tags in Flex.