Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

The ASP.NET Code Behind Whitehouse.gov

kdawson posted more than 5 years ago | from the netcraft-confirms-it dept.

Programming 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."

cancel ×

143 comments

Sorry! There are no comments related to the filter you selected.

Maybe we can (3, Insightful)

AKAImBatman (238306) | more than 5 years ago | (#26540059)

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. ;-)

Re:Maybe we can (0)

Anonymous Coward | more than 5 years ago | (#26540191)

asp.net != asp (classic)
Welcome to 2001 :)

Re:Maybe we can (1, Offtopic)

AKAImBatman (238306) | more than 5 years ago | (#26540337)

Did I say anything to suggest otherwise? As of right now, ASP.NET is ASP. Pointing out that they are different is like pointing out that Windows 95 != Windows XP when someone criticizes "Windows". Especially when "ASP.NET 2.0" is clearly spelled out in my post.

Now if you want to hear me complain about the inanity of ASP.NET 2.0 and 1.x being incompatible with each other, thus necessitating the need for both engines to run alongside each other in support of legacy modules, just keep it up. ;-)

Re:Maybe we can (1)

palegray.net (1195047) | more than 5 years ago | (#26541401)

thus necessitating the need for both engines to run alongside each other in support of legacy modules

I can think of several languages that have had such issues over the years ;). Anyhow, I'm a dinosaur... I still do 99% of my web development in Perl on Debian (mostly using a framework I wrote myself a couple of years ago plus a sprinkling of third-party tools). Whatever gets the job done...

The fact that he uses them makes them the best. (1, Funny)

