Zend Framework

July 29, 2008 – 1:24 pm

There are numerous web application frameworks written in and for PHP on the market nowadays, most of them free and/or open source, most of them following or supporting the MVC paradigm. This summer, I’m going to go and attempt to make a website using one of the newer frameworks out there: the Zend Framework. Made (or at least started / supported by) the people / company that also does the PHP language itself, it promises a solid framework for web application development, ‘extreme simplicity and productivity’ (from the website), up-to-date with the latest internet technologies, etcetera.

In this post (and following posts), I will dive into Zend Framework, describe its various loosely-coupled components, and make an attempt at judging the framework.

Read the rest of this entry »

Applied design patterns: C4 Engine Messages

July 15, 2008 – 5:00 pm

In my previous article about the C4 engine, I highlighted what was, in my opinion, the biggest downside of the C4 engine: its demo game. Or more precisely, the code and design of the demo game. Because I had to get points for university and didn’t have time to dive into said code and refactor it all, I wrote a refactoring proposal (found here: Office ‘97-’03 / Office ‘07) and put it on the C4 Engine forums. After that, and after the project, I still had to get some points, so I executed some of the refactorings.

So far, most refactorings I’ve done involve moving functionality from one central Game class to different smaller classes - resource and game management so far. One refactoring however is one I’m pretty proud of (in all decency), and is described in the refactoring proposal as the Composite Message System.

In this article, I’ll (attemt to) explain the process of this particular refactoring: explain the old situation, what the problem was with that situation, how it was analyzed and how, eventually (and with the help of my trusty Design Patterns book) I came up with a replacement system of that situation, one that was a lot more flexible and reusable, and one that would accellerate the speed at which programmers could produce results.

For those that are interested, I’ll be discussing the Composite, Visitor, Factory Method and (to a lesser degree) Builder design patterns in this article.

Read the rest of this entry »

The C4 Engine

July 14, 2008 – 10:06 am

During the last 20 weeks (February to June ‘08), I and 7 other people have been working on a game project (both for university points and for this online group of dudes that started the creation of this particular game), 2 of them programmers, 5 of them artsy fags media students (who did models, textures, sketches, sound/music etc).

The game itself is a sci-fi tactical first person shooter (well, it’s supposed to be in a distant future, olz), which was basically in a half-assed concept stage for about a year or two, during which some very nice concept art drawings were made, but nothing concrete was made, such as actual game design (i.e. functional design) or background story.

The project was eventually put forward to our university as a project for the Game Design minor, and since then, we’ve been working on it for the last 20 weeks. In this post, I won’t go into detail about the project itself, but more into the 3D engine that was used: The C4 engine. Read the rest of this entry »

University versus self-taught

June 22, 2008 – 2:15 am

A topic I’ve been thinking about for quite some time now. If I was an employer, looking for an employee, which would I take: The type that basically self-taught himself programming through reading books and/or websites, or the type that spend an X amount of years at university and has a bachelor’s or master’s degree? Let’s assume that, when they apply, they both have roughly the same amount of knowledge and/or skill.

I’ll unveil it right now: I’d totally go for the one that went to university and got a degree. Why? I’ll explain (or, attempt to.) Read the rest of this post for a wider view of my opinion, as well as a massive edit written when this post got a relatively large amount of attention quite suddenly and unsuspectingly.

Read the rest of this entry »

Applied design patterns: Database abstraction (part 2)

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, transformed a concrete set of database interaction classes into an abstract set, to improve flexibility and extensibility. In the second part (i.e. this one), we’ll introduce a design pattern which will help us to manage and maintain the new abstract database classes and their concrete implementations. In this post, we’ll create and implement the design pattern we’ll use to determine which concrete database connection should be used, using an implementation of the Factory Method.

Read the rest of this entry »

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 »

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

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 »

“PHP Database Classes” - Follow-Up

May 24, 2008 – 1:16 pm

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 »

“PHP Database classes” make my eyes bleed.

May 22, 2008 – 11:31 pm

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 »