I was looking to add a couple of features to the blog software just now. A page to display the most recent comments and something to keep track of when visitors last came to the site so they could see if there were any new comments/blogs.
Unfortunately I decided that I couldn't add these features for three reasons:
1) To create the recent comments page I intended to modify the subroutine that writes the comments on the blog pages. However, that subroutine has become so complicated with the stuff I've added to it already that it's practically impossible.
This subroutine needs to be re-written and simplified and I have plans already drawn up in my head for that.
2) The cookie thing to keep track of when visitors were last here would need to be tied into the subroutine that writes the blogs. Unfortunately that subroutine is in a somewhat similar state to the comment subroutine. That subroutine does a great many different things (some of which I can't even remember) and meddling now would cause severe breakage.
3) I need my own PC to code, it's a fact. I simply cannot work on these Uni PC's, I cannot code on someone else's computer either (no matter if it's a good one or not). It HAS to be my machine. Therefore I have to wait for my new motherboard to arrive (which should be soon ).
Just so you can see how bad these two subroutines have become I have uploaded the ASP file that they are both in.
This is the whole file without any modifications made to it, they are the only two subroutines in it because they are soooo bad. Believe me, they started off nice and simple, but now they are ... not.
Edit: Oh yeah, you can use the code but not sell it, creative commons license etc. etc.
39611 lockers tragically abused every year.
See, this is why ASP smells. You have a database and you're having trouble. I could make these functions work quite easily on my PHP flatfile blog.
Er... it's got nothing to do with the database. The database functions are all elsewhere.
I know. I'm saying you're having trouble doing these things, and you have the comfort of a database, which I've heard is more flexible than flatfile. I'm just mocking you, don't mind me.
Oh I see now, you meant to say this:
Hahaha you have a problem that isn't even vaguely related to a database and you cannot solve it without a re-write!!! I am much better than you for not having a database.
Is that what you were trying to say? Because that's just dumb.
See, this is how it is:
Database == easier
Flatfile == harder
Ben is laughing because you're using a database (easy) and still having troubles, whereas he could make it work quite easily with his flatfile (hard) system. See? He is, in fact, mocking your ASP-coding ass!!!
Eek, I had a similar issue. I had gone the IE-style programming method of slapping more and more things on top of the code. Which resulted in a too-large and and confusing source. So I took the netscape route and rewrote it, this time incorporating all of my current features and plans into it. It's inevitable. If one plans to keep improving software, you've got to be prepared to rewrite. Now get off your lazy bum and code!
See? Paul understands. It's 'cuz he's not British. Kidding, kidding. It's just that you'd think with all the information accessible with a string (rather than having to be parsed out each time) it'd be quite simple to manipulate it, and gain information from it, whereas with flatfile you have to be somewhat hackish, using file_get_contents(), unlink(), rename() and the such up the ying-yang.
I'm considering doing some revisions to my blogware as well, but then I thought: What would I actually change? I'm considering doing as Bob suggested and converting to XML with a view.php file to get the file, and show it the right way, but I also like my PHP file for the entry, with headers, footers, and comments include()d, and my XML file for the comments, and I'm also thinking it won't be any better.
Anyways, you really should plan everything out before the redo, don't rush into it. I can also say from experience that you shouldn't try to re-use code during a rewrite. Get a peice of paper jot down each and every function you want your script to be able to perform, type it into a document (I use notepad for this), then under each item do indented notes on it. Now, review it, get the idea of the system, try to find any flaws in it. Finally, split the functions up into pages, and then just write it out, as at this time you'll already know exactly what to do.
Just some rambling ideas, that you probably know. It just seems you rushed through this version, so I'm trying to give you some ideas as to have the next version be better.
It isn't that he rushed into it, Ben, it's that he's coding ASP. Everyone knows that you can't code shit with ASP.
Now if he had gone with PHP, then he wouldn't even have this problem.
See?
My opinion of you is dropping Paul. Observe it dropping:
if paul_jr="gay" then
response.write "Well of course!"
else
paul_jr="gay"
response.write "Hehehe."
end if
just use C++ for everything. Watch and observe my cunning use of code:-
#include <shitoff.h>
void main(void)
{
char gay;
cout << "Is david gay?? ";
cin >> gay;
if(gay == "y")
{
cout << "Well we knew that. Schmember. ";
}
else
{
gay = "y";
cout << "You really are. You should have done PHP, idiot. Spchlack!!! ";
}
}
Get the picture yet?
Uh huh...
Stop pretending you know C Adam.
Funny though, I'll give it a schplack out of 10.
Or, in PHP... <?php $paul = "ambiguous"; print ($paul=="gay")?"Paul is definetely gay.":"We aren't sure if Paul is gay.";?>
Or as I would do it in ASP:
response.write iif(paul_jr="gay", "Well of course!", "Hehehe.")
My entry in Matlab:
if strcmp(paul_jr,'camp as elton john') then
fprintf('Rocket man!!!');
else
paul_jr='camp as elton john';
fprintf('Goodbye yellow brick road.');
end
Or, in English:
Paul is not gay.
How's that? *Insert eye rolling smiley that doesn't actually exist because DAVE hasn't made one*
Smilies fall under Phil's jurisdiction, complain to him.
Also, that script is flawed.
All right, I'll complain to Phil (*Snicker*) next time.
No, my script is not flawed. Here:
if script is not flawed
yell script is not flawed you doodiehead
or if script is flawed
yell no it isn't you doodiehead
if none of those then
yell I'm confused
See? :-D
WOW! That's AWESOME! I GOTTA GET ME ONE OF THEM BOOTS!
Just thought I'd share.
Oh, yeah, hey, Phil. You SMELL, man. Take a shower. Then make a rolling eyes smiley, mmkay?
Ben, have you injected yourself with crazy juice again?
"Crazy juice"? ... now, now, none of that talk around the children, Dave. You keep you and your crazy juice to yourself; no one wants to know.
PMSL. No, I have not done any of dem der boots... I mean, ah, crazy-juice injections. I haven't done any boots either, though... I don't think that's possible.
...
HOO-HA!
Hmm, what the crap?
Ah, don't mind me. I was sugar high at the time, so, y'no, totally random reponse.
*Resists urge to type "HOO-HA!" once again, fails.*