Anonymous Coward | more than 5 years ago | (#26540211)

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.

Re:The fact that he uses them makes them the best. (3, Insightful)

MindStalker (22827) | more than 5 years ago | (#26541645)

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.

PNG/GIF i'll forgive (1)

coryking (104614) | more than 5 years ago | (#26540275)

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).

Can we choose the right technologies for a website?

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.

Re:PNG/GIF i'll forgive (1)

ergo98 (9391) | more than 5 years ago | (#26540355)

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, many ASP.NET sites use URL rewriting. http://www.yafla.com/dforbes/The_Best_And_Worst_of_2008/ [yafla.com] goes to an aspx page. http://www.yafla.com/dforbes/Could_Microsoft_be_the_Patron_Saint_of_Firefox/ [yafla.com] goes to the same aspx page, albeit with different parameters.

ASP.NET MVC brings a nice model, but it certainly wasn't first to rest-ful URL rewriting.

Re:PNG/GIF i'll forgive (1)

AKAImBatman (238306) | more than 5 years ago | (#26540493)

And yes, PNG's are smaller but I've found that IE6 can do weird things to them.

256 color PNGs work correctly in IE6 [johndyer.name] . No need to do anything special.

And don't forget you can't easily do transparent PNG's until IE6 is finally flushed out of our system

Put pngfix.js [ntlworld.com] in an IE conditional tag if it bothers you. I refuse to stop the progress train because of Microsoft's ill-gotten monopoly.

If they were using ASP.NET MVC you wouldn't have even known the thing was running ASP.NET.

I confess, I haven't used ASP.NET 3.5/MVC yet. It would have been handy back when I inherited an ASP.NET project. Unfortunately, after my poor experiences with ASP.NET's scalability (or lack thereof), I'm not really inclined to develop another site in ASP.

As a former President once mumbled, "Fool me once, shame on you. Fool me twice... you ain't gonna fool me again." :-P

Re:PNG/GIF i'll forgive (2, Insightful)

Mad Merlin (837387) | more than 5 years ago | (#26541151)

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.

Re:PNG/GIF i'll forgive (0)

AKAImBatman (238306) | more than 5 years ago | (#26541287)

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 s.

Fair enough. On the sites I used pngfix, I haven't run into these issues. Of course, these days I've started "firing" customers who use IE at all. Hobby sites are tons of fun that way. Wish I could do that at my day job. ;-)

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

FWIW, everything in the article is about marginal improvements. There's no huge bang to be had out of any of the article's suggestions, save for the fact that they'll save significant bandwidth and server resources given the massive number of visitors the site is probably seeing at the moment.

Re:PNG/GIF i'll forgive (1)

KlomDark (6370) | more than 5 years ago | (#26541431)

Hold off on the ASP.NET MVC stuff for now. It's really a pathetic implementation at this point.

Stuck with only basic HTML controls, nearly none of the more advanced ASP.NET controls work, as most continue to rely heavily on ViewState which isn't supported with the MVC framework.

So until they convert most of the advanced controls, it's just going to create more work to use it.

Worse than Ruby on Rails for now, but give them time...

Re:PNG/GIF i'll forgive (1)

liquidpele (663430) | more than 5 years ago | (#26542135)

I no longer code for IE6. It's just too much trouble. I just put a bar at the top telling them their browser is a decade old, and they should upgrade to IE7 or Firefox. At some point, you just have to say fuck it.

Re:PNG/GIF i'll forgive (1)

rk (6314) | more than 5 years ago | (#26543715)

I was about to call you crazy until I looked it up. IE6 was released August 27, 2001. Not a decade yet, but damned if it's not going on eight years.

Wow, I am getting old. Thanks for the reminder. :-)

Re:Maybe we can (2, Insightful)

zoips (576749) | more than 5 years ago | (#26540377)

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.

Re:Maybe we can (2, Insightful)

AKAImBatman (238306) | more than 5 years ago | (#26540571)

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:Maybe we can (1)

zoips (576749) | more than 5 years ago | (#26540635)

Whatever helps you make it through the day

In comparison to Tapestry or Wicket, JSP is defunct, you really can't deny that.

Re:Maybe we can (1)

AKAImBatman (238306) | more than 5 years ago | (#26540789)

Oh for the love of God. You have no idea what you're talking about.

http://java.sun.com/products/jsp/ [sun.com]

Use JSTL. Don't use JSF. There, good to go.

I was there when the first version of Tapestry was introduced the internet. It was an interesting idea, but it took quite a few revisions to make it into something useful. Today it's an alternative to JSPs for rendering, but it by no means retires the use of JSPs. Same with Velocity and Wicket. And if you try to introduce me to Spring as if it's the latest and greatest thing (rather than a technology that's been around since the turn of the century), I will have to smack you. ;-)

Of course, all of this just points to the flexibility of the J2EE platform. (Primarily the servlet layer, but using a full J2EE implementation has a variety of pleasant advantages.) Which is why I feel like getting a lobotomy every time I have to work with ASP.NET 2.0 code. It's like going from a Cadillac to a Power Wheels. (Pow-pow-power wheeeeeelsss...)

Re:Maybe we can (1)

liquidpele (663430) | more than 5 years ago | (#26542165)

Can you recommend any good beginner references to get started with J2EE stuff? I can basically install Geronimo or what not, but that's about the limit of my understanding of the stuff and It's something I'd like to learn because we use it in some of our products at my work.

Yes, I did google it, but there are so many choices and so many components that sound like they do the same thing but not really that it's overwhelming.

Re:Maybe we can (2, Interesting)

shutdown -p now (807394) | more than 5 years ago | (#26541421)

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

This isn't entirely true. For example, you can have normal ISO C++ compile into pure MSIL - VC++ does that (if you use /clr:pure). When you look at the features the runtime provides, it's pretty obvious: it has raw data and function pointers, arbitrary-layout structs (this means you can also do unions), and manual stack memory allocation. With that, you can implement virtually any language you want.

Where the problems begin is with the CLR object model. Yes, that one is quite specific, and any language that wants to deal with it (you don't have to, but you lose the class libraries...) has to support it. Note that "support" still doesn't mean "require" - for example, C++/CLI adds the constructs needed both to create and to use classes compiant with the CLR object model, but it is entirely possible to only use them to interoperate with the standard .NET class library, and write the rest of your code in good old ISO C++, using STL and Boost. And yet, your whole app still runs on CLR, including the C++/STL/Boost bits.

Then of course there is F# (though I guess you can still find some similarity to C# there - but not that much), or, heck, Eiffel and IronPython and Common Larceny - all pure .NET implementations. Will you say that they all also "fit the C# mold"?

Fitting the mold. (0)

Anonymous Coward | more than 5 years ago | (#26544149)

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.

Re:Maybe we can (0)

Anonymous Coward | more than 5 years ago | (#26543573)

The JSP solution is far more flexible than the ASP page-backing code files solution...

Yes, but JSP is still an unworkable mess. It's almost fundamentally untestable (as in TDD testable). A templating language like Freemarker or Velocity will allow you to write simple unit tests of front-end HTML rendering without having to kludge together some sort of mock servlet container setup.

And it turned out that in our case, Freemarker would render pages roughly 20 times as fast as JSPs compiled using Tomcat's Jasper compiler. In our case we use a number of deeply nested custom JSP tags (which were directly translated to Freemarker macros and includes), so that performance difference is probably not completely normal, but Freemarker should perform at least on par with JSP if not significantly faster.

Freemarker is far from perfect, but it's made our lives immeasurably better since we've migrated away from JSP (well, almost...Tomcat won't allow us to use a servlet as the welcome page, so we've got a single JSP that performs a redirect to our dispatcher servlet.)

Re:Maybe we can (1)

caramelcarrot (778148) | more than 5 years ago | (#26540447)

I'd expect that the imagine compression issues are short term to handle the large amount of traffic they're expecting now. Because they're damn ugly.

Re:Maybe we can (1)

The Bungi (221687) | more than 5 years ago | (#26540669)

The tag-substitution gobbldy-gook encourages all kinds of bad page-development practices.

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

templating taglibs seen in JSP

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

Re:Maybe we can (0)

Anonymous Coward | more than 5 years ago | (#26540725)

Go easy on him, he evangelizes Java for crying out loud. So have a little bit of sympathy for the guy.

Re:Maybe we can (2, Insightful)

AKAImBatman (238306) | more than 5 years ago | (#26540955)

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.

Re:Maybe we can (1)

ILuvRamen (1026668) | more than 5 years ago | (#26541079)

I don't use PNGs because IE6 can't handle partial transparency of pixels and some morons still use it unfortunately. Other than that, it's a better format. Oh but I did use 3 layers in one website and 2 were semi-transparent PNGs and even my 8600GTS OC can't render it while scrolling without severe skipping in IE7 or Firefox 3. I think PNG still needs some work (or the browsers)

Re:Maybe we can (0)

Anonymous Coward | more than 5 years ago | (#26541253)

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. ;-)

Don't mistake the "right" technologies for the ones you prefer. I know it is hard and all, given that this is Slashdot, but there ARE options out there that have different strengths and weaknesses.

Anyway, continue with the navel-gazing and technical hee-haws.

Re:Maybe we can (1)

shutdown -p now (807394) | more than 5 years ago | (#26541361)

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

We're talking about ASP.NET here, not plain ASP, and these are two very different thing. ASP.NET is not a "scriptlet-type technology", not any more so than JSF is - in fact, much like JSF, it's component-oriented. Yes, it does allow scriptlets, but it strongly discourages their use. The correct (no quotes needed) way to write ASP.NET markup is to use components and data binding.

I'm not sure what's wrong with a website running IIS, either. Last time I checked, the NetCraft top10 uptime list had quite a few of those, which means that they do work. ASP.NET isn't that bad either, depending on what you want to do (for some tasks I'd rather prefer any decent MVC framework, which are much more plentiful for Java).

Re:Maybe we can (0, Troll)

jmorris42 (1458) | more than 5 years ago | (#26541753)

> I'm not sure what's wrong with a website running IIS, either. Last time I checked, the NetCraft
> top10 uptime list had quite a few of those, which means that they do work.

Quite a few... interesting way to say ONE (#5) for the December report and TWO for November (#6 and #7).

Seriously, ignorant people host on Windows.... or Microsoft's slaves. That's the explanation of sites like Dell.com, they can't piss off Microsoft. You see lots of mom and pop etailers (the ignorant) hosting on Microsoft and big ones who have extensive business relationships with em. Then you see those who Microsoft essentially pay to run their stuff by giving them free consultants and often free licenses to do big conversions so they will have case studies for their PR dept. Have I left out any major classes of Microsoft hosting customers? Oh yea, places like Hotmail that Microsoft outright buys so they can (after years of pain) convert them to their inferior tech. And a few where politics dictates the tech decisions.

Sites where skilled and competent IT people picked Microsoft Internet technology based on it's technical or economic merits? Perhaps you can name one, I can't.

Re:Maybe we can (1)

shutdown -p now (807394) | more than 5 years ago | (#26542729)

Sites where skilled and competent IT people picked Microsoft Internet technology based on it's technical or economic merits? Perhaps you can name one, I can't.

Just look around for .aspx pages when you browse, you'll see plenty.

Matter of fact is, IIS6 has been good enough, and IIS7 is great - and that's what any competent admin who knows both Unix and Windows (and has seen the latter some time after W2K last time, and not in the 90s) will tell you.

Of course, you don't give any specific reasons why one shouldn't "pick Microsoft Internet technology based on it's technical merits", especially when the rest of the network is also Microsoft-centric (AD etc - and there are good reasons for that as well, depending on what you're doing), so what can I really say? If you have any specific points, bring them on. Just a word of advice - before mentioning security, actually check the exploit stats for IIS6/7 vs Apache...

Re:Maybe we can (0)

Anonymous Coward | more than 5 years ago | (#26543605)

> Seriously, ignorant people host on Windows....

Seriously, ignorant people consider technology
a religion...

Re:Maybe we can (4, Informative)

Xest (935314) | more than 5 years ago | (#26543557)

Whilst I'm a fan of PHP myself, I have to say the new ASP.NET MVC framework is rather good.

It really does beat hands down anything in the PHP world in terms of how quickly you can get something up whilst maintaining quality. I'd argue partly this is because of the Visual Studio integration and the power of Visual Studio to start with.

I wouldn't ever build a live app. in web forms, but I could be pretty tempted with the new MVC framework I have to admit. The various PHP frameworks out there that perform a similar task such as CakePHP could learn a lot from it in terms of how quickly you can build with it without the usual sacrifice of quality of software you get with Microsoft's tools (again, web forms for example).

Of course, the thing is as well, the Microsoft platform is slowly getting better, Windows Server 2008 and IIS 7 really aren't that bad, performance isn't too much different to Apache/PHP now and security since .NET is much improved. Of course, Apache was always pretty good so to say IIS is improving doesn't mean much in that context but certainly combined with .NET MVC I think the whole LAMP platform needs to watch out. The various PHP frameworks like Cake could do things such as dropping the stupid cake bake crap that fails half the time on Windows and is pretty much undocumented (It has one page in the docs that don't explain much beyond what it's for). In contrast Symfony is absolutely fantastic on documentation and so is Zend, but it's still much more hassle, and there's still many more security pitfalls you have to keep an eye on vs. ASP.NET MVC.

I'd probably like Java, but I've never used it professionally, only academically so can't compare with that. At the end of the day though, my point is that with ASP.NET MVC I can build a high quality site much more quickly and with much greater confidence than I can with any PHP framework right now.

Bill Gates for President! (0, Offtopic)

Tamran (1424955) | more than 5 years ago | (#26540069)

You think?

inefficiencies (1)

yincrash (854885) | more than 5 years ago | (#26540083)

wait, a government project that suffers from easily remedied inefficiences??!?!
no way.

whitehouse.gov Blog? (2, Interesting)

troll8901 (1397145) | more than 5 years ago | (#26540169)

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"?

Re:whitehouse.gov Blog? (1)

samriel (1456543) | more than 5 years ago | (#26540213)

I can imagine that post...

Poster:Barry
Subject:Change Has Come
FIRST!!!!!

(Black president.)

Re:whitehouse.gov Blog? (1)

Stormwatch (703920) | more than 5 years ago | (#26540531)

FIRST!!!!! (Mulato president.)

Fixed.

Re:whitehouse.gov Blog? (0)

Anonymous Coward | more than 5 years ago | (#26540599)

Hey look...it's the white pride rep. for slashdot...who woulda thunk.

Re:whitehouse.gov Blog? (1)

thegnu (557446) | more than 5 years ago | (#26540749)

I thought it would be the ever-popular:

Poster: AC
FRIED CHIKKIN!!!! :)

Fuck you Linus you fucking finnish shit eater!!! (-1, Troll)

Anonymous Coward | more than 5 years ago | (#26540093)

Linus Torvalds is a god damn thief!!! When I installed Linux it asked me for my credit card number. Two days later I got a call from Wachovia asking me if I had purchased $400 worth of Totino's pizza rolls and Mountain Dew (I hadn't). Let this be a warning to all of you out there on the Internet.

This page is a way (4, Insightful)

Nimey (114278) | more than 5 years ago | (#26540267)

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

Re:This page is a way (3, Interesting)

ergo98 (9391) | more than 5 years ago | (#26540405)

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

True enough. Indeed, the page in question actually validates as XHTML Transitional [w3.org] which is something that is remarkably rare [yafla.com] and shows a concern for craftsmanship.

Re:This page is a way (1)

shutdown -p now (807394) | more than 5 years ago | (#26541441)

Actually, merely using ASP.NET components for all markup will give you valid XHTML Transitional for ASP.NET 2.0+ with default settings. So no surprise there - it just means the guy who made the website knows how to use ASP.NET properly (well, maybe that's a surprise in and of itself, of course).

Valid XHTML (Transitional) (1)

Charles Dodgeson (248492) | more than 5 years ago | (#26541619)

Indeed, the page in question actually validates as XHTML Transitional [w3.org] which is something that is remarkably rare [yafla.com] 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.

Re:This page is a way (0)

Anonymous Coward | more than 5 years ago | (#26541383)

But... but... but... someone is wrong on the internet! [xkcd.com]

Re:This page is a way (1)

betterunixthanunix (980855) | more than 5 years ago | (#26541623)

Exactly. When I saw this headline, I expected a solid critique of the use of ASP.NET (there are certainly reasons to criticize this), but instead, it looks like a 12 year old wrote it. The website uses JPG compression, has some extra whitespace, and uses -- gasp -- gzip? That is about as important as how often I clip my toenails.

Re:This page is a way (1)

Yath (6378) | more than 5 years ago | (#26542663)

Strange - it almost seems like you interpreted everything on that page as a criticism.

Helpful advice?? (4, Insightful)

biocute (936687) | more than 5 years ago | (#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:Helpful advice?? (0)

Anonymous Coward | more than 5 years ago | (#26540347)

Normally I'd agree, but if Google gets hacked, we have a lot more to worry about than just whitehouse.gov. Think of the 8 gajillion sites using Google Anal.

Re:Helpful advice?? (4, Insightful)

c_g_hills (110430) | more than 5 years ago | (#26541757)

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.

Re:Helpful advice?? (1)

biocute (936687) | more than 5 years ago | (#26541973)

Yes that's my point.

It's somehow disturbing to see people just so easily and readily trust Google.

Funny how we hardly trust cops who swore an oath to protect us, while we firmly believe in a corporate motto.

Re:Helpful advice?? (1)

GleeBot (1301227) | more than 5 years ago | (#26541795)

The theory behind using the Google-served copies of JavaScript libraries isn't to reduce load on the whitehouse.gov servers, but to improve caching.

Since HTTP caching is URI-oriented, a browser can't tell whether whitehouse.gov/xyz.js is the exact same thing as mypetcat.com/xyz.js, but it can if both sites reference a copy stored at google.com/xyz.js instead.

Re:Helpful advice?? (1)

mangobrain (877223) | more than 5 years ago | (#26542827)

The theory behind using the Google-served copies of JavaScript libraries isn't to reduce load on the whitehouse.gov servers, but to improve caching.

This is true, but it doesn't change the fact that it still introduces security/privacy concerns. The fact remains that if the remote JavaScript changes, the behaviour of all websites referencing it will change. The method by which it changes doesn't have to involve hacking Google (DNS hijacking (site-local or otherwise), HTTP cache poisoning, etc.), and changes don't have to be outwardly malicious to have unintended side-effects (AVG's LinkScanner, anyone?).

On the face of it, though, referencing JQuery files directly from Google's servers is no worse than them referencing external resources from WebTrends Live, which I presume they have to do at some point in the tracking process.

I freely admit these comments are verging on paranoid, but the point is, intentions != reality, and just because there may be one good reason to do something doesn't mean there aren't also good reasons not to. Reality doesn't care which reason you picked.

Can't even do HTML (0)

Anonymous Coward | more than 5 years ago | (#26540295)

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.

Can do HTML all the time (1)

troll8901 (1397145) | more than 5 years ago | (#26540673)

Slashdot'ers talk, think, eat, and dream in HTML.

Some can even describe their dreams using VRML.

Is technical efficiency the immediate goal? (1)

gabroo (635458) | more than 5 years ago | (#26540323)

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.

open sourced govt please (1)

bluetigerbc (911321) | more than 5 years ago | (#26540367)

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?

Re:open sourced govt please (1)

TrancePhreak (576593) | more than 5 years ago | (#26540619)

We already had access to vote information. Such as Mr Obama likes to vote 'present' quite often.

well at least it's not... (4, Insightful)

Cyko_01 (1092499) | more than 5 years ago | (#26540423)

...flash based!

Is it Valid? (2, Informative)

gloryhallelujah (1111157) | more than 5 years ago | (#26540465)

Re:Is it Valid? (2, Insightful)

Dotren (1449427) | more than 5 years ago | (#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.

"...and has a focus more on appearance." (1)

LoadWB (592248) | more than 5 years ago | (#26540535)

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!

Re:"...and has a focus more on appearance." (0)

Anonymous Coward | more than 5 years ago | (#26543703)

I disagree. We need more technology and less government.

New robots.txt file (5, Interesting)

Cyclopedian (163375) | more than 5 years ago | (#26540555)

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 [kottke.org]

Re:New robots.txt file (2, Informative)

The Bungi (221687) | more than 5 years ago | (#26540641)

Obviously because of growth through the years. The same file in 2001 was pretty much empty [archive.org] as well.

Re:New robots.txt file (4, Funny)

hansamurai (907719) | more than 5 years ago | (#26540863)

Disallow: /firstlady/behindthescenes/text

Can't wait to crawl that one.

Re:New robots.txt file (2, Funny)

kenj0418 (230916) | more than 5 years ago | (#26541131)

That's only fair. He's the president for all the robot-american's also. They should be able to access the site as well.

And if you don't agree, you can "kiss my shiny metal ass."

Re:New robots.txt file (1)

russlar (1122455) | more than 5 years ago | (#26541867)

That's only fair. He's the president for all the robot-american's also. They should be able to access the site as well.

Richard Nixon is the true president for robot-americans!

times are changing (1)

icepick72 (834363) | more than 5 years ago | (#26540625)

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.

This will change under Ninnle. (0)

Anonymous Coward | more than 5 years ago | (#26540661)

Once Obama and Co. make the wholesale switch to Ninnle, (as reported earlier), this will all become seamless anyway.

Keep your adulation to yourself... (0)

Anonymous Coward | more than 5 years ago | (#26540809)

...Macon Phillips, [whitehouse.gov] 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

Re:Keep your adulation to yourself... (1)

CaptCovert (868609) | more than 5 years ago | (#26541071)

'hero shot' is a term I've heard bounced around in web design/publishing before, which possibly may be what is referred to here.

Campaign servers ran open source (4, Informative)

rwa2 (4391) | more than 5 years ago | (#26540993)

http://www.linuxjournal.com/content/open-source-force-behind-obama-campaign [linuxjournal.com]

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.

CSS Sprites (1)

Yvan256 (722131) | more than 5 years ago | (#26541013)

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. [w3.org]

I'm an ASP.NET developer... (2, Insightful)

Junior J. Junior III (192702) | more than 5 years ago | (#26541043)

...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.

Re:I'm an ASP.NET developer... (2, Informative)

AKAImBatman (238306) | more than 5 years ago | (#26541175)

First hit on Google. [devnewz.com] Remember to search only the "X-Aspnet-Version" (remove the quotes) part of that text. BTW, as efficiencies go, this is a pretty minor one. It matters for a site like whitehouse.gov because they're likely to get a few million visits per day. (At least in the short term.) Very few websites have that problem, so I wouldn't worry too much about it. :-)

Wow! you actually did NOT use RTFM and STFW?! (0)

Anonymous Coward | more than 5 years ago | (#26544247)

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!

Re:I'm an ASP.NET developer... (0)

Anonymous Coward | more than 5 years ago | (#26541463)

when required to work with ASP.NET I have also noticed a general lack of sharing amongst developers on forums..

where as when I am working on PHP based projects I get tons of help and full pages of example code in responses... hmm

Re:I'm an ASP.NET developer... (1)

nacturation (646836) | more than 5 years ago | (#26543107)

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

Of course it's not a link. It's an instruction that you ought to follow if you're interested in finding it out for yourself.

Not the ones who wrote the code? (0)

Anonymous Coward | more than 5 years ago | (#26541145)

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]"

Engineering nerds, this is an example! (5, Insightful)

Anonymous Coward | more than 5 years ago | (#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.

Re:Engineering nerds, this is an example! (1)

hab136 (30884) | more than 5 years ago | (#26543483)

stroke their butter soaked neck beards

I hate you for providing that mental image.

its called version2.0 (0)

Anonymous Coward | more than 5 years ago | (#26544159)

that's what versioning is all about, isn't it?

Seemed to work for me... (1)

im_thatoneguy (819432) | more than 5 years ago | (#26541271)

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.

Re:Seemed to work for me... (1)

0100010001010011 (652467) | more than 5 years ago | (#26541507)

It's not YOUR bandwidth, it's about theirs.

What is this ignorance? (4, Informative)

KlomDark (6370) | more than 5 years ago | (#26541395)

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...

Re:What is this ignorance? (0)

Anonymous Coward | more than 5 years ago | (#26541471)

And if they use mod_gzip or whatever the IIS version is, long redundant IDs become a lot less of a problem.

Re:What is this ignorance? (0)

Anonymous Coward | more than 5 years ago | (#26541799)

The only thing you need to know about asp is not to use it.

Class dismissed.

Re:What is this ignorance? (0)

Anonymous Coward | more than 5 years ago | (#26542597)

Why must these IDs be human readable? The web is ridiculous.

Re:What is this ignorance? (0)

Anonymous Coward | more than 5 years ago | (#26543659)

Damn right he knows nothing. His comment should have been:

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 should remove ASP.net.

Re:What is this ignorance? (1)

JamesNK (967097) | more than 5 years ago | (#26543685)

Sure you can. Create your own hyperlink control inheriting from the one in ASP.NET and exclude writing the id.

Re:What is this ignorance? (0)

Anonymous Coward | more than 5 years ago | (#26544201)

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...

Sure you can... you think .NET's built in control is the only way to render a hyperlink? Or even just inherit from their hyperlink class, overload the render and strip out the ID on the way out, or set the ID to null on each one manually (Which would inside a repeater require you to hook up a rowdatabound event and use findcontrol).

Unless there's CSS or javascript applied there's no real reason an anchor needs an ID, and in either of those cases I'd hope the programmer wouldn't be hardcoding a .NET client-side ID.

Not that I'd honestly bother on a typical website unless there was a serious problem it was causing, and I honestly think that half that article falls under the heading "Yeah, but on the other hand it works anyway", but to say the language can't support removing ID's from HTML elements... A challenge that's not always worth the effort I'll give you, not possible though is just not understanding what's available in the language.

Fix the problem now (1)

EdRob (1457815) | more than 5 years ago | (#26541529)

They could fix these perf problems instantly using the RPO (www.getrpo.com). If anyone knows the developers, let them know

Re:Fix the problem now (1)

TJCunn (1457865) | more than 5 years ago | (#26542609)

Its a great looking site, and since we're setting a new path for the country i agree lets fix it now and move forward.

Viewstate is enabled (1)

jboker (990329) | more than 5 years ago | (#26541673)

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.

Re:Viewstate is enabled (1)

jboker (990329) | more than 5 years ago | (#26541791)

Or it does and i missed it

Pick the low hanging fruit. (3, Interesting)

mr sharpoblunto (1079851) | more than 5 years ago | (#26542055)

Most of the optimization suggestions in TFA are going to offer no real performance benefit. With gzip on, whitespace, long ID's & viewstate make pretty much no impact on the final page weight, but doing these "optimizations" is going to make your page a hell of a lot harder to maintain. Don't believe me, go to webpagetest.org [webpagetest.org] and have a look, HTML accounts for only around 5% of the final page size. The best thing these guys could do to optimize the site would be to
  • combine the css and javascript files.
  • minify the javascript (as it is its taking up around 20% of the page weight)
  • perform more aggressive css spriting of the gif and jpeg images to slash the request count further.
  • remove ETag headers and add far future expiry headers to the images to speed up repeat page views and cut down on 304 responses from the server.

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.

ROFL at the author (0)

Anonymous Coward | more than 5 years ago | (#26542169)

"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.

Anyone try a DNS lookup? (2, Informative)

iabervon (1971) | more than 5 years ago | (#26542201)

$ 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 [wikipedia.org] and note that the whole site takes the path that the "image" request takes in that diagram.)

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>