Browse Source

Updated 3.1 - added declaration subsection. Added subsections to 3.2 and 3.3. Added sections to chapter 4

pull/1/head
Brett Langdon 14 years ago
parent
commit
0f797380a5
12 changed files with 116 additions and 23 deletions
  1. +20
    -2
      2 - Getting Started/1.2 - How To Read This Resource.tex
  2. +28
    -8
      3 - Functional Programming/1.1 - Variables.tex
  3. +19
    -0
      3 - Functional Programming/1.2 - Control Statements.tex
  4. +8
    -0
      3 - Functional Programming/1.3 - Functions.tex
  5. +0
    -0
      4 - Object Oriented Programming/1.1 - Classes and Objects.tex
  6. +0
    -0
      4 - Object Oriented Programming/1.2 - Inheritence.tex
  7. +0
    -0
      4 - Object Oriented Programming/1.3 - Polymorphism.tex
  8. +0
    -0
      4 - Object Oriented Programming/1.4 - Design Patterns.tex
  9. BIN
      Programming In General.pdf
  10. +37
    -13
      Programming In General.tex
  11. +1
    -0
      build
  12. +3
    -0
      header.tex

+ 20
- 2
2 - Getting Started/1.2 - How To Read This Resource.tex View File

@ -11,5 +11,23 @@ some data structures or algorithms might interest you more than others.
\subsection{Keywords}
Throughout this resource some words will be highlighted, colored differently or emphasized in order to stand out.
These words will generally be referring to code examples presented in the chapters, for example:
\pigVar{variables, functions, properties}, \pigVal{values} and \pigOut{output}.
These words will generally be referring to code examples presented in the chapters:
\\
\begin{tabular}{|l | c | r|}
\hline
Type & Example \\ \hline
Variable & \pigVar{variableName} \\
Functions & \pigVar{functionName} \\
Class Properties & \pigVar{propertyName} \\
Values & \pigVal{"Sample String Value"} \\
Program Output & \pigOut{Console String Output} \\ \hline
\end{tabular}
\\
\par
\emph{Example:}
\\
We assign the value of \pigVal{"Sample String"} to the variable \pigVar{sample} then pass in \pigVar{sample} as a parameter to
the function \pigVar{printValue} which will print: \pigOut{The String Is: Sample String}.

+ 28
- 8
3 - Functional Programming/1.1 - Variables.tex View File

@ -1,22 +1,38 @@
Variables are used to represent values by name and allow you to access the original value or manipulate the original value.
For example we would store the integer value 10 into a variable named "a" which would then allow us to refer to "10" by
using the name "a".
Variables act as aliases to the values that we want them to represent and they allow us to access and manipulate the
values that we assign to them.
For example we could use the variable \pigVar{name} to represent the value \pigVal{"Brett Langdon"}.
We do this with programming so that we can then access the value \pigVal{"Brett Langdon"} with a shorter representation, \pigVar{name}.
\begin{lstlisting}
\subsection{Declaration}
To start with variables we need to declare their existence.
By declaring a variable we are saying to the program, here is our alias and here is the value that we want it to represent.
\begin{lstlisting}[caption={Variable Declaration}]
a = 10
print a
\end{lstlisting}
In the above example the output would be "10" because the value 10 is stored in the variable "a" and then we access the original value
10 when we print a.
In the above example we are saying that we want to store the integer value \pigVal{10} into the variable \pigVar{a}.
We can then use the variable \pigVar{a} to access the value \pigVal{10}.
This program will output \pigOut{10} rather than \pigOut{a}.
\par
When we declare variables we are telling the programming language to allocate some space in your computers memory
in order to store the value that you need it to.
The amount of space needed to store each variable depends based on your specific language being used and which data
type is being used to store the value.
\subsection{Data Types}
Programming languages support different types of data types or different types of values that they can represent in variables.
Some programming languages use multiple different types of values but most of them support the basic types: string, integer
Some programming languages use multiple different types of values but most of them support the basic types: string, integer (multiple kinds)
and boolean (true or false).
\begin{lstlisting}
\begin{lstlisting}[caption={Data Types}]
string = "Brett"
integer = 10
boolean = false
@ -24,7 +40,11 @@ boolean = false
Please keep in mind that each programming language supports different data types and you should research those types to better
understand variables in that language.
As well some programming languages that are strickly typed which requires us to define the data type of the
variable on declaration (unlike our sudo language).
\subsection{Operations}
\subsection{Conclusion}

+ 19
- 0
3 - Functional Programming/1.2 - Control Statements.tex View File

@ -0,0 +1,19 @@
\subsection{If Statements}
\subsection{If-Else Statements}
\subsection{For Loops}
\subsection{While Loops}
\subsection{Do-While Loops}
\subsection{Switch Stataments}
\subsection{Break Statments}
\subsection{Continue Stataments}
\subsection{Conclusion}

