Recent Blog Posts
Blogs » Archive for December, 2007
Visual Studio 2008 Review
I know it’s a bit late, but as promised here’s a review of Visual Studio 2008. I’ve had it for a while now, but I wanted to wait until I’d worked on a few projects with it before I offered my opinion.
Overall, it’s a solid improvement over 2005. The guys at Microsoft have made some good changes that actually improved the development experience rather than just adding a bunch of fluff.
Lexical scope to appear in PHP?
I mentioned briefly, in my last post, that Wez Furlong made a patch back in March, that allows a native syntax for creating anonymous functions. This could replace the heinous create_function.
Since then, I brought up Wez’ original patch again on the php-internals lists. This has prompted some hefty debate over the last week. The main argument against approving the patch, seems to be, that one would expect static scoping rules to apply to the anonymous function. After all, this is the case in similar languages, which support anonymous functions. One could only assume, that changing PHP to support this, would be a major undertaking.
One would be wrong, it seems.
Today, Christian Seiler posted a patch to allow lexical scope for anonymous functions. There are a few loose ends, but it appears to work in general. Instead of making all variables follow the static scoping rules, a new keyword (lexical) is introduced. It works similar to global, in that it must be explicitly declared, which variables are lexically scoped. This is how it looks in action:
function getAdder($x) {
return function ($y) {
lexical $x;
return $x + $y;
};
}
$add2 = getAdder(2);
$add2(8); // return 10
It’s …
Happy Holidays from SitePoint!
As I write this, most of Team SitePoint is up on the 3rd floor partying down in style. It’s the end of a big year for us, and we’ve got a lot to celebrate … but of course there’s also plenty to look forward to in the year ahead!
In 2008, you can expect the following from SitePoint:
- 99designs
The new incarnation of SitePoint Design Contests that we launched this year has been so successful that we feel it’s time it was set free to make its own way in the world. This active design community will be split off onto its own site and renamed to ‘99designs’.
Of course, this rebranding will come with a whole new visual design for the site. Watch for us to run a contest in the SitePoint Design Contests community to design the 99designs logo!
- The SitePoint Reference
Our CSS Reference site is already in closed beta, and we’re getting loads of great feedback from the SitePoint forum community. Early in 2008, this ‘reference to end all CSS references’ will open its doors to the world, and will be closely followed by …
Java 6 for Mac OS X Back on the Radar
Nearly two months on from the release of Mac OS X 10.5 (Leopard) and the resulting uproar from Java developers over Apple’s silent removal of preview builds of Java 6 for Mac, Apple has just as quietly released Java SE 6 Developer Preview 8, the first developer preview of Java 6 that runs on Leopard.
Many developers had feared that the removal of the previous preview signalled an intent from Apple to ignore Java 6 in favour of continued minor tweaks to Java 5. It seems now that the optimists were right: Apple just needed more time to get Java 6 right, so it took a step back and made some improvements to Java 5 for the Leopard release before pressing on with its work on Java 6.
The fact remains that if Apple were only to communicate with its closest allies—software developers—in a meaningful way, we wouldn’t be left playing these guessing games over the company’s intentions.
Stretchy Images with HTML and CSS
The following is a little piece published in the last Design View.
At the time of publishing, I noted that IE7 allowed you use CSS to set an image width to a percentage (for instance, 30%), but that it failed to re-calculate that percentage if you resized the browser and a full refresh was required to force the graphic to resize.
Resident CSS guru and co-writer of our new CSS reference, Paul O’Brien has pointed out a nice solution to this bug that I’ll detail below.
**************************
Sometimes, the Web’s greatest strength can also be its biggest Achilles’ heel.
As clever as web content can be at reformatting itself for different devices and screen sizes, there’s one layout issue I always battle with — the fact that liquid site layouts stretch and images don’t.
While a layout can stretch and contract, and text can flow and wrap, images are assigned a pixel size at birth, and that’s precisely how they’re displayed thereafter, regardless of their surroundings.
In most typical article or blog post layouts, this doesn’t present a huge issue. On a really large screen, …
IE8 Passes Acid2 Test, Web Standards Project Dies of Shock
Although he goes out of its way to downplay the significance of the event, there is no missing the sense of achievement in the words of Microsoft’s Dean Hachamovitch on the IEBlog today:
I’m delighted to tell you that on Wednesday, December 12, Internet Explorer correctly rendered the Acid2 page in IE8 standards mode.

