- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
You seem to like to punch things, Addison. Are you secretly... CAPTAIN FALCON?!
Admin
FTFY
Admin
I'd point out that it's "consonants", but I wouldn't want Murphry's Law to come into effect.
Admin
It's a fractal. The deeper you examine it the more it looks like infinite recursion.
Simply tell the client 'MAINT-CNTRL-ADMIN' is not an option for their cost center.
Admin
Admin
[quote user="ShatteredArm]I'd point out that it's "consonants", but I wouldn't want Murphry's Law to come into effect.[/quote]
Shouldn't that be "Muphry's Law"? LOL
Admin
I know this site is all about the code, but it's not constants. It's definitely consonants.
Admin
I was kind of hoping that the developer was trying to make ASP a little more object oriented (or something) the same way you might fake it in JavaScript.
But after reading through some of the file names...probably not...
Admin
wow, i'm slower than evar. Maybe I included to many. Poopy time.
Admin
That's a typical ASP design pattern. So where's the WTF!?
Admin
I once served as a Delphi-User, in a truly legacy CRM Software (it was so legacy probably because my ex-boss never learned anything else than Delphi, and never something about OOP; it goes so far that I told hime the difference between iterative and recursive, blah...), where there were pages over pages of "uses" statements, all thanks to the magic of RAD.
...
Ummm, ..., you wrote nested functions 7 levels deep?! SEVEN?? And I though I had a nasty time. 7, naynay....
Admin
It's brilliant! He's reusing comments. Personally, I've opted for a comment class with setters and getters for each comment.
Eg.
comment = new comment; comment->set(1, "bubble sort the 120,000 rows from the database"); comment->get(1);
Then when I bubble sort the same data later on in the code I can just call comment->get(1); to re-use the same comment. See how efficient that is?
Admin
Admin
The file catalog.display.productlist1.inc.asp is missing.
There's your problem.
Admin
Admin
Once had to do an on-line survey for a large client. The major distinctions - irregular hierarchy, temporal dependencies, major and minor differences by division and geography, bilingual with unilingual subversions, regular and short versions, extremely complex branching, and added to that, five separate contests. All of this unified into a single equally complex real time on-line reporting interface.
All of this layered organically onto an initial project of much simpler scope. The client blew through years of change requests in months. Did we ever say "No" to the client? Not once. We were whores, they knew it, and we knew it.
The resulting beast was a masterpiece, akin to one of Hieronymus Bosch works, beautiful as a whole, but grotesque in its details. To maintain it was to slowly feel your soul, sanity and sentience ebb away as you became one with the Evil.
So many after me have cursed me and my creation, that surely in my Hell awaits the Beast and its faithful minions -- the client and the ever present never ending change order queue.
Admin
I considered what it looked like before I posted. But the comedy seemed at the right balance to risk being viewed as some kind of alcoholic wife-beater.
Admin
That's what I get for trusting a random Google page. :)
And I won't bother mentioning that it's Muphry's Law. (Wiki)
Admin
oh i am SO there. I freaked at my last place when I came up against this sort of thing.
I managed to write quite nice, easily traceable ASP (even though it's never been my primary skillset). You know, using functions and stuff and using VB rather than HTML for the heavy lifting.
The German sysadmin (utterly NOT a programmer at all let alone a web programmer) guy a few jobs back wrote better ASP than that heart-attack WTF.
(OK so it was one huge monolithic 133 page, and the variable names were all in German - but it was easy enough to modualarise into functions - with the aid of a web translator page...)
I DETEST things that work by 'include' type mechanisms (MSBuild, anyone...?).
Admin
O hai, Im in ur includes, destroyin ur layerz
Admin
[quote user="jim"][quote user="ShatteredArm]I'd point out that it's "consonants", but I wouldn't want Murphry's Law to come into effect.[/quote]
Shouldn't that be "Muphry's Law"? LOL[/quote]
Muphry's Law came into effect.
Admin
A wise man once said, "A determined developer can write a FORTRAN program in any language."
Substitute ASP, Javascript, whatever language you hate for "FORTRAN", and the statement remains true.
Admin
Here at the ASP headquarters at SNL, we make include files. We will work with you to make as many include files that you want.
If you come to us with one 1000-line file, we can break it into a thousand 1-line include files, if you want. Or we can make ten 100-line include files. Or one 500-line include file, twenty 10-line include files, and one hundred 3-line include files. We will make the include files that you need.
How do we make money? We do one thing and we do it well. Our advanced algorithms can break one 5-line file into five million 42-line include files. We are that good.
Admin
I would actually say the PC term is...
African American Copulation Prestidigitation (AACP)
Therefore the NAACP would be the National African American Copulation Prestidigitaors
Illusion Intercourse is what we call porn... ... sorry pr0n
Admin
Live from the ASP Headquarters in New York... it's SATURDAY NIGHT LIVE!
Admin
I bet if you did a trace on any CakePHP project you'd find the same. There's two dozen includes on every request just to load the framework.
God I hate CakePHP.
Admin
It's because the Cake is a lie
Admin
There is a better way to find out all the include files in an asp page. (learned this from page 1053 of Professional Active Server Pages 3.0 published by Wrox circa 1999).
Copy an .asp page to a name with a .stm extension and issue a request for it from your browser. The Server Side Include processing will bring in all of the #include files, but the scripting engine will not be invoked to process the script. Instead, the code will be returned to the browser for viewing. What you will be viewing is the script plus all the included script exactly as it would be given to the script engine for processing.
Obviously don't do this on a production server, and delete the .stm file as soon as your done.
Having inherited some classic asp written by a madman this has been invaluable for figuring out where everything is.
Admin
Well this isn't fair. First it's ONLY 280 lines, second, if you ignore the redundant includes, that brings it down to a mere 195!
The original developer should be commended for writing granular modules. If probably gave him a much better defined architecture and far fewer conflicts in revision control
Admin
Admin
Use of ASP, JSP, PHP and all those languages that produces an intermix of HTML, code, JavaScript, CSS and possibly even more obnoxious features should be penalized by required rewrite of everything in assembly using only a book and a hex editor.
It's really not the easiest thing to track such code, even if you wrote it yourself. It also results in non-compliant code, which means that it may behave different in different browsers.
The only remedy is to actually analyze the functionality of the system and then rewrite it without delving too deep into the existing code.
Admin
And for the version 1.0 just add a $ at the end of the url
mypage.asp$
And you dump all the code from any pages. Of course there shouldn't be a lot of server running this version out there :)
Admin
Admin
That's because you used Microsoft ActivePsych. Use OpenPsych and things will go a lot smoother.
Admin
Can I get an apology from the commenter? In this day and time, you don't sit around a message board, where you have diversity, and refer to black f-ing magic.
http://www.youtube.com/watch?v=20a-exAW6qc
Admin
Hmmmm.
I've had to do the same thing many times in my career just to figure out the relationships between programs, include files and whatnot.
The worst was a COBOL based application that had 600+ separate program files averaging about 5,000+ lines each. And all involved in a crazy incestuous relationship where programs would chain to various labels (execution points) in other programs. So a single program could execute and complete an action by itself, chain to another program or be chained to by another program ... or all three in succession and in any order imaginable.
Code reuse is nice but for God's sake! I wanted to strangle the bastard that wrote that.
Admin
Ok.
Red rover, red rover send apac11 over!
Feel better? :)
Admin
Actually trying to use a Find/Grep isn't necessarily going to work. If you're trying to figure out where a particular object is being used or which function is being called it's entirely possible that variations of the same functions and with the same name will be littered throughout the application in multiple source files.
You could be looking for "TrapXYZ()" only to find out that instead of referencing one function definition the silly bugger copy & pasted the same code 500+ times.
There are no shortcuts when trying to unravel a crappy design and implementation. It's when you think you've got a shortcut that you find out later on that you were wrong.
Admin
There is no cake?
Admin
Yes, the Scott that posted this article.
Update: I am fine (after a few months in a mental institution). Actually, about 2 months after working with this code I told the President of the company that it was a steaming pile and that it needed to be re-written. It took all of 6 seconds of him looking at this include tree to give me to go ahead. 6 months later I have 95% of the code re-written in ASP.net, and this time I only used 200 include files. :-)
Oh yeah, and the reason for the display20-1.inc and display22-1.inc... was that each customer that wanted the catalog to look different got their own special include file added to the mix. Thank GOD this company only had 30 or so active clients when I started.
Admin
Wow. I don't know anything about asp but I'm pretty sure that ANY page that even references that many files cannot be a good thing!
Admin
What 2 say?
...
Admin
He could have called grep on that file list and easily found what he was looking for...
But I guess he'll just have to open EACH ONE INDIVIDUALLY and search, because, you know, that's the Microsoft Way(TM).
Admin
Woohoo, closure!
Admin
What makes this even worse (if it was ASP) is that ASP does not support conditional inclusion. ie
all include files (even thouse inside if statments are always included. every time the page is veiwed the server has to parse every single file.
Admin
I don't know, it's pretty nice for including a common side banner on each page. But then that's possibly one of the include directive's intended uses.
Admin
Admin
grep -r
done.
Admin
I'm pretty sure if you look into the files you will find a lot of hardcode in the files
Admin
Or, maybe Z80 (memory is such a limitation).
Or common sense.
I'm going to write a parser for that some day, but nobody seems to agree on the lexical tokens.