CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Karl Seguin

.NET From Ottawa, Ontario - http://twitter.com/karlseguin/

May 2007 - Posts

  • I'm a sensitive MVP

    Even though it's been more than a month and a half, I'm still bothered by the fact that a room full of ASP.NET MVPs applauded Scott Guthrie when he showed off the new color picker in Orcas.

    I was P/O'd because Scott wasted our time with that (and countless other trivialities), and P/O'd that the MVPs weren't taking the opportunity to provide meaningful feedback.

    Over the past Months I've gotten the sad sense that Microsoft sees MVPs as people who can lead, directly and indirectly, to sales and little else. Talking to MS evangelist is actually more about listening than being listened to.

    I didn't want to blog about this, but it's been bothering for too long. Hopefully I'll get a couple comments of sympathy and the couple of "you suck" comments - both of which would be helpful at this point.


  • FIXED. Using Silverlight WON'T cost us well over $25 000 a month more than Flash

    UPDATE: Looks like this a planned feature for an upcoming release...good enough for me.  

    Seeing as I work for a leading advergaming / casual gaming company, you'd think I'd have a lot to say about Silverlight. And I do, but  I unfortunately can't speak about most of it. It's certainly a promising platform with a lot of things going for it, but....

    Understanding that it's an alpha, that there's little documentation and my knowledge of it is very young....AND that maybe I'm being a total idiot and there's a simple boolean switch somewhere to fix my problem, there's 1 missing feature in Silverlight which makes it completely unusable by us....the inability to issue a cross domain request.

    You see, we generally use a CDN to host all our media files, including audio, images, video and flash files and we use a normal server to host a game and all the webservices flash calls (say to log a user in). This is doable with Flash because we can place a crossdomain.xml file on our normal servers and tell it to accept hits from assets (Flash) located on our CDN. The problem is, I don't think this is doable in Silverlight, and that's a problem...because....

    Say that our normal hosts charges us $1.00/gb overage and include 1TB a month. Our CDN on the other hand, doesn't include anything, but charges us $0.10 per gb. If we do 31TB a month, using Flash it'll cost us 31 000 * $0.10 or $3 100 a month. Since we can't leverage the CDN using Silverlight (which isn't only cheaper, but much faster and capable of handling unimaginable loads), our Silverlight cost, for the same game, is (31 000 - 1000) * $1.00 or $30 000 a month.

    The numbers aren't exact...even when we use a CDN we will use bandwidth on our normal hosts (but it's a negligible amount), and the CDN actually charges you per the 95th percentile mbps (which tends to make it even cheaper!). The different is significant for as single game...but multiple it by 10 or 15 and you're suddenly bankrupt.

    This obviously isn't a concern for everyone, but it's hard to do next-gen web-based rich media stuff when you're tightly constrained by bandwidth costs (trust me, I know, it's an every day challenge).

     
    On a side note, I'd be interesting to know if the team working on Silverlight understand Casual gaming and see it as a market they'd like to penetrate.
     

  • Formal System Dictionary - Does your team speak the same language?

    Today a new developer joined an ongoing discussion we’ve been having on a new system feature we’ve been designing/implementing. Within seconds of talking about it, I found myself doing something I later realize is quite common for me: establishing a common vocabulary across all members of the team and enforcing it.


    I think I’m of the opinion that a more or less formal system dictionary should survive the push away from “comprehensive documentation.” If you live and breathe a system for months or years, you stop questioning whether your key words could possibly be misinterpreted and assume everyone knows, in detail, what you’re talking about.

     
    Our system has Assets and Unique Assets, and for weeks now the few of us chiefly responsible for this feature have had a common understanding about what those mean. When I started explaining this at a high level, we collectively recognized that our definition of Unique Asset is probably the exact opposite of what anyone not in the know would think. This is obviously problematic as it makes code harder to read and understand…everything looks like a bug because it’s doing the opposite of what you intuitively think it ought to do. It’s become so confusing that we almost always refer to Unique Assets as “unique assets…you know, the ones that aren’t unique.”

     
    You might have guessed, but the term was given to use by our client. And if you actually have a broad enough picture, it makes sense from their context (or at least from some of their context). Naturally, I guess, since communication with clients is more fragile than within the team, we simply adopt their vocabulary and build it into our system.

     
    Personally I think it’s important to adopt as much of the client’s business into the system. I’ve been part of I.T. projects that have tried to [re]define the client’s business based on the system – which is a shitty thing to do to the person paying your bill (especially when you have little relative business knowledge). I can’t help but think that a more formal dictionary, shared with all stakeholders (including the client) would be really beneficial on this, and likely many other projects. It’s certainly something I plan on exploring in detail on my next big project.

     
    (On a side note, this episode reminded me of the shift from VSS to Subversion and having half the people talk about checkouts and the other half talking about updates….also, one of the advantages often mentioned with design patterns (certainly not the only one) is that it build a common vocabulary amongst developers, which I agree with)

    Posted May 14 2007, 10:42 PM by karl with 5 comment(s)
    Filed under:
  • Microsoft's own Silverlight demo showcases how NOT to code

    After stumbling with the latest install of Orcas, I loaded up the Silverlight 1.1 chess demo and was blown away with the poor quality of the coding style used in the demo. I'm at a total loss as to how a public demo comes out like this. It truly saddens me because for every 1 shitty demo Microsoft puts out, it probably takes 100 good ones to even out.

    Am I being too harsh? Judge for yourself:

    1 -
    Multiple public types per file  which is a direct violation of Microsoft's INTERNAL Design Guidelines.

    2 -
    The namespace is "Chess", which also violates Microsoft's Design Guidelines.

    3 -
    The boardui.cs, browser.xaml and default.html.js files are all lowercase - all other files are PascalCased

    4 -
    Some simple getters are written in a single line, others over multiple lines

    5 -
    Some types and members rely on implicit visibility (don't specify private/internal/public), others specify it. I don't even know what the default type is...isn't it internal for classes and private for fields?

    6 -
    Fields are spread all over...most are at the top of the class definition, some are defined above a method half way down.

    7 -
    Single line case statement which violates Microsoft's Internal design guidelines

    8 -
    Classes with only static members that aren't sealed and don't have a private constructor (or, in 2.0, aren't marked as static)

    9 -
    An unbelievable amount of SET-only properties (again, like most of these, violates Microsoft's own design guidelines)

    10 -
    Within the same method, some fields are accessed with "this." others aren't

    11 -
    Some 1 line IF's/Loops have braces...some don't

    12 -
    Properties that call fairly expensive methods

    13 -
    Some usings are declared inside the namespace, some declared outside

    14 -
    Many if statements would benefit from Guard Clauses and Decompose Conditional refactoring

    15 -
    Poor use of #regions and very little of them
     


    There's certainly more. Many of the items above (especially #1 and #6) make the sample very hard to read. Running the project through FxCop came up with 143 issues. 

    I want to cry. 

     

More Posts

Our Sponsors

Proudly Partnered With