INCLUDE_DATA


Applied design patterns: Database abstraction (part 1)

June 9, 2008 – 8:21 pm

In some of my previous posts, I’ve pretty much ranted about the poor design qualities of some people that enjoy calling themselves PHP programmers. In these two posts however, I’d like to show you what good and proper design is. The topic is the same as that in my previous posts: databases. Or, to be more precise, database abstraction.

In the first part, we’ll transform a concrete set of database interaction classes into an abstract set, to improve flexibility and extensibility. In the second part, we’ll introduce a design pattern which will help us to manage and maintain the new abstract database classes and their concrete implementations. We’ll do part one in this post.

Read the rest of this entry »

Tags: , ,

Object-oriented programming in ANSI-C

June 1, 2008 – 9:30 pm

This PDF is actually pretty neat. It explains how you can apply a basic sense of object-oriented programming in standard (non-OO) C. I’m no C programmer (I’ve programmed a microprocessor for school a year or so back), but it’s still pretty interesting to see. Check it out at

http://www.planetpdf.com/codecuts/pdfs/ooc.pdf

Found it at PlanetPDF

Apparent user-content filtering in PHP

June 1, 2008 – 9:06 pm

WARNING: This post is an emo rant.

The following fellow is a tard.

http://www.soaptray.com/2008/04/filtering-user-input-in-php/

How I start to loathe StumbleUpon and, worse, the people that promote their own blogpost thinking they’ve actually produced something awesome. I’m not going to go into it anymore, instead I’ll copypasta the comment I posted on there:

I have some critical comments @ your code. First off, why do you write a Filter class that doesn’t have any actual class-level methods? The methods are all plain, static methods, and should either be declared static (so you can do filter::whitespace($string) etc), or be left out of a class declaration altogether (Which is a bit faster than declaring static methods).

Read the rest of this entry »

Tags: , ,

“PHP Database Classes” - Follow-Up

May 24, 2008 – 1:16 pm

WARNING: This post is a follow-up to an emo rant, =D.

In my previous post, I did an epic rant on so-called PHP Database classes. In the follow-up, I’m going to do a Google search for “PHP Database class” and see what comes up. Read on for the full story.

Read the rest of this entry »

Tags: , , ,




“PHP Database classes” make my eyes bleed.

May 22, 2008 – 11:31 pm

WARNING: This post is an emo rant.

Through the maze of duplicate entries I encountered yesterday through StumbleUpon, I came across this page, which reads:

A class for very basic MySQL database connectivity. Written to reduce redundant code in my own projects aswell as aid in debugging and error reporting during the developement phase.

Ok, fair ’nuff, probably nothing but, suspecting atrocity, I downloaded and took a look at the actual code. In this post, I’ll discuss the page in question, as well as rant about so-called PHP database classes in general, which, in general, suck, to put it bluntly.

Read the rest of this entry »

Tags: , , ,