26 Dec 2002 davidu   » (Journeyer)

Coding questions:

Which is preferred?

(($c == 'a') ? $c = 'b' : $c = 'a');
if ($c == 'a') {
    $c = 'b';
} else {
    $c = 'a';
I'll admit, I prefer the first example as it's more concise and I understand it right away.

Also, sometimes people write ('a' == $c) instead of the "common" ($c == 'a') in various control statements to avoid accidental (pointless) assignments which would always eval to true. Is this a common practice and is it worth me modifying my coding practices or is this just more of nuance some people have with their code?

Progress on Everybox.com:

Coding has picked up quite a bit of the new version of my code. Much to my own surprise I've stopped using DJB's tinydns software and have switched to Bert Hubert's recently opened PowerDNS. The postgresql backend has proven quite nice and stable so far.

Now all I need to do is figure out an easy/nice/stable way to replicate PostgreSQL. (any ideas?)


I finished the semester off exceedingly well. I recieved one surprising grade which I hope to have corrected (I seriously hope it was a mistake!). It's always nice to have a good idea of grades when done with a class so that when it comes time to check grades online there are no surprises. It's the worst feeling to think you did well in a class and to find out you didn't. It seems like the higher level my classes get, the more secure I am in my grades and the less I worry about (or even have) final exams.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!