Which is more correct: … OR …

Both versions are correct. The biggest difference between them is that in the case of <h1><a>..</a></h1> only the text in the title will be clickable. If you put the <a> around the <h1> and the css display property is block (which it is by default) the entire block (the height of the <h1> and 100% … Read more

boolean in an if statement

First off, the facts: if (booleanValue) Will satisfy the if statement for any truthy value of booleanValue including true, any non-zero number, any non-empty string value, any object or array reference, etc… On the other hand: if (booleanValue === true) This will only satisfy the if condition if booleanValue is exactly equal to true. No … Read more

Java: Not a statement

Java restricts the types of expressions that are allowed in so-called “expression statements”. Only meaningful expressions that have potential side effects are allowed. It disallows semantically meaningless statements like 0; or a + b;. They’re simply excluded from the language grammar. A function call like foo() can, and usually does, have side effects, so it … Read more

Why does R use partial matching?

Partial matching exists to save you typing long argument names. The danger with it is that functions may gain additional arguments later on which conflict with your partial match. This means that it is only suitable for interactive use – if you are writing code that will stick around for a long time (to go … Read more