Sunday, December 9, 2012

How to Approach AP Computer Science

How to Approach AP Computer Science

How to Approach AP Computer Science

How to Approach AP Computer Science

After seeing the mess of papers my son considers organization and listening to the excuses as to why this course is so difficult. I thought I would provide a little guide on how to get on top of this course. It's not really a difficult course. But it requires that you don't sit on your hands and hope everything becomes clear just by staring at it. This is like my obsessive compulsive behavior of constantly opening the refrigerator door in the hopes that food will somehow magically appear (even though I'm home alone and no one has gone to the store). Now I realize that an AP Computer Science Student is young. They have been raised like veals by their parents and now they must come to grips with actually creating something instead of just using something. So first and foremost you must embrace the challenge and rise to the occasion. If you put a little effort up front it will make this course easy for you.

Start your assignment as early as possible

I know this may come as a surprise but your teacher actually sleeps. They are not creatures of the night looking for their next blood meal. So by starting your assigned project early you have a chance to email them with any questions that may come up as you try to do your project like:

Is it really due tomorrow? It seems awfully long!

The smart student who sent the email at 8pm found out at 9pm it's due 2 days from now. The dumb student who waited until 10pm and then stayed up until 3am trying to finish, then finds out (next day at school) as they go to hand in the project that it's actually due in 2 days.

Remember you are young. Your attention span is probably a minute longer than a 10 year old (sorry but that's probably what it is). You are probably a little arrogant so you are completely poo-pooing the previous sentence, and are convinced you don't miss a thing the teacher says. To you I have some advice:

  1. Make sure you have your teacher's email. Make sure you use it if you have any questions or complaints
  2. Make sure you have the email, home phone, and cell phone of at least 2 people taking the class (because maybe your teacher actually has a life and is unavailable when you need him or her most)
  3. If you have a class where you have no idea what the teacher is talking about make sure you talk to the teacher after class (or after school), Take notes and write down key words you don't understand so you can look them up at home. After you find or get an explanation call a friend in the class and see if that is their understanding as well
  4. If you are doing a project and it seems too complex for the amount of time alotted contact the teacher and a friend and see if you are mistaken about the deadline or misguided about how to approach it.
  5. Take notes in class they just have to be a quick outline of what was discussed so you can review
  6. Make sure you know where the teacher's web site is located. It's a computer course they probably have all the handouts online.
  7. I can't stress 1 and 2 enough so go look at them again.

Print Stuff Out

I know we are supposed to save trees but do yourself a favor and kill a few (if you have big a problem with that find recycled computer paper). Print out your assignments. Write on them, model the code on them. When you have completed the project make a printout of your code and keep it with the problem statement for you to review. The projects are set up to teach you different aspects of Computer Science they become their own review sheet.

Keep a course 3 ring binder (loose leaf notebook in my day)

Dr. Frederick Brooke in his classic work on Software Engineering talks about a large programming project at IBM back in the 1960s. Now this project hired the best of the best from within IBM and the project did one thing that kept every one on the project synchronized. They kept a set of project notebooks and in it went all the design docuemts and all the user documentation, everything.

So if it's good enough for the top people at IBM I think you should be doing it to. Keep a notebook. At a minimum: a hard copy of all your programming assignments should be in there, any notes you may have taken, and any handouts that the teacher has given you. Even though much of this is available electronically keep a hard copy around. Trust me the very fact you keep and update the notebook will mean you absorb more knowledge about the subject.

Know the language syntax

In AP Comp Sci that means: know the full Java syntax for anything you may choose to do in Java. The wikipedia website's page on Java syntax is as good as any. You should take a weekend and make sure you know how and why you use each feature of the syntax. If there is time you should get a small piece of code working showing the major control statements available in Java (if, for ,while, switch). Do not wait for the teacher to introduce this stuff to you. Do it on your own and be ready with questions when you do go over it in class.

Get the Java Library Source code

The Java development environment,known as the JDK (not JRE), on your computer usually comes with a .zip file of all the source code that implements the standard library. Be sure to unzip it and look at the various implementations for Strings, Lists, etc. It will only help you to see a good example. There is a browsable version available at http://grepcode.com/snapshot/repository.grepcode.com/java/root/jdk/openjdk/7-b147/

Get a hard copy of the textbook

I haven't found a good Java Book for a beginner. I have a number of books that I've collected over the years most are excellent references but none of them provide a decent tutorial you would want for an introductory course. My son's course uses a free online book which is available from the book's website and from Amazon as a hard cover book. I bought that. I would recommend that you get a hardcopy version of your courses text.

The hard cover book is like having a second computer dedicated to the text. Go over the teacher's reading assignments in the book don't assume you will pick it up by doing the project. Use an online version just for searching.

Get a couple of AP Comp Sci review books

These will help condense the course down and give you some more insight as to what you should be focusing on. Each book may organize the course a little differently and you may understand one better than the other. I can't really recommend one over another, but I easily found 2 review books for AP Comp Sci on Amazon.

Learn to use the cut and paste on your IDE

Programming is a repetitive process the sooner you learn to cut and paste from previous projects and similar classes the faster a programmer you will become. If you are typing everything from scratch for every project, you are wasting time. This course should get easier as you go along. Not more time consuming and difficult

Don't freak out about recursion

Just as you call methods inside other methods there is no reason a method can't call itself. It's called recursion. It exists in mathematics and it exists in programming. The trick to recursion is you must have a test built into method code that indicates when you are going to stop the recursive calls. This is just a warning of things yet to come. In the end it's not much different than a for loop. You keep looping until a test condition is reached. In recursion you keep calling yourself until a test condition is met. The Java language is set up to make this all happen. Many computer science papers exist for how to make it more efficient and less memory intensive, so it's an important topic to come to grips with.

Ok, you're freaking out anyway, I will address recursion as a topic in the future.

Finally

If you find yourself getting dinged on syntax errors on your tests, you may be better off not seeing where the errors are immediately. The IDEs (like Eclipse or Netbeans) have instant syntax checking. When you are an experienced developer this can be a time saving device. But as a new student this may be doing to much of the work for you. You aren't getting the opportunity to proofread your program before you have the computer check it. It would be nice if you could turn off the instant syntax checking. But I haven't been able to find a way to turn it off.

One way to handle would be to write your program by hand on paper first. Then type it in after you have gone over it once for syntax errors. Then as mistakes come up in the IDE you can place the corrections on your hand written program. This will give you direct feedback on where you are weak on syntax knowledge.

The other way is to drop the IDE altogether and just use an editor and then compile the program in a command line window. If you know how to do this on your computer it's a nice option that keeps you on the computer typing but forces you into proof reading your code and fixing it before you have the computer double check it. If you don't know how to do this I have it on my list of topics to address in a future blog, so more on this later.

References

Brooks, Frederick P. "The Mythical Man-month: Essays on Software Engineering." Reading, MA: Addison-Wesley Pub., 1995. Print.

Author: Nasty Old Dog