Funniest code snippet ever! Must See!

Page 3 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Originally posted by: Mucman
Oh wait! There's more!

The header and footer pages are all HTML... except they are ASP files full of :

Response.Write("
")
Response.Write(" some text")
Response.Write("</body>")

lol

Probably to eliminate the expense of switching context. It was a fairly common practice for some. e.g.:

<% =someValue %>
<span>some content</span>
<% =anotherValue %>

People thought the context switching was too expensive so they opted for:

<%
Response.Write someValue
Response.Write "<span>some content</span>"
Response.Write anotherValue
%>

Of course, the readability suffered so much that it wasn't hardly worth it. Yet another idiom of ASP that needs to die a horrible death... :)
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Originally posted by: manly
Originally posted by: Mucman

I used that behaviour when I was playing around with Win32 programming :) yet I'm still not 1337 :p

I found a couple more case statements in the code! And lots of blah = Request("blah") with no error checking! The
site can probably be exploited using lots of SQL Injection techniques...
I find it funny everytime there's a discussion about outsourcing, how some people have to chime in and deride the low quality of overseas programmers (or other engineers, or tech workers).

I know this is but one example, but I think in many organizations, software developers would have some understanding that their overseas counter-parts are not necessarily weaker than some of their colleagues.

Agree 100% there. I always thought the hubris of many american programmers was entirely unwarranted.

On the other hand, I honestly don't think there's a single software project that doesn't have a few code snippets with a fairly high geek humor value. Of course, these ASP snippets just scream neophyte, as it implies a very fundamental misunderstanding of everything.
 

Mucman

Diamond Member
Oct 10, 1999
7,246
1
0
Even more bad design... a SQL query that joins 3 tables... and all the parsing is done in ASP (instead of using WHERE id=blah). The database is Access which just makes it worse.

What annoys me is that this person applies for jobs saying they are an ASP programmer... I do the same, but I honestly think I write
some pretty sweet code! Some of it better than others, but my scripts never crash, and they are always fast! Oh well...
 

TranSoft

Senior member
Jul 19, 2003
246
0
0
nice coding...
but I would of done it like this

select case x
case "1"
x = 1
case "2"
x = 2
case "3"
x = 3
case "4"
x = 4
case "5"
x = 5
case "6"
x = 6
case "7"
x = 7
case "8"
x = 8
case "9"
x = 9
end select
selectedCruiseline = x


JP :p
 

rh71

No Lifer
Aug 28, 2001
52,844
1,049
126
Alright alright, give the girl a break. She was just testing. ;)
 

djheater

Lifer
Mar 19, 2001
14,637
2
0
Originally posted by: Electric Amish
Wow. Way to throw in an unneeded Case statement.

amish

I'm guessing they want to have the appearance of different "Cruiselines" but actually only have one.

There are about 7519 ways of doing that better, but this would work in theory if you're stupid.