[ Content | View menu ]

Archive for 'Languages'

PHP Insanity X

Mark May 16, 2008

I’ll keep this insanity short and sweet.
In PHP, if you have a define that you forget to actually define, it will default to true, not false.
Why is this?  Because in evaluating the define, if PHP cannot find anything else to evaluate it to, it will evaluate it to a string literal, which always evaluates to [...]

Languages - 0 Comments


PHP Insanity IX

Mark May 8, 2008

Recently, on Hacker News, this question was asked:
What do hackers think of PHP?
If you’re thinking about PHP, I suggest you read the comments.  You’ll notice there is a constant refrain:
You can use PHP, but you had better have discipline.
Sure, you can use PHP or any language, but of course you need discipline.  That isn’t unique [...]

Languages - 0 Comments


PHP Insanity VIII

Mark May 1, 2008

If you’d rather not read what I have to say about today’s PHP Insanity, you can attempt to find it for yourself on the php.net error_log man page.
In my daily work, I use the error_log function often.  It was shown to me by a coworker and I’ve found it handy ever since.  However, my coworker, [...]

Languages - 0 Comments


PHP Insanity VII

Mark April 14, 2008

I discovered an interesting bit of insanity in PHP while at work the other day.
Define a function in PHP and make sure it has at least one argument, but that argument should not have a default.
So the function should be something like:
public function foo( $bar )
Not:
public function foo( $bar=fubar )
Now call your function, but leave [...]

Languages - 0 Comments


Erlang Garbage Collection

Mark March 30, 2008

When I asked the question about how Erlang Garbage Collection works, I expected that because of Erlang’s focus on concurrency its garbage collection algorithm would be incredibly complicated.
I was wrong.  Turns out, it’s rather simple as far as garbage collection algorithms go, thanks in large part to how Erlang uses processes.

Languages - 1 Comments