Sam1980:
Hello I am new to Arduino and getting to learn new things from it I have not done a lot of programing and was wondering what is the best way to memorize and write code so that when I am done with the book I don't always have to refer to it whenever I need somthing?
Welcome to the Arduino forum and you have a very good question.
Others will have different answers, but memorization doesn't work for me. There are just too many variables.
I always use another program or other programs for reference. You have all the examples of programs in the Arduino IDE. You also have examples of Arduino C++ coding with all the various sensors, controllers and breakout boards. Use them for reference.
Your job is to understand the logic of what you are looking at and how to apply it to your current question. Every program can be written a different way and still accomplish the goal.
Paul