Transitioning from AP CSP to AP CSA
====================================

If you have taken the AP CSP (Computer Science Principles) course and exam you
should be well prepared for AP CSA. However, there are likely to be a few new
things to get used to. If your CSP class used a block coding language like App
Inventor, Scratch, Snap!, or App Lab, you learned to create program structures
by plugging together blocks. In Java you'll find the structures are similar but
you'll have to get used to expressing them in text.

On the other hand, if you’ve previously used a different text-based language,
such as Python or Javascript, while you will be used to the idea of writing
programs in text you'll have to get used to some specific details of Java's
syntax.

Here are some tips to keep in mind when you are writing Java code, especially if
your prior programming experience was with a block language:

- You must spell things correctly, or at least consistently. Unlike in a block
  programming language where you know you are using the right block because you
  dragged it from a palette, in Java names are what connect different parts of
  your program and they need to be spelled consistently.

- You must pay attention to case: names that differ only in case—one starting
  with a lower-case letter and the other with an upper-case letter, for
  instance—are still different.

- Punctuation is important. In particular, most statements in Java need to end
  with a semicolon (``;``). Leave a required semicolon out and your program
  won't run. That’s different than this paragraph which you can still read even
  though we forgot the period at the end of this sentence

- Java is in the family of programming languages that use curly braces (``{}``)
  to group together statements. The curly brace notation may be familiar to you
  from the AP CSP pseudocode which uses them in a similar way.

- You should match the indentation of your code to the structure created by your
  curly braces.

.. 
  [Uncomment this and add it to the last bullet point once the Reformat button ships.]
  In this book you can use the "Reformat" button on coding
  activities to make sure they match. Get in the habit of clicking it frequently
  to keep your code tidy.

.. |open in Google Docs| raw:: html

   <a href="https://docs.google.com/document/d/1xhSAfzF1pH0nlUL94lmpdvd8fO4sa38cOuunXnJU4Bs/view" target="_blank">open in Google Docs</a>

.. |code.org App Lab code to Java| raw:: html

   <a href="https://docs.google.com/document/d/1LB6a36tRKGgTGJUcpT_3TspXFqn5luu1YU8YmYt1CQs/edit?usp=sharing" target="_blank">code.org App Lab code to Java</a>

Here is a comparison of some App Inventor blocks compared to AP CSP pseudocode and Java code used in AP CSA (|open in Google Docs|).

.. raw:: html

    <iframe src="https://docs.google.com/document/d/1xhSAfzF1pH0nlUL94lmpdvd8fO4sa38cOuunXnJU4Bs/view" style="max-width:100%; margin-left:5%; width:90%;"  height="600px"></iframe>

And here is a a comparison of |code.org App Lab code to Java|:

.. raw:: html

    <iframe src="https://docs.google.com/document/d/1LB6a36tRKGgTGJUcpT_3TspXFqn5luu1YU8YmYt1CQs/edit?usp=sharing" style="max-width:100%; margin-left:5%; width:90%;"  height="600px"></iframe>