The Acid2 test was developed by the Web Standards Project (WaSP) as a challenge to browser developers. In a single page, the test makes use of a broad range of features from several different web standards that developers have wanted to have in browsers for some time, and it uses them to display a deceptively simple smiley face.
The first browser to support the Acid2 test was Safari 2.0.2, back in November 2005. Since then, iCab and Konqueror have announced their own support. The current beta of Firefox 3 comes close, but isn’t there just yet. With this announcement, it looks like Internet Explorer may actually beat it to the punch!
At the time this post was published, the Web Standards Project’s web server had collapsed under the strain of traffic generated by this announcement, but thanks to the Internet Archive I was able to …
Clarke Calls for CSS Working Group to be Disbanded
Having recently announced the CSS Eleven initiative to provide designer feedback and input into the W3C’s CSS Working Group, Andy Clarke has responded to the Opera-Microsoft antitrust action by calling for the Group to be dissolved entirely and rebuilt without browser vendors in a controlling role.
He considers this necessary not only because he doubts that the representatives of Opera and Microsoft can collaborate on CSS3 while locked in a legal battle, but also because he feels it’s time the future of web standards was led by those of us who will eventually use them in our daily work, not those who hope to make money by making browsers.
Clarke’s indictment of Opera’s legal action has been echoed by many in the web design community. CSS expert Eric Meyer considers the Opera move to be bad timing, coming right when Microsoft was showing promise with IE7 and the upcoming IE8:
It’s the wrong move at the wrong time, sending precisely the wrong signal to Microsoft about the importance of participating in development and support of open standards, and I can only hope that it comes to a quiet and unheralded end.
…
Facebook Opens Up, But You Still Have To Add Friends Manually
Over a year ago two competing photo sharing services stumbled upon some thorny issues surrounding the openness of their data: Flickr initially denied Zooomr access to its API on the grounds that it was too similar a competitor, but eventually agreed to open up only if the stream was to be a two-way channel.
The social networking space is presently going through a similar stage of evolution and thrashing out similar issues — first Google announced OpenSocial, an open standard to which developers of applications for social networks could adhere to so that they ran on any network, and Facebook have recently made moves to shrug off their perception of being a walled garden by with a similar (not unexpected) announcement. Developers are faced with a choice: one option that exists but only has two players, and another option with lots of partners but has yet to be released.
And this is all fine. I hate repeating code and wasted effort, so the fact that Bebo users can now play Scrabulous with their friends without the Scrabulous team having to write a Bebo version of their Facebook app is all well and good.
But what about those users and their connections?
All of this …
The state of functional programming in PHP
With the rise of Javascript, and languages like Python and Ruby, functional programming is becoming more mainstream. Even Java seems to be getting closures in the next version, so does this leave PHP lacking behind or is there an unrealised potential hidden within?
Dynamic dispatch
What exactly defines a functional programming language, is perhaps an open question, but one key element is functions as data. As it happens, PHP kind-of-supports this concept; The syntax permits you to use variables as function-names, making the following possible:
function add($a, $b) {
return $a + $b;
}
$add = “add”;
$add(2, 8); // return 10
Unlike languages with first class functions support, the variable $add isn’t a special type — It’s merely a string, which is evaluated in the context. It may just be a wrapped up eval, but superficially it works similar, once the function has been declared.
It is also possible to explicitly call a function reference with call_user_func. This is interesting, because it accepts different types of arguments, which makes it possible to call a method on an object. More on this in a moment.
Binding state
Another prerequisite for functional programming, is the ability to bind a variable to a function. This bound function serves essentially the same …
Opera’s Antitrust Complaint: Microsoft Must Support Standards
Opera has filed an antitrust complaint with the European Commission against Microsoft, alleging that Microsoft has illegally stifled competition in the browser market by tying Internet Explorer to Windows and by failing to support web standards.
If this all sounds a little familiar to you, it’s because Microsoft fought a similar battle with the U.S. Department of Justice in 2001 and lost. Based on that ruling, Microsoft went to work making it possible for all of the bundled applications within Windows to be overridden by 3rd party alternatives. This facility exists today in the form of the Set Default Programs application in Windows XP and Windows Vista.

While these measures have satisfied the U.S. Department of Justice, they have not satisfied the European courts. According to Opera’s press release, in September the European Court of First Instance ruled that Microsoft has illegally tied Windows Media Player to Windows, despite the ability to override the program’s file associations using the Set Default Programs facility in Windows, and despite the availability in Europe of Microsoft’s special ‘N’ editions of Windows, which do not include Windows Media Player, as required by a 2005 European Commission decision.
Off the back of …
Sponsored Links
SitePoint Marketplace
Buy and sell Websites, templates, domain names, hosting, graphics and more.
SitePoint Kits
Download sample chapters of any of our popular kits.
The Search Engine Marketing Kit, 2.0
The Web Design Business Kit 2.0
The Email Marketing Kit
The Usability Kit
SitePoint Books
Download sample chapters of any of our popular books.
