Browse Source

added new chapter Getting Started, began working on sections 1 and 2 of chapter 2

pull/1/head
Brett Langdon 14 years ago
parent
commit
05c142d0d5
11 changed files with 223 additions and 5 deletions
  1. +12
    -0
      1 - Introduction/1.1 - Who Is This Book For.tex
  2. +7
    -0
      1 - Introduction/1.2 - Code Examples.tex
  3. +16
    -1
      1 - Introduction/Introduction.tex
  4. +34
    -0
      2 - Getting Started/1.1 - Choosing A Programming Language.tex
  5. +132
    -0
      2 - Getting Started/1.2 - Sudo Language.tex
  6. +3
    -0
      2 - Getting Started/Getting Started.tex
  7. +0
    -0
      3 - Functional Programming/Functional Programming.tex
  8. +0
    -0
      4 - Object Oriented Programming/Object Oriented Programming.tex
  9. +0
    -0
      5 - Data Structures/Data Structures.tex
  10. +0
    -0
      6 - Algorithms/Algorithms.tex
  11. +19
    -4
      Programming In General.tex

+ 12
- 0
1 - Introduction/1.1 - Who Is This Book For.tex View File

@ -0,0 +1,12 @@
This book is intended for everyone.
\newline
\\
This book is meant to be useful to programmers of all levels, those who have never programmed before, those who are just
getting started and even those who have been programming for years.
Since this resource will always be growing and changing as the industry changes the information should always be in some
way applicable for all developers.
\newline
\\
Those who are familiar with programming are most likely going to be able to skip the chapter "Getting Started" and in
some cases might not read the book in sequential order, but rather skip around picking and choosing which sections are
applicable to them.

+ 7
- 0
1 - Introduction/1.2 - Code Examples.tex View File

@ -0,0 +1,7 @@
All code examples in this book use a sudo language that is not meant to be run or compiled directly.
I have chosen to use this approach so that the concepts can be extracted and implemented in any language
on any platform.
\newline
\\
I will cover how to use the sudo language and how to translate it to a useable programming language
in the chapter "Getting Started" and section "Sudo Language".

+ 16
- 1
1 - Introduction/Introduction.tex View File

@ -1 +1,16 @@
Programming In General is meant to be used as a resource to learn the concepts of computer programming that can be applied to any
language or platform.
\newline
\\
This resource is and always will be provided for free.
\newline
\\
This resource is currently a work in progress so please bear with me if any particular sections or chapters are in complete or
if sections contain less than correct information.
If you have any comments, questions, suggestions or corrections please feel free to contact me by e-mail at:
\newline
brett@blangdon.com
\newline
\\
Thank you and enjoy.
\pagebreak

+ 34
- 0
2 - Getting Started/1.1 - Choosing A Programming Language.tex View File

@ -0,0 +1,34 @@
It is wonderful that you have decided to undertake the hobby of computer programming, but which language should you choose: Python, PHP, Java, C\#,
C/C++, VB, Ruby, Scala, Groovy, Javascript, or one of the thousands of others languages available to programmers. There are many factors to consider
when choosing a programming language especially when getting into programming for the first time: paradigm, syntax, platform and even just the
coolness factor.
\newline
\subsection{Paradigm}
A languages paradigm refers to how the language is constructed. For example the three mainly disucessed paradigms are Functional, Object Oriented
and Multi Paradigm. Functional refers to languages that are based around completing tasks using Mathematical functionals; C is an example of
a functional language because it does not support the use of classes or objects. Object Oriented languages on the other hand are constrcuted
by designing classes and objects to complete your programming tasks; Java is an example of an Object Oriented programming language because
regardless of the type of program you develop you are forced into using classes and objects. Multi Paradigm languages are usually a mix
of more than one paradigm. For example Python is a Multi Paradigm language because you can choose whether or not to use classes and objects
when programming.
\subsection{Syntax}
A languages syntax is very important when choosing a language. This is mainly going to be a personal preference. Personally I like C style
sytanx languages like C,C++,Java,PHP,Javascript,etc. Other people might prefer other languages because their use of other syntax styles. Your
personal preference will come with time as you move from one language to another and develop your own personal style and preferences.
\subsection{Platform}
This is a very important factor when choosing which programming language to use. What platforms do you have available to use? Do you only have
a Windows computer at your disposal? That might remove some of the options out there as some languages might not support developing on a
Windows machine.
\subsection{Coolness}
What seems cool to you? Right now as I write this a lot of people are trying out Node.JS (even myself) as it is somewhat new and exciting.
What do you want to learn? Does the idea of developing real time event based web applications seem cool? Then maybe you should check out
Node.JS. Prefer to develop Windows based desktop applications, why not try out C\# or Vb? Go with what you feel.
\subsection{Conclusion}
Advice, if after doing some research you are still unsure which lanauge you want to use, especially for going through this resource try out
Python. Python is available for every platform, or at least all of the ones I can think of, it is interpreted and lastly it's syntax is
going to be one of the closest to the sudo langauge that this book uses.

+ 132
- 0
2 - Getting Started/1.2 - Sudo Language.tex View File

