Archive for November, 2009

The Tao of Programming

” When I first began to program I would see before me the whole problem in one mass. After three years I no longer saw this mass. Instead, I used subroutines. But now I see nothing. My whole being exists in a formless void. My senses are idle. My spirit, free to work without plan, follows its own instinct. In short, my program writes itself. True, sometimes there are difficult problems. I see them coming, I slow down, I watch silently. Then I change a single line of code and the difficulties vanish like puffs of idle smoke. I then compile the program. I sit still and let the joy of the work fill my being. I close my eyes for a moment and then log off. “

http://tr.im/taoprog

Framework: The Next Generation

There have been a lot of new PHP frameworks coming into existence. With the release of PHP 5.3, many frameworks are taking the leap with a total do-over of their codebase to take advantage of 5.3’s namespacing and other advancements. But most seem to be missing the mark.

PHP 5.3-specific frameworks :

  • Recess has a 5.3 branch in development
  • Sensio is working toward Symphony 2.0 (in dev)
  • Some CakePHP core devs have gone AWOL to start Lithium (0.2 released yesterday)

These last two are both total do-overs. Lithium seems very promising. It comes with very good support for schemaless key-value stores like MongoDB which to me is a huge win. Also they use the same view template extension convention as Recess (index.html.php) which is nice. But still I can’t tell you what a pain in the ass it is to open a layout and find code like this :

<html>
<head>
	<title><?=$title; ?></title>
	<?php echo $this->html->charset(); ?>
	<?php echo $this->html->style('base'); ?>
	<?php echo $this->scripts(); ?>
	<?php echo $this->html->link('Icon', null, array('type' => 'icon')); ?>
</head>
// ...

Do you really need to abstract away the stylesheet tags?
Is it that hard to type in a meta tag for the charset?
Why make me hunt through the code to find this stuff?

I think there’s a problem with the way people are writing frameworks these days.
I think people are afraid of HTML.

And it’s sad.
Because that’s what websites are.

We should be embracing our HTML, not hiding it.
We may like to think that we’re Ajaxy, but the goal of development should not be to write less HTML.
The goal of development should be to quickly produce code that works well and is easy to understand and maintain.

Fancy framework shenanigans be damned.

Cookie Monstar!

Thanks Google, you just made my day.

Hidden Data

KevBurnsJr

This bug is inconceivable and infuriating.
28 minutes ago from web

Why won’t you recognize my schema changes?! It’s like you’re ignoring the entire file!
22 minutes ago from web

This bug is unreal. I must be trapped in some sort of parallel universe.
21 minutes ago from web

Oh fudge. Guess I shouldn’t be storing serialized PHP objects in the $_SESSION. Schema changes cannot affect that which is stored on disk.
11 minutes ago from web

$_SESSION was 3.8 kilobytes, now is 24 bytes.
5 minutes ago from web

Hidden static data. Probably a good thing to avoid in principle from now on.
2 minutes ago from web