My website sucks.
I wrote it.
That pretty much explains everything.
I have a really nasty habit of writing silly software. Really silly.
I am not really sure of the cause of the slowdown to my website in the past few days, I have heard rumors that my site IP address is changing, you should not notice a difference, but this means there will be a transitional period in which the old address and the new address both will work. Honestly? I don’t think that really works that well. I am not sure if that is what is going on.I have experience other slowdowns on my website before but am unsure of the cause. Traffic? doubt that . What I find funny is sometimes I get and infernal service error, and sometimes I get permission denied, and other times I get could not find file required on page so and so.
But. as most things usually are at the end of the day, I am going to assume it is my fault.
And So, I am going to tell you why my website sucks.
Why My Website Sucks
It started way back in the day when I was looking into not having to maintain my website. I hate maintaining websites. I mean ig. very boring to modify and upload 5 billion pages so they all work and function the same. I then found Perl. perl was cool, well I loved perl (don’t use it much anymore
). But with perl I found I could create dynamic web pages, pages that you could just create "templates" or something similar and dump the content into the middle, meaning all you would ever have to do is update the content. YAY for me.
That was all fine and dandy.
But that was way too much work. why would I ever update my content?
And with perl, the "quirks" in the language pretty much had me wishing there was a better way. Don’t get me wrong perl will do lots and everything you ever need, but for webpages, I would prefer something designed for the web. And All I ever designed using perl was a fairly ugly website that does not exist anymore, a search engine (that was cool) and a webmail client that did not always work.
Enter PHP.
php
PHP has classes, polymorphism, encapsulation, and was designed for webpages.
I have mentioned before, I like over complicating my work. Really over complicating.
PHP Website version 1.
I don’t really know if this was my first php website. The first I can remember. It had an odd design.
Drawing it out would be rather difficult here, but I will try to explain.
The concept was really rather simple. create a class the defines the template (however that happens) and each page on the site would then define its own class that extended this template class thus allowing the page to merely concentrate on the content.
now, how this happened was rather convoluted and strange. and at this point looking at what I have written, I wonder why I scrapped that idea. seems rather cool to me. much better then my current design.
Anyways. as I was saying convoluted and strange.
Here is a basic rundown of what was happening.
Any page on the server would first include the "configuration" file located on the document root of the webserver, this file would define things such as global parameters as well reading site cookies, determining what template was to be used, and loading additional scripts that are required. One of these scripts would be the "template" script which defined a basic class or interface in which all template classes extended. The template was then also loaded and finally control returned back to the requested page which then extended the template class and finally outputted a page.
Now that I think about it, I think there were two reasons why I got rid of this design, First I don’t like how many times the classes were being extended, and secondly the requested page required the page content to be inside a function and finally written with a $myPage->dump().
Scripting languages. if it was compiled, maybe would not have cared as much. possibly. Zend anyone?
I figured that was really inefficient. lol. Compared to what I have now that was nice. and I was not even using a database at that time.
PHP Website version 2.
The second and current design went away (mostly) with the class approach to templating.
Now it is even stranger.
I figured I wanted simply a call at the top of the page to dump the template start, and a call at the end to dump the template end. This idea seemed all fine and dandy until I felt I needed to add more complicated templating such as blogs, menus and logos.
So, i do a lot of function_exists to see if I can call something page related, site related or template related. sigh, this is where the classes were nicer.
This however did allow me to make pages entirely in html if I so desired with a simple call at the top and at the bottom.
Other then that the design of the site was pretty much the same.
But I needed a database.
Silly me
I used a class design, and finally settled on a naming convention that only includes a couple of "databases".
I really should not be allowed to do this.
I wrote classes to encapsulate the creation and modification of tables, and data access. It automatically updates tables (with no loss of data) with new version of class, and basically provides common insert, update, remove and select routines.
The class would contain all the tables for a specific application, for example, there is a "blog" class which contains a post table, comment table, category table and links between them. I have forum, search, permissions, and user/group classes as well.
I recently noticed that to simply load one page, with no dynamic content calling only the authentication (is logged in) methods, I was doing 12 database queries.
huh? 12?
If I decided to view the blog page there was 38. a search did 17.
Something needs to be changed.
Some of this problem is redundant database queries, caching will fix that. Some of this can also be fixed by grouping select queries into one query.
CSS
I hate css, I really do, I hate javascript, I really do. But nowadays that is pretty much what everyone is using.
This is my first website designed with CSS, not totally, but the template was done with css.
I have noticed that tables tend to mess up this css, plus not all browsers handle css the same. This website has a number of graphical quirks that appear once in a while.
FCKEditor
Back in the day I could write applications in javascript, I wrote a database query manager similar to that found in access for a mysql database entirely in php and javascript. was fun. but I decided that I would not try to write a word processor. I could not with a real language (and I tried) so with a scripting language such as javascript I decided not to. so I got FCKEditor http://www.fckeditor.net/ which was apparently first designed by "Frederico Caldeira Knabben" hence the name.
I don’t really like it. it seems to me to be a bit buggy sometimes. plus does doublespacing or limits my formating depending on how I configure it. also its depository of images is in a location I do not like. will have to do some fixing I guess.
Conclusion
My website sucks. it is inefficient, poorly designed and causes me headaches.
Wait for version 3 it will be better, although I do like how I formatted version 2’s template. yay
um. will there be a version 3?