• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

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

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.
 
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...
 
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 😛
 
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.
 
Back
Top