Add a CSS basing on the author of the comment This node has a comment by the user #1, who is the node author, and a comment by an anonymous user. I want to add an extra CSS class to comments by the node author. 

The variables in Bartik's comment.tpl.php include $author and $comment-by-node-author.

What is the correct syntax for an if statement saying if this comment is by the node author (or by user #1) apply the class example and just print the comment as usual when the author is somebody else?
If (what I'm not sure) understand your question correctly, you want to add an extra class if the comment was posted by the node author.

As explained in Bartik documentation:


 /*   - $classes: String of classes that can be used to style contextually through
  *   CSS. It can be manipulated through the variable $classes_array from
  *   preprocess functions. The default values can be one or more of the following:
  *   - comment: The current template type, i.e., "theming hook".
  *   - comment-by-anonymous: Comment by an unregistered user.
  *   - comment-by-node-author: Comment by the author of the parent node.
  */



There are already specific classes for comments posted :


by node author : .comment-by-node-author
by anonymous : .comment-by-anonymous


And you can see that in your node markup :

&lt;div class="comment comment-by-node-author clearfix" about="/comment/2#comment-2" typeof="sioc:Post sioct:Comment"&gt;

/* ... */

&lt;div class="comment comment-by-anonymous clearfix" about="/comment/3#comment-3" typeof="sioc:Post sioct:Comment"&gt;