Archive for August, 2008

What does a MySQL Developer certification mean?

Sunday, August 24th, 2008

A few months back I was laid off from the East Valley Tribune (I should probably write up my thoughts on the print news industry…) with generous terms. I took a week off for vacation, then spent the next two weeks studying for the MySQL 5.0 Certified Developer exams (CMDEV) and then spent the a couple days looking at jobs before accepting a position with ResponsiveData.com . This post is a review of the exams that make up the CMDEV.

The official specs are for the CMDEV are located here. The short and the long of it is that it is made up of two 90 minutes exams with 70 multiple choice questions a piece. To pass a candidate must score ~60% on each exam and I passed both exams on my first attempt with score 77% on the first exam and 81% on the second. My background is 2.5 years of PHP/MySQL development and I have a strong interest in databases. I had purchased the study guide about a year before and it gathered a lot of dust before I was laid off.I studied for the exams by reading the study guide and committing to memory everything that I did not already know.

The first exam was about (IIRC) ~170 pages of material and the second exam was ~150. The example questions in the study guide and on the MySQL web site were significantly easier than those on the actual exam. On the actual exam many questions have multiple correct answers, and my knowledge was strained at times remembering alternative syntax. I thought I knew the answer or at least had a guess for almost all of the questions, though there were a couple questions on each exam that I had no idea of the correct answer. On each exams there was one question that I believed had no correct answer, and there were many questions that had less than elegant wording.
The exam results include a breakdown shown scores on a per section basis with sections being defined as show on the MySQL website. I had passing scores on all sections except ‘Connectors’ (0%) and ‘Importing and Exporting Data’  (50%).

So what do I think of the certification? I think that a person who hold the certification probably has a broad and somewhat deep understanding of MySQL syntax. I think that there are significant deficiencies in the current exam. Normalization should be tested in my opinion because it is such an important concept. I think that the exam should not make significant use the ‘comma join’ syntax. I think that the word of many of the questions made the exam harder than it needed to be.

Do I think that taking the exams was a good use of time? At this point I think it was probalby worthwhile. I am studying for the CMDBA now, and hope to have that certification in the next month or so.

MySQL Certified Developer logo

Why PHP sucks

Sunday, August 17th, 2008

The language itself is fairly sane (imho), however the relatively low barrier to entry allows programmers with relatively little experience or PHP experience to be productive. This productivity does not necessarily generate good code. The other day I ran across a bit of code that looked something like:

$var = $_REQUEST['someTooLongFreakingVariableName']?$_REQUEST['someTooLongFreakingVariableName']:date('Y-m-d', mktime (0,0,0,date('m'),1,date('Y')));

There are a bunch of things that I think are wrong with this line.

I try to keep code less than 80 characters, at times my code goes longer. I have known smart people that write lines of code that go much longer than 80 characters, but most of the space is consumed with whitespace from code that is in my opinion too nested. The line of code I encountered was ~200 characters long, mostly *not* from whitespace.

I like the ternary operator, but  there are some places that it beat the tar out of readability. This is one of those cases. In my opinion nested functions and the ternary should not be used together.  Nested functions just makes too much happening on a single line to understand quickly. Even breaking the code up into multiple lines helps as a start.

if( $_REQUEST['someTooLongFreakingVariableName']){
        $var = $_REQUEST['someTooLongFreakingVariableName'];
}else {
        $var = date('Y-m-d', mktime (0,0,0,date('m'),1,date('Y')));

}

Or better yet:

if( ! $var = $_REQUEST['someTooLongFreakingVariableName'] )
          $var = date('Y-m-d', mktime (0,0,0,date('m'),1,date('Y')));

What really annoyed me about this code was the horrible use of the date and mktime function.  The programmer that wrote this knew how date acted without a second argument because of his use of  code like “date(’m')”. The following bit of code I think is a ton more readable:

if(! $var = $_REQUEST['someTooLongFreakingVariableName'] )
        $var = date('Y-m-01');