compiling problem

I am new to Arduino, and coding. I have some projects I am working on and in the process I have searched the web and found similar projects to see how people go about coding things. I have download many sketches that won't compile, even when the hardware is the same as mine. Projects that I can see a video of it actually working. I get lots of error messages like " 'Serial' was not declared in this scope" or " error: expected `}' at end of input" or " a function-definition is not allowed here before '{' token" . I have also found things that I want to build and had the same problem. If there is a problem with the code, which to me, it looks like there is, how did the OP get his project to work?

Thanks,
Dick

Just a guess, but they're probably not very good at version control. Maybe they save, compile fails or logic not good, make changes, it works, forget to save, they post the details of their success, attaching old (bad) version.

I have download many sketches that won't compile, even when the hardware is the same as mine.

Yeah, I've seen a lot of stuff like that on Instructables too.

A lot of the code and videos that you can find on the net are quite old. They may have compiled without error on Arduino 022, for example, but not with 1.0.5

Pete