diff --git a/1 - Introduction/1.1 - Who Is This Resource For.tex b/1 - Introduction/1.1 - Who Is This Resource For.tex index 6bb0d7a..95ec6db 100644 --- a/1 - Introduction/1.1 - Who Is This Resource For.tex +++ b/1 - Introduction/1.1 - Who Is This Resource For.tex @@ -7,6 +7,7 @@ Since this resource will always be growing and changing as the industry changes way applicable for all developers. \par -Those who are familiar with programming are most likely going to be able to skip the chapter "Getting Started" and in +Those who are familiar with programming are most likely going to be able to skip the chapter \pigChapter{Getting Started} and in 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 f1a94c2..39f3bdb 100644 --- a/1 - Introduction/1.2 - Code Examples.tex +++ b/1 - Introduction/1.2 - Code Examples.tex @@ -1,7 +1,9 @@ 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. +By focusing on the concepts at hand rather than specific implementations I can focus on trying to present +the material in a clear and easy to understand manner. \par 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". +in the chapter \pigChapter{Getting Started} in the section titled \pigChapter{Sudo Language}. 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 6626ed0..e0127dc 100644 --- a/2 - Getting Started/1.1 - Choosing A Programming Language.tex +++ b/2 - Getting Started/1.1 - Choosing A Programming Language.tex @@ -1,33 +1,65 @@ 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. +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, some +of which are the languages paradigm, syntax, platform and even the coolness factor of the language. \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. +A languages paradigm refers to the languages overall style of development. +For example the three mainly adobted 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 rather than using classes or objects to complete it's tasks it used constructed functions. +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 must use 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. +\par + +There are many more types of paradigms that languages can follow but most languages you will come across today are either +strictly functional, strickly object oriented or they offer the best of both worlds by supporting both. \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. +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, like the almost sudo code style of Python. +Your personal preference will come with time as you move from one language to another and develop your own personal styles 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. +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. +\par + +When starting out try and choose a language that works on a platform that is readily available to you. +Do not try and move to a new or different operating system in order to learn programming. +Keep things simple. \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. +What seems cool to you? +What is everyone else raving about right now? +What is new and different? +\par + +Some may think that this is a silly factor to introduce when trying to pick a programming language to use, but I can honestly +say that it has effected my choices in the past. +When I was learning programming in college we were being taught Java, but I picked up and learned PHP myself on the side +mainly because my friend was using it and I wanted to impress him. +This is not a bad thing. +Let others help influence your decisions when programming, that is how you will grow and learn things you might not of +experienced without the influence. + \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 resource uses. +So, we have taken a quick look at how to go about picking a programming language. +Some of you might say, "that was not really helpful, you did not tell me which language to use", and your right I didn't, it should not +be my choice which language you learn first. +I want to try and keep some bias out so that this resource is as lanuage agnostic as possible. +\par + +\emph{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 (you don't have to compile everytime +you want to run your code) and lastly it's syntax is going to be one of the closest to the sudo langauge that this resource uses. diff --git a/2 - Getting Started/1.2 - How To Read This Resource.tex b/2 - Getting Started/1.2 - How To Read This Resource.tex new file mode 100644 index 0000000..7cf0f20 --- /dev/null +++ b/2 - Getting Started/1.2 - How To Read This Resource.tex @@ -0,0 +1,15 @@ +This resource is going to be laid out a little weird, more so for those who have already had some programming background. +\par + +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. +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. + +\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}. 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 deleted file mode 100644 index 56c120c..0000000 --- a/2 - Getting Started/1.3 - How To Read This Resource.tex +++ /dev/null @@ -1,10 +0,0 @@ -This resource is going to be laid out a little weird, more so for those who have already had some programming background. -\par - -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. -\par - -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/2 - Getting Started/1.2 - Sudo Language.tex b/2 - Getting Started/1.3 - Sudo Language.tex similarity index 51% rename from 2 - Getting Started/1.2 - Sudo Language.tex rename to 2 - Getting Started/1.3 - Sudo Language.tex index d23d632..4267972 100644 --- a/2 - Getting Started/1.2 - Sudo Language.tex +++ b/2 - Getting Started/1.3 - Sudo Language.tex @@ -1,12 +1,15 @@ -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. +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. \par 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. +Well, lets look at two examples and I will show their implementation in a few different languages. +Hopefully this will help you be able to understand how the language should be tanslates (especially if your language of choice +is one that I use). \subsection{Example 1} + \begin{lstlisting}[caption={Example 1 - Sudo Code}] name = "Brett" if name == "Brett" @@ -15,10 +18,25 @@ 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. +For this example lets break it down line by line to make sure we know exactly what is going on. + +\begin{enumerate} + \item {Store the value \pigVal{"Brett"} into the variable \pigVar{name}} + \item {Check if the variable \pigVar{name} is equal to the value \pigVal{"Brett"}} + \begin{enumerate} + \setcounter{enumii}{2} + \item {Print \pigOut{"Name Is Brett"} to the console} + \end{enumerate} + \setcounter{enumi}{3} + \item {Otherwise} + \begin{enumerate} + \setcounter{enumii}{4} + \item {Print \pigOut{"Name Is Not Brett"} to the console} + \end{enumerate} +\end{enumerate} + +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. \begin{lstlisting}[language=php,caption={Example 1 - PHP}]