@ -0,0 +1,132 @@
For the code examples presented in this resource I am going to be using a sudo language. The concept behind a sudo language
is to be able to present programming concepts in a language agnostic form so that the concepts can be translated to your
language of choice.
\newline
\\
So it is great that you have chosen lanauge X to use throughout this book, but how is the sudo lanauge going to help you out?
Well, lets walk through a few examples and I will show you how the examples get translated to a few various languages.
\subsection{Example 1}
\begin{lstlisting}
name = "Brett"
if name == "Brett"
print "Name Is Brett"
else
print "Name Is Not Brett"
\end{lstlisting}
In this example we have a variable called "name" that we are assigning the value of "Brett". Then we are checking if the
variable name is equal to the value "Brett", if so then we want to print "Name Is Brett" otherwise if it does not then we want to
print "Name Is Not Brett". As far as programming goes this is a fairly simple process but lets try and translate this example
to a few different languages to see how it is done.
PHP:
\begin{lstlisting}
<?php
$name = 'Brett';
if( $name === 'Brett' ){
echo 'Name Is Brett';
} else{
echo 'Name Is Not Brett';
}
\end{lstlisting}
C:
\begin{lstlisting}
int main{
char* name = "Brett";
if( name == "Brett" ){
printf("Name Is Brett");
} else{
printf("Name Is Not Brett");
}
return 0;
}
\end{lstlisting}
Python:
\begin{lstlisting}
name = "Brett"
if name is "Brett":
print "Name Is Brett"
else:
print "Name Is Not Brett"
\end{lstlisting}
Node.JS:
\begin{lstlisting}
var name = "Brett";
if( name == "Brett" ){
console.log("Name Is Brett");
} else{
console.log("Name Is Not Brett");
}
\end{lstlisting}
Java:
\begin{lstlisting}
class Example1{
public static void main( String[] args ){
String name = "Brett";
if( name.equals("Brett") ){
System.out.println("Name Is Brett");
} else{
System.out.println("Name Is Not Brett");
}
}
}
\end{lstlisting}
Notice that all of the actual examples end up looking the same? That is the point of using the sudo language, so that we can
discuss the core concepts for each example.
\subsection{Example 2}
Since we have seen a fairly simple example above, lets take a look at a more complicated example. Do not be afraid if it does not make
too much sense right now, but try and notice the similarities between the sudo language and the actual code examples.
\begin{lstlisting}
class Person
private name
function getName()
return this.name
function setName( newName )
this.name = newName
p = new Person()
p.setName("Brett")
if p.getName() == "Brett"
print "Name Is Brett"
else
print "Name Is Not Brett"
\end{lstlisting}
Ok, in this example we are using the concept of classes and objects. We are creating a new class called "Person" with a
private property "name" and two methods "getName" and "setName". "getName" will return the value of the private property "name" and
"setName" will take in a single parameter "newName" and set the private property "name"'s value to the value of "newName". Lastly we
are going to create a variable called "p" and have it be equal to a new instance of a "Person", set that instances name to "Brett" then like
in the previous example we are going to get if the value of "p"'s private property "name" is equal to "Brett".
\newline
\\
Like I mentioned before, this example might go over the head of some people as it introduces some more advanced topics, but hopefully it
helps to understand how you can translate the sudo language.
PHP:
\begin{lstlisting}
<?php
class Person{
private $name;
public function getName(){
return $this->name;
}
public function setname( $newName ){
$this->name = $newName;
}
}
\end{lstlisting}

+ 3
- 0
2 - Getting Started/Getting Started.tex View File

@ -0,0 +1,3 @@
This chapter will cover how to get started with programming, how to choose which language or platform to start with and how to go about
using this resource.
\pagebreak

2 - Functional Programming/Functional Programming.tex → 3 - Functional Programming/Functional Programming.tex View File


3 - Object Oriented Programming/Object Oriented Programming.tex → 4 - Object Oriented Programming/Object Oriented Programming.tex View File


4 - Data Structures/Data Structures.tex → 5 - Data Structures/Data Structures.tex View File


5 - Algorithms/Algorithms.tex → 6 - Algorithms/Algorithms.tex View File


+ 19
- 4
Programming In General.tex View File

@ -15,15 +15,30 @@
\chapter{Introduction}
\input{"./1 - Introduction/Introduction"}
\section{Who Is This Book For}
\input{"./1 - Introduction/1.1 - Who Is This Book For"}
\section{Code Examples}
\input{"./1 - Introduction/1.2 - Code Examples"}
\chapter{Getting Started}
\input{"./2 - Getting Started/Getting Started"}
\section{Choosing A Programming Language}
\input{"./2 - Getting Started/1.1 - Choosing A Programming Language"}
\section{Sudo Language}
\input{"./2 - Getting Started/1.2 - Sudo Language"}
\chapter{Functional Programming}
\input{"./2 - Functional Programming/Functional Programming"}
\input{"./3 - Functional Programming/Functional Programming"}
\chapter{Object Oriented Programming}
\input{"./3 - Object Oriented Programming/Object Oriented Programming"}
\input{"./4 - Object Oriented Programming/Object Oriented Programming"}
\chapter{Data Structures}
\input{"./4 - Data Structures/Data Structures"}
\input{"./5 - Data Structures/Data Structures"}
\chapter{Algorithms}
\input{"./5 - Algorithms/Algorithms"}
\input{"./6 - Algorithms/Algorithms"}
\end{document}

Loading…
Cancel
Save