Kevin Greer's Stuff
[ start | index | login ]
Bio | Projects | Quotes | Books | Links | People

Wednesday, 18. June 2008

Skills shortage hits games firms

This BBC article claims that >>Skills shortage hits games firms. I wonder if this could posssibly be related an earlier BBC article entitled >>Games industry 'burns out talent'. Perhaps if the industry provided rewarding long-term careers to experienced developers, rather than short-term exploitation of a continuous stream of beginners, then they wouldn’t be in this position. Rather than concentrating on training new developers, they should look at re-attracting former developers back into the game industry with competitive salaries and sustainable workloads. Also, doing a better job at retaining the talent that they already have, would also help.

PermaLink

no comments | post comment

Friday, 09. May 2008

More Journal of Object Technology

More >>Journal of Object Technology articles that I found interesting. This is an update to my >>list from two years ago. PermaLink
no comments | post comment

Tuesday, 06. May 2008

Javascript 'with' Statement *NOT* Considered Harmful

JavaScript guru Douglas Crockford >>considers the ‘with’ statement harmful.

His reasoning is that if you do something like this:

with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) {
    bing = true;
    bang = true;
}

Then “there is no way that you can tell by looking at the code which bing and bang will get modified”.

He instead suggests doing something like this:

var o = ooo.eee.oo.ah_ah.ting.tang.walla.walla;
o.bing = true;
o.bang = true;

But this doesn’t limit the scope of the ‘o’ variable and doesn’t have a satisfying block-structure (well, if that’s the sort of thing that brings you satisfaction).

You might think that you could do something like this:

{
   var o = ooo.eee.oo.ah_ah.ting.tang.walla.walla;

o.bing = true; o.bang = true; } // ‘o’ is still defined here

, to limit the scope and introduce a block-structure. But in the Firefox JS implementation at least, this doesn’t actually do what you would expect. The ‘o’ variable is still defined after the end of the block.

So here’s my solution:

with ({o:ooo.eee.oo.ah_ah.ting.tang.walla.walla}) {
    o.bing = true;
    o.bang = true;
}

Or if you’re feeling a little more Smalltalk-ish:

with ({self:ooo.eee.oo.ah_ah.ting.tang.walla.walla}) {
    self.bing = true;
    self.bang = true;
}

Notice that rather than using the object directly, I've put it into a map so that I can give it an explicit name.

You can also use the same trick to define multiple variables; essentially using ‘with’ like you would use Lisp or Scheme’s ‘let’ statement.

with ({
   walla : ooo.eee.oo.ah_ah.ting.tang.walla.walla,
   wanka : ooo.eee.oo.ah_ah.ting.tank.walla.wanka
     })
{
    walla.bing = true;
    wanka.bang = true;
}

You’ve gotta love JS’s Object/Map duality.

PermaLink

no comments | post comment

Older Posts: 2005 | 2006 | 2007

peerbox.com | Copyright 2005-2006 Kevin G. R. Greer