understanding code, sketches, etc..

I'm learning about Arduino and writing sketches. My question: Is there a real basic book someone could recommend about understanding code and what the different syntaxes are, why things are written the way they are? For instance, when you define an LED as output, why does the word OUTPUT need to be caps? When you specify, digitalWrite, why does the W of write have to be capitalized? I think if I were to understand why things need to be written a certain way I might grasp the concept of writing code a little better. I've never written code before... seems like learning a new language. Thanks for the help and suggestion for recommending any kind of basic book.

I've never written code before... seems like learning a new language.

It is. And, like any new language, there are rules. If you think that reference should be spelled cat, no one will understand what you are talking about. There are conventions that get explained later in any C book. Things like #define names should be all upper case, to make it obvious that they are going to be substituted by the preprocessor and that camelCase is the preferred method for naming functions (first word is not capitalized but all other words are (as opposed to Pascal case where every word is capitalized)).

Any good C book will explain all of this by the end of the book.

The reference page, Arduino - Home, explains must of the Arduino-specific stuff. The rest is basic C.

I've never written code before... seems like learning a new language

That's because you are.
There are some conventions in all languages, and there are also some local dialects.

The reason OUTPUT has to be written in capitals is because in the Arduino header files, the word "OUTPUT" has been given a specific value.
You can look at this value - it is in a file in your distribution called
"wiring.h".
You'll see that the word OUTPUT has been given the value 1.
Specifically (and a little unnecessarily) it has been given the value 0x1, which means the number one specified in hexadecimal.

thanks for the "arduino home page" reference. Seems helpful. So the conventions of arduino are based on "c".... (which I know nothing about) it probably would be useful to pick up a basic book for that... C programming. Thanks very much for the reply.

I haven't yet come across a good Arduino beginner refererence, but a good book on C is Kelley and Pohl's "A Book on C"