Last week I wrote a post about a PHP parser / evaluator I wrote in Haskell. I explained some of the parts on how the parser itself was designed to process PHP code into an abstract syntax tree. Continuing from where we left off in the previous part, in this post I’ll discuss the actual evaluation part.
Parsing and evaluating PHP in Haskell: Part 1
The other day I uploaded a new experimental project on GitHub – A Haskell PHP parser / evaluator. It doesn’t understand 100% of all PHP syntax, but it was an interesting experiment nevertheless. Here’s some insights and other thoughts from working on the code.
5 ways how PHP is better than Node.js
All hail Node.js! Boo PHP! Except there are various things where PHP is better than Node…
PHP typehinting gotcha in exceptions/methods
A small gotcha I recently ran into: If you use typehinting, PHP never checks that the class your typehint specifies actually exists! Read more for some examples
How to use built-in SPL exception classes for better error handling
Since PHP 5, there has been a bundle of built-in exceptions – the “SPL exceptions” – in PHP. However, the documentation for these classes is quite lacking in examples, and it can be difficult to understand when you should be using them. The short answer is always. You’ll find a longer answer if you continue reading :) There is also …
Now you can write PHP code… without writing any code
Yes, you heard that right! You can now code in PHP without having to write a single line of code – amazing, right? The application that makes this possible is called Lemon ADE, and it runs on the iPad. In this post I’ll go over how Lemon ADE works, and I have also recorded a short video demonstrating coding with …
The “do X or die()” pattern must die
What’s the most common pattern for error handling you see in beginner’s PHP code? – That’s right, do_X() or die(‘do_X failed);. That’s nice and all, as at least you have some sort of error handling, but I think this way of handling errors must go. There is no place for it in modern PHP code – it’s the worst way …
Wicket from the point of view of a PHP developer
Not long ago, I had to learn some Wicket. What is that? In this case it has nothing to do with cricket – The Wicket I’m talking about is a Java web application framework. I’ve mostly used PHP and Python to do server-side web application sort of programming. Compared to what I’m used to, Wicket is way different. Read on …
Refactoring explained to an absolute beginner
Recently while on a drive with a non-programmer friend, I talked with him about code complexity and manageability, how very complicated code is detrimental to productivity and stuff like that. Later on, I decided to explain it to him with actual code examples, although the most he has ever done was some HTML back in elementary school. Here’s what I …
Benefits of Developing With Microsoft AND Open Source
The Internet seems to be the latest battleground for the computer age-old struggle between Microsoft and open source solutions. For some reason, many web developers like to engage in holy wars over various web site hosting solutions and development platforms, fiercely defending their beloved vendor’s suite of products. They battle over their particular setup so much they block out any …