+ 8
- 0
3 - Functional Programming/1.3 - Functions.tex View File

@ -0,0 +1,8 @@
\subsection{Declaration}
\subsection{Returns}
\subsection{Parameters}
\subsection{Recursion}

3 - Functional Programming/1.3 - Control Statements.tex → 4 - Object Oriented Programming/1.1 - Classes and Objects.tex View File


3 - Functional Programming/1.4 - Loops.tex → 4 - Object Oriented Programming/1.2 - Inheritence.tex View File


3 - Functional Programming/1.5 - Functions.tex → 4 - Object Oriented Programming/1.3 - Polymorphism.tex View File


+ 0
- 0
4 - Object Oriented Programming/1.4 - Design Patterns.tex View File


BIN
Programming In General.pdf View File


+ 37
- 13
Programming In General.tex View File

@ -9,6 +9,7 @@
\usepackage{layout}
\usepackage{fancyhdr}
\usepackage{color}
\usepackage{setspace}
\author{Brett Langdon}
\title{Programming In General}
@ -16,6 +17,8 @@
\pagestyle{fancy}
\voffset=0.25in
\parskip 10pt
\parindent 0pt
\renewcommand{\theenumii}{\arabic{enumii}}
\renewcommand{\labelenumii}{\theenumii.}
@ -114,43 +117,64 @@ Brett \textsc{Langdon}
\pagebreak
\section{Who Is This Resource For}
\input{"./1 - Introduction/1.1 - Who Is This Resource For"}
\vfill
\pagebreak
\section{Code Examples}
\input{"./1 - Introduction/1.2 - Code Examples"}
\vfill
\pagebreak
\chapter{Getting Started}
\input{"./2 - Getting Started/Getting Started"}
\vfill
\pagebreak
\section{Choosing A Programming Language}
\input{"./2 - Getting Started/1.1 - Choosing A Programming Language"}
\vfill
\pagebreak
\section{How To Read This Resource}
\input{"./2 - Getting Started/1.2 - How To Read This Resource"}
\vfill
\pagebreak
\section{Sudo Language}
\input{"./2 - Getting Started/1.3 - Sudo Language"}
\vfill
\pagebreak
\chapter{Functional Programming}
\input{"./3 - Functional Programming/Functional Programming"}
\vfill
\pagebreak
\section{Variables}
\input{"./3 - Functional Programming/1.1 - Variables"}
\vfill
\pagebreak
\section{Control Statements}
\input{"./3 - Functional Programming/1.3 - Control Statements"}
\section{Loops}
\input{"./3 - Functional Programming/1.4 - Loops"}
\input{"./3 - Functional Programming/1.2 - Control Statements"}
\vfill
\pagebreak
\section{Functions}
\input{"./3 - Functional Programming/1.5 - Functions"}
\input{"./3 - Functional Programming/1.3 - Functions"}
\vfill
\pagebreak
\chapter{Object Oriented Programming}
\input{"./4 - Object Oriented Programming/Object Oriented Programming"}
\vfill
\pagebreak
\section{Classes and Objects}
\input{"./4 - Object Oriented Programming/1.1 - Classes and Objects"}
\vfill
\pagebreak
\section{Inheritence}
\input{"./4 - Object Oriented Programming/1.2 - Inheritence"}
\vfill
\pagebreak
\section{Polymorphism}
\input{"./4 - Object Oriented Programming/1.3 - Polymorphism"}
\vfill
\pagebreak
\section{Design Patterns}
\input{"./4 - Object Oriented Programming/1.4 - Design Patterns"}
\vfill
\pagebreak
\chapter{Data Structures}
\input{"./5 - Data Structures/Data Structures"}
\vfill


+ 1
- 0
build View File

@ -23,6 +23,7 @@ for d in filter(lambda d: not re.search('.git',d),dirs):
section = re.sub('\d+.\d+\s-\s|.tex', '', f)
book.write('\r\n\section{' + section + '}\r\n')
book.write('\input{"' + d + '/' + f.replace('.tex', '') + '"}\r\n')
book.write('\\vfill\r\n\pagebreak')
book.write(footer.read());


+ 3
- 0
header.tex View File

@ -9,6 +9,7 @@
\usepackage{layout}
\usepackage{fancyhdr}
\usepackage{color}
\usepackage{setspace}
\author{Brett Langdon}
\title{Programming In General}
@ -16,6 +17,8 @@
\pagestyle{fancy}
\voffset=0.25in
\parskip 10pt
\parindent 0pt
\renewcommand{\theenumii}{\arabic{enumii}}
\renewcommand{\labelenumii}{\theenumii.}


Loading…
Cancel
Save