Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming Government The Internet IT Technology Politics

The ASP.NET Code Behind Whitehouse.gov 143

An anonymous reader writes "The author looks at the markup for the new whitehouse.gov site, launched today. It uses ASP.NET and various JavaScript libraries. It suffers from various inefficiencies, most easily remedied. Check the images and techniques used to build the site front-end."
This discussion has been archived. No new comments can be posted.

The ASP.NET Code Behind Whitehouse.gov

Comments Filter:
  • Maybe we can (Score:3, Insightful)

    by AKAImBatman ( 238306 ) * <akaimbatman AT gmail DOT com> on Tuesday January 20, 2009 @09:23PM (#26540059) Homepage Journal

    The whitespace.gov site has lots of whitespace characters.

    Hmm... Freudian slip? FWIW, most of the whitespace is probably generated by the ASP technology they used. Spots where code goes can often generate unexpected whitespace. It's just a side effect of using scriptlet-type technologies.

    Don't get me started on the "correct" way to write ASP. The tag-substitution gobbldy-gook encourages all kinds of bad page-development practices. The request-time attributes + templating taglibs seen in JSP provide a much cleaner separation between logic and HTML.

    The whitehouse.gov site uses more GIFs than PNGs.

    Ouch. Welcome back to 1996. Web developers looking for the smallest file size really need to learn that there is such a thing as palletized PNGs. They're even smaller than GIFs, even.

    The whitehouse.gov site uses heavy JPG compression.

    This is one place where my reaction is "BFD". As long as it looks acceptable under most circumstances, the people with the carefully color calibrated monitors (*cough*yeslikeme*cough*) can suffer a bit. Heck, half the JPGs on the internet look like garbage, so I'm not too worried about artifacting in the gradients.

    The whitehouse.gov site uses IIS 6.0. The whitehouse.gov site uses ASP.NET 2.0.

    Can we choose the right technologies for a website? No we can't! Thankfully, the President isn't hired to choose the best technology to run his website. ;-)

  • This page is a way (Score:5, Insightful)

    by Nimey ( 114278 ) on Tuesday January 20, 2009 @09:44PM (#26540267) Homepage Journal

    for the author to show his superiority to the Internet. None of what he cites really matters.

  • Helpful advice?? (Score:5, Insightful)

    by biocute ( 936687 ) on Tuesday January 20, 2009 @09:46PM (#26540293)

    Many developers use the JQuery from Google's servers for improved performance and lower latency.

    Is this guy serious? Advising Whitehouse.gov to use a remote server to serve javascripts?

  • Re:Maybe we can (Score:3, Insightful)

    by zoips ( 576749 ) on Tuesday January 20, 2009 @09:52PM (#26540377) Homepage

    The request-time attributes + templating taglibs seen in JSP provide a much cleaner separation between logic and HTML.

    Wait, are you serious? JSP is no better than classic ASP; it's arguably quite a bit worse than classic ASP since it isn't language agnostic. JSP is a defunct and outstandingly annoying technology to work with that encourages all sorts of bad habits.

    You might consider checking out Tapestry 5 [apache.org] for something a little more this century.

  • by Cyko_01 ( 1092499 ) on Tuesday January 20, 2009 @09:58PM (#26540423) Homepage
    ...flash based!
  • Re:Maybe we can (Score:3, Insightful)

    by AKAImBatman ( 238306 ) * <akaimbatman AT gmail DOT com> on Tuesday January 20, 2009 @10:16PM (#26540571) Homepage Journal

    JSP is no better than classic ASP; it's arguably quite a bit worse than classic ASP since it isn't language agnostic.

    Language agnostic is pointless when you're not writing code. Correctly written JSP 2.0 files should have no scriptlets in the pages. All the code should be in behind-the-scenes APIs or in parent servlets that use the page for rendering. The JSP solution is far more flexible than the ASP page-backing code files solution, and generally encourages better written code. Looking at ASP.NET pages that reference tags by IDs makes me want to tear my hair out in frustration. ("NO! You do NOT make six instances of the same tag so you can populate them in the page-backing code file! Arrrgghhh!!!")

    On a broader note, .NET's language agnosticism is a farce. You can have any color you want (slate, charcoal, basalt, jet, etc.) as long as it's black. There are no real differences between the languages. They have all been modified to fit the C# mold.

    JSP is a defunct and outstandingly annoying technology to work with that encourages all sorts of bad habits.

    Whatever helps you make it through the day. I've worked with ASP.NET long enough to know that a bit of reality disconnect makes the pain a little more bearable. ;-)

  • Re:Is it Valid? (Score:2, Insightful)

    by Dotren ( 1449427 ) on Tuesday January 20, 2009 @10:40PM (#26540837)
    Looks to me like a lot of those CSS results are due to trying to make it cross-browser compatible. Looks like they went pretty far back too... some of those tags have been depreciated since Firefox 0.9.

    I never really did the color comparison/validations on my pages although I can see how handy that information could be and I bet its pretty easily remedied.

    What I am surprised about is that you mentioned its valid HTML. The article mentions the site uses .Net 2.0... its been my experience that most, if not all, of the pre-built controls they offer end up compiling into invalid code. I've heard you can change this by re-writing parts of the controls and if they did that to produce valid HTML then I'm impressed.

  • Re:Maybe we can (Score:3, Insightful)

    by AKAImBatman ( 238306 ) * <akaimbatman AT gmail DOT com> on Tuesday January 20, 2009 @10:53PM (#26540955) Homepage Journal

    That "gobbldy-gook" generates valid XHTML, if you tell it to.

    So does every other page templating technology known to man. I can do it in ColdFusion if you ask me to. That doesn't make ColdFusion a particularly good language for scalable site development. Nor does it make ASP.NET anything special. And if I never see more code like this, it will be too soon:

    Featured1.Attributes.Add(...);
    Featured2.Attributes.Add(...);
    Featured3.Attributes.Add(...);
    Featured4.Attributes.Add(...);
    Featured5.Attributes.Add(...);
    Featured6.Attributes.Add(...);

    *sigh*

    Bwahaha... sorry. There are better templating engines than ASP.NET 2.0, but JSP is not one of them - not in a million years.

    Because ASP.NET can output XHTML code? Listen, I've looked at nearly every template language and framework on the market. 90% of them result in coding one's self into a corner. JSP may be simple, but that's it's strength, not its weakness. Especially when you break up your JSP code into smaller pieces and use a higher level abstraction at the servlet level to produce more maintainable code.

  • by Junior J. Junior III ( 192702 ) on Tuesday January 20, 2009 @11:04PM (#26541043) Homepage

    ...and, admittedly, a pretty sucky one. I figured out html on my own and it's not the main thing I do at work, so I never learned how to do things "the right way", and neither did any of my co-workers, for the most part.

    I do want to do things the right way, so I read articles like the one linked to in this story with interest. However, I get NOTHING out of them when they're written like this:

    The whitehouse.gov site uses ASP.NET 2.0. The HTTP header that identifies the software says "X-Aspnet-Version: 2.0.50727". There is a way for this header to be removed, which saves about 30 bytes of bandwidth on every response. [Search for 'X-Aspnet-Version']

    It's annoying to read someone going off about inefficient practices without telling you how to do it better.

    "There is a way?" Nice. Thanks for sharing.

    (Yes, the "[Search for 'X-Aspnet-Version']" is dead text, not a link to anything...)

    It's like this with virtually every other tech problem I've ever tried to research... Zillions of pages of people complaining about a problem, suggesting fixes, or claiming that something they did fixed the problem, and very little in the way of actual, detailed information about the fix, how and why it worked, and what exactly the problem was that it solved.

  • by Mad Merlin ( 837387 ) on Tuesday January 20, 2009 @11:16PM (#26541151) Homepage

    The PNG hack for IE6 has some rather fatal drawbacks, particularly if you want to use it to replace background images instead of just regular <img>s. The most obvious issue is the z-index one, in that the PNG hacked PNG is rendered on a layer on top of the canvas, for which no events (including clicks) will pass through, unless you throw in a lot more hacks and you're really lucky. The other more insidious problem is that any element with a PNG hacked PNG must have layout, meaning it's almost guaranteed to have nasty side effects on any non-trivial page. I don't really care about IE6, but out of curiosity I tried applying the PNG hack to the gameboxes in Game! [wittyrpg.com], and quickly scrapped the idea after finding several major issues due to the required hasLayout hack.

    PNG8 is an interesting aside, but only marginally better than just serving GIFs to IE6.

  • by Anonymous Coward on Tuesday January 20, 2009 @11:23PM (#26541213)

    You will encounter this sometimes in your life, and you better get used to it. Sometimes, believe it or not, things are done simply because they need to be done.

    They don't spend a lot of time laboring over every little detail, they have a list of tasks and a deadline and they do their best to meet the deadline.

    They anticipate that nerds who nitpick Battlestar Galactica episode continuity errors will likely come in and stroke their butter soaked neck beards and chortle about how this or that could be done better to achieve 5% faster page loads, or allow for translation into Swahili.

    But, they get paid either way and in the grand scheme of things trying to impress anyone on Slashdot is probably pretty low on anyone's to-do list.

    As someone who's argued with people about vi vs. emacs in the past, I can honestly say you guys have reached a new low both in wasting time, having no worthwhile point, and being worthless slashdot editors. The trifecta.

  • Technically its the same server and software that was on whitehouse.gov yesterday under the Bush Administration. Like the Defense Secretary, keeping the stuff that works and would be a hassle to change around for right now.

  • by c_g_hills ( 110430 ) <chaz @ c h az6.com> on Wednesday January 21, 2009 @12:26AM (#26541757) Homepage Journal
    Who said anything about hacking? It's entirely feasible that they would change the script they serve up themselves. It would allow Google to track all visitors to the site who have javascript enabled, a possible privacy violation.

One man's constant is another man's variable. -- A.J. Perlis

Working...