Changes between Version 1 and Version 2 of ControlSystems/SoftwareTeam/IntroToPython


Ignore:
Timestamp:
Sep 2, 2017, 2:14:16 PM (8 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/IntroToPython

    v1 v2  
    55FRC supports many different programming languages, but Team 2537 uses [https://en.wikipedia.org/wiki/Java_(programming_language) Java].  Java is the primary language taught by most high schools and colleges because the [http://media.collegeboard.com/digitalServices/pdf/ap/ap-course-overviews/ap-computer-science-a-course-overview.pdf AP Computer Science exam] requires Java.  Although it is not an ideal language for robotics, using Java allows participation in robotics to help reinforce material learned through the school curriculum.  Java is also among the [https://spectrum.ieee.org/computing/software/the-2017-top-programming-languages most popular programming languages] so it is well worth learning.  Java is part of the family of programming languages that includes C, C++, and C# which collectively have dominated computer programming for the last several decades.
    66
    7 The small set of Java words includes verbs (words that invoke an action like '[https://www.tutorialspoint.com/java/java_do_while_loop.htm do]'), conditionals like '[https://www.javatpoint.com/java-if-else if]', and you can introduce nouns that are the subjects or objects that other words can act on.  Like all languages, Java has specific rules of syntax (grammar, spelling, etc.) that dictate how the language is used.  Learning the key words and syntax are the first challenges when learning Java.  Let's examine the simple turtle-graphics exercise and see how it might look in Java:
     7The small set of Java words includes verbs (words that invoke an action like '[https://www.tutorialspoint.com/java/java_do_while_loop.htm do]'), conditionals like '[https://www.javatpoint.com/java-if-else if]', and you can introduce nouns that are the subjects or objects that other words can act on.  Let's examine the simple turtle-graphics exercise of drawing a square and see how it might look written in Java:
    88
    99{{{#!th rowspan=3 align=justify
     
    3333}}}
    3434
    35 Notice that each Java command ends with a semi-colon and that groups of commands are enclosed in curly-braces.  These are examples of Java syntax.
     35Like all languages, Java has specific rules of syntax (grammar, spelling, etc.) that dictate how the language is used.  Learning the key words and syntax are the first challenges when learning Java.  Notice that:
     36* Each Java command ends with a semi-colon
     37* Groups (''blocks'') of commands are enclosed in curly-braces.
     38* Details provided to a command (''parameters'') such as the color to set are placed in parentheses
     39These are all examples of Java syntax.
    3640
    3741Like all programming languages, Java allows you to combine groups of commands into a single unit that forms an abstraction.  For example, the words shown above that draw a square could be combined into a single new word that can be used to replace the individual words.  This allows programs to be built with increasing abstraction so high level concepts such as 'put the ring on the peg' can be expressed clearly and concisely.