The ASP.NET Code Behind Whitehouse.gov
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."
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.
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.
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.
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. ;-)
Javascript + Nintendo DSi = DSiCade
You think?
wait, a government project that suffers from easily remedied inefficiences??!?!
no way.
Not to mention ...
TUE, JANUARY 20, 12:01 PM EST
Change has come to WhiteHouse.gov
The first post on WhiteHouse.gov.
A "first post"?
The fact that he uses them makes them the best.
As of today, IIS6 is the best web server and ASP.NET 2.0 is the best web application framework.
for the author to show his superiority to the Internet. None of what he cites really matters.
Hail Eris, full of mischief...
E pluribus sanguinem
But I agree with the heavy jpeg compression. It is one of my pet peeves, actually. Especially when people use JPEG's for images that really should be GIF's.
And yes, PNG's are smaller but I've found that IE6 can do weird things to them. Even IE7 can sometimes do funky things with the colors in PNG images. And don't forget you can't easily do transparent PNG's until IE6 is finally flushed out of our system (if you are reading this and are using IE6, please upgrade for the love of god).
If they were using ASP.NET MVC you wouldn't have even known the thing was running ASP.NET. You could have thought it was mod_perl or ruby until you looked at the headers. Like most PHP sites, the aspx extension is a dead giveaway :-) ASP.NET MVC is url based, just like a good mod_perl app or a rails app.
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?
Virtual Betting on Facebook for non-geeks.
Take a look at http://tech.slashdot.org/article.pl?sid=09/01/21/001257. The entries have HTML tags hanging out in the text. Yep. This is some solid tech.
Personally, I think the site does a great job in balancing usability, layout, and (most importantly) good content. Given the extreme time pressures they were probably under, I think they did a great job.
hey, hopefully a new website like this can have votes for it's citizens about diff issues, stats on who voted for what, and senetor voting to ensure they follow what they say after elected. some free webspace/an email couldn't hurt either. whats webspace to an org like the govt? 2gb for all would get people more involved! as for the idea about open sourced govt, can such a concept be applied for our most imprtant (corrupt) system?
...flash based!
Fortunately, it's valid HTML.
Unfortunately...
http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.whitehouse.gov%2F&profile=css21&usermedium=all&warning=1&lang=en
The Turing test cuts both ways
You mean like his entire campaign, and probably the "first 100 days?"
I believe government should be more like technology: it does not have to look good to work and, dammit, we would really prefer it work right out of the box!
The switchover of the whitehouse.gov site also meant that the robots.txt file has changed. From around 2400 lines to just 2 lines: http://www.kottke.org/09/01/the-countrys-new-robotstxt-file
/.'s 10 Millionth
We're not designing for modem bauds anymore. Platforms having a high level of abstraction (Java, Microsoft, etc) inject meta data into the pages. Really, I consider this a non-story. Sure it's fun to see how the website could be more efficient in fine detail; however it doesn't need to be. If you really want to do that, go back to CGI gateway.
Once Obama and Co. make the wholesale switch to Ninnle, (as reported earlier), this will all become seamless anyway.
Slashdot'ers talk, think, eat, and dream in HTML.
Some can even describe their dreams using VRML.
...Macon Phillips, and don't slip it in the web site when you don't think anyone will notice. Hero? Are you kidding? Why don't we wait 4 years before we make that determination?
www.whitehouse.gov/assets/hero/624x351/hero_photo_624x351_econ.jpg
http://www.linuxjournal.com/content/open-source-force-behind-obama-campaign
My take is that the whitehouse.gov servers are run by the government and have to conform to DoD security guidelines, which have only relatively recently included Linux configurations for certain commercial distributions such as Redhat. So they probably don't have the freedom to redo the servers with whatever they could cobble together with talented volunteers for the campaign.
Anyway, we'll eventually see whether all this talk of change only runs skin deep.
The author states that CSS sprites are "somewhat involved to implement". Unless you're really new to CSS, it's very easy to do.
What I find sad is the poor choice of image formats, i.e. all the graphics of the blue border should have been in 24-bit PNG, not JPEG.
I do applaud them for having clean URLs. Most of them anyway.
...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:
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.
You see? You see? Your stupid minds! Stupid! Stupid!
So what. It is on Barry's bloody *watch* so he IS responsible. At least, that's what the Bush bashers would have said if it was his site. "Finally, remember that the administration and President Obama were not the ones who wrote the code here. [January 20, 2009; dotnetperls.com]"
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.
I went to it today. All the links worked. It looked nice and professional. It loaded fast even though I'm sure it was getting hammered.
No complaints from a user.
At the end of the day. Who gives a shit if it's 30bytes less efficient. A hummingbird landing on a telephone line probably disrupts my DSL connection worse.
I just love when people who know nothing about ASP.NET attempt to critique things:
The whitehouse.gov site has long ASP.NET IDs. There are many elements on the page that have very long IDs, which are mainly a waste of bandwidth usually. They could be easily removed on the server side.
<a id="ctl09_rptNavigation_ctl00_rptNavigationItems_ctl01_hlSubNav"...
Sorry bud, they can't really be removed on the server side - these are controls embedded in controls embedded in controls. Maybe a slight shaving of rptNavigationItems down to rptNavItms or something, but the long name is to be able to reference the embedded controls.
Please try again...
They could fix these perf problems instantly using the RPO (www.getrpo.com). If anyone knows the developers, let them know
Indeed, the page in question actually validates as XHTML Transitional which is something that is remarkably rare and shows a concern for craftsmanship.
I noticed that, too. The CSS however does not validate. Still I take your point. APS.NET is not the tool I would use, but they have done well with the tool of their choice.
Prime numbers are exactly what Alan Greenspan says they are -S. Minsky
The article forgot to mention that viewstate is enabled, which adds some bloat to the page. Most of the time it's good to disable viewstate unless you really need it.
Who cares about a 30 byte http header when your page is over 800k and ~45 requests, there's plenty of low hanging fruit to pick first. Interesting thing is in the post above a tool called the rpo is mentioned, it seems to do most of the important optimizations automatically.
Comment removed based on user account deletion
Comment removed based on user account deletion
"Finally, remember that the administration and President Obama were not the ones who wrote the code here."
Being nerd angry over whats basically a nice site just because it uses asp.net is one thing. To comment that Obama had nothing to do with the decision is just lol.
$ host www.whitehouse.gov
www.whitehouse.gov is an alias for www.whitehouse.gov.edgekey.net.
www.whitehouse.gov.edgekey.net is an alias for e2561.b.akamaiedge.net.
Reducing their bandwidth and server load is just not a big deal. (See Akamai and note that the whole site takes the path that the "image" request takes in that diagram.)
They've specifially nerfed F#'s module system to fit into the C# mold (well, CLR, really, but...) -- compare Ocaml's module system with F#'s. And, yes, Eiffel, IronPython and C# are all basically the same language, that is, the semantics only differ in trivial ways.
that's what versioning is all about, isn't it?
Not to isolate or insult you, but I've never seen such a peaceful or sane response on slashdot for a long time now.
Ignorance is a terrorism-level crime on Slashdot, afaict.
So either you're playing good or you are too good to lose on the crime scene...
There are so many nazis on slashdot - the grammar nazis, the logic nazis, the editor nazis, the distro nazis, the pattern nazis, the non-profit nazis (apache v/s gnu), the license nazis, and the overlord nazis, oh i meant Nazi overlords!
You sir, seem to be a pure soul!
This is a classic one:
ASP.Net has built in defences against XSS which are enabled by default. Most sites will however only catch this on the last line of defence; the server-side request causing HTTP error unless manually handled or overridden. It looks like this site also doesn't do any input validation for tags either causing said errors.
Really, you need to switch off the XSS checking and instead HttpEncode all the inputs manually so at least you don't break the site for potentially dangerous requests.
Still, small point though...just makes me slightly uneasy the web-admins left the server to fend for itself when dealing with potentially malicious inputs. Nevermind; It's a nice site overall.
throw new NoSignatureException();
Comment removed based on user account deletion
If ASP.Net is good enough for Obama, it's good enough for you.
If you don't use MS products at every opportunity, you are racist.
Your troll-fu is weak. Wachovia wouldn't call you, I think you meant Wells Fargo. They also wouldn't know what specific products you purchased.
Comment removed based on user account deletion
Comment removed based on user account deletion