diff --git a/1 - Introduction/1.1 - Who Is This Book For.tex b/1 - Introduction/1.1 - Who Is This Resource For.tex similarity index 57% rename from 1 - Introduction/1.1 - Who Is This Book For.tex rename to 1 - Introduction/1.1 - Who Is This Resource For.tex index 987fdd5..4bbcc2e 100644 --- a/1 - Introduction/1.1 - Who Is This Book For.tex +++ b/1 - Introduction/1.1 - Who Is This Resource For.tex @@ -1,12 +1,12 @@ -This book is intended for everyone. +This resource 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 +This resource 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 +some cases might not read the resource in sequential order, but rather skip around picking and choosing which sections are applicable to them. diff --git a/1 - Introduction/1.2 - Code Examples.tex b/1 - Introduction/1.2 - Code Examples.tex index 2708960..1c51344 100644 --- a/1 - Introduction/1.2 - Code Examples.tex +++ b/1 - Introduction/1.2 - Code Examples.tex @@ -1,4 +1,4 @@ -All code examples in this book use a sudo language that is not meant to be run or compiled directly. +All code examples in this resource 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 diff --git a/2 - Getting Started/1.1 - Choosing A Programming Language.tex b/2 - Getting Started/1.1 - Choosing A Programming Language.tex index 0344503..650cd62 100644 --- a/2 - Getting Started/1.1 - Choosing A Programming Language.tex +++ b/2 - Getting Started/1.1 - Choosing A Programming Language.tex @@ -31,4 +31,4 @@ Node.JS. Prefer to develop Windows based desktop applications, why not try out C \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. +going to be one of the closest to the sudo langauge that this resource uses. diff --git a/2 - Getting Started/1.2 - Sudo Language.tex b/2 - Getting Started/1.2 - Sudo Language.tex index 6a7368e..72cbd41 100644 --- a/2 - Getting Started/1.2 - Sudo Language.tex +++ b/2 - Getting Started/1.2 - Sudo Language.tex @@ -3,7 +3,7 @@ is to be able to present programming concepts in a language agnostic form so tha 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? +So it is great that you have chosen lanauge X to use throughout this resource, 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} @@ -78,7 +78,8 @@ class Example1{ \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. +discuss the core concepts for each example. Also, notice the Python implementation, it is almost line for line, word for word +identical to the sudo language 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 @@ -129,4 +130,87 @@ class Person{ $this->name = $newName; } } + +$p = new Person(); +$p->setName('Brett'); + +if( $p->getName() === 'Brett' ){ + echo 'Name Is Brett'; +} else{ + echo 'Name Is Not Brett'; +} +\end{lstlisting} + +Java: +\begin{lstlisting} +class Person{ + private String name; + + public String getName(){ + return this.name; + } + + public void setName( String newName ){ + this.name = newName; + } + + public static void main(String[] args){ + Person p = new Person(); + p.setName("Brett"); + + if( p.getName() == "Brett" ){ + System.out.println("Name Is Brett"); + } else{ + System.out.println("Name Is Not Brett"); + } + } + +} \end{lstlisting} + +Node.Js: +\begin{lstlisting} +var Person = function(){} +Person.prototype.getName = function(){ + return this.name; +} +Person.prototype.setName = function( newName ){ + this.name = newName; +} + +var p = new Person(); +p.setName("Brett"); + +if( p.getName() == "Brett" ){ + console.log("Name Is Brett"); +} else{ + console.log("Name Is Not Brett"); +} +\end{lstlisting} + +Python: +\begin{lstlisting} +class Person: + def getname( self ): + return self.name + def setName( self, newName ): + self.name = newName + +p = Person() +p.setName("Brett"); + +if p.getName() is "Brett": + print "Name Is Brett" +else: + print "Name Is Not Brett" +\end{lstlisting} + +This example does a better job of showing how each language can tackle the concepts in a different manner but the core concepts +laid out by the sudo language can still be extrapolated and translated to each individual programming language. As long as the +language supports the concepts. As you may notice that I left out the implementation of C in this example. It is because C +does not support the use of classes and objects, yes there are ways of completing this example in C using structs but that +is something that you should learn on your own. +\newline +\\ + +So now you have seen a few examples, hopefully enough to give you an idea of how the examples in this resource will be presented. diff --git a/2 - Getting Started/1.3 - How To Read This Resource.tex b/2 - Getting Started/1.3 - How To Read This Resource.tex new file mode 100644 index 0000000..07bb3c5 --- /dev/null +++ b/2 - Getting Started/1.3 - How To Read This Resource.tex @@ -0,0 +1,12 @@ +This resource is going to be laid out a little weird, more so for those who have already had some programming background. +\newline +\\ + +For those who are new to programming I strongly suggest reading through Chapters 3 and 4 thoroughly before continuing with the +rest of the resource. Those two chapters contain all of the core concepts needed in order to understand some of the higher level +concepts presented with Data Structures and Algorithms. +\newline +\\ + +Once you have completed chapters 3 and 4 please feel free to jump around a little between sections presented in chapters 5 and 6 as +some data structures or algorithms might interest you more than others. diff --git a/3 - Functional Programming/Functional Programming.tex b/3 - Functional Programming/Functional Programming.tex index e69de29..179e551 100644 --- a/3 - Functional Programming/Functional Programming.tex +++ b/3 - Functional Programming/Functional Programming.tex @@ -0,0 +1,11 @@ +In this chapter we are going to cover the basic concepts of functional programming. This could mean a few things +to different people, but in regard to this resource we are going to refer to functional programming as programming +without the use of classes and objects. Yes, some people are cringing a little in their seats as that is not the best +definition of functional programming but to try and keep things simple and organized that is what we are going to +refer to it as. +\newline +\\ +Functional Programming: +\newline +--insert definition here-- + diff --git a/Programming In General.tex b/Programming In General.tex index 6712b68..12c3c9a 100644 --- a/Programming In General.tex +++ b/Programming In General.tex @@ -15,8 +15,8 @@ \chapter{Introduction} \input{"./1 - Introduction/Introduction"} -\section{Who Is This Book For} -\input{"./1 - Introduction/1.1 - Who Is This Book For"} +\section{Who Is This Resource For} +\input{"./1 - Introduction/1.1 - Who Is This Resource For"} \section{Code Examples} \input{"./1 - Introduction/1.2 - Code Examples"} @@ -30,6 +30,9 @@ \section{Sudo Language} \input{"./2 - Getting Started/1.2 - Sudo Language"} +\section{How To Read This Resource} +\input{"./2 - Getting Started/1.3 - How To Read This Resource"} + \chapter{Functional Programming} \input{"./3 - Functional Programming/Functional Programming"}