Friday, October 07, 2016

Introduction to Programming by Eli

t.com and today's class is introduction to programming so programming as we
enter you sit down at a computer you you type out a lot of texts or such
and that turns a new angry birds or QuickBooks or office or an entire
operating system if you're going to be in the technology field
you do not have to be an expert programmer but you should understand how
to do some programming so so whenever you think about programming you know
when most people think about programming again they think about windows 7 or
office or QuickBooks are these really big massive programs
well in reality like like with what i use you can create very small programs
are in order to do very specific tasks so right now you know the videos that
you watch on everyman IT are provided to you are from a little 15 line script
that I wrote so i wrote this little 15 line script with some things called
variables in it and whenever you come to one of our pages that has a video posted
on our page on that little 15 line piece of code runs and you can walk our videos
so what I want you to understand is you know when you do programming yes you can
create these massive Windows 7 operating systems etc etc etc but the reality is
is you can create much smaller programs to do very specific tasks and that can
be very very useful for you as a technician so so when I worked back for
one of the enterprise companies we had 200 new servers that that that we're
going and we were installing 200 new servers for our server farm
well every single one of those servers needed a little edit to the registry to
allow something to happen
so again i was able to write I don't know a five or 10 line script that would
literally go out and on every single server it would automatically change
that little that that registry
a key in order for in order for us to do what we needed to be done so I so when
you're thinking about programming again
don't always think about the big stuff there's a lot of little things uh that
that you can do so with this class today we're not going to be you know going
into actually writing functions and all that kind of stuff we're just going to
be going over the basic things that you have to understand if you're thinking
about programming so we're going to be talking about things like programming
languages we're going to talk about the difference between compiled and a
scripted languages we're going to be talking about api's and SDKs prototyping
pseudocode the types of programmers so if you're interested in becoming a
programmer
uh there are different types of programs out there so we'll talk about that and
then we'll wrap up with some final thoughts
so this that you know don't worry you know you don't you don't have to to to
put your thinking cap on this is gonna be a very easy class we're just going to
go buddy
do an overview of what programming is and give you some of the basic concepts
that you have to understand before you start programming yourself
so let's talk about programming languages so so most people when they
think of programmers they just think that any programmer can program anything
like programmers are programs programs program yeah that that's kind of what
they think you know if you know how to do programming you can do anything
well just like every other profession and technology
programming is actually divided into a lot of different sub professions or sub
careers
the reason is is because basically what programming does is you as a programmer
right out in a type of code that's called human readable
so you type out you know if x equals 2 then print12 you know you you type out
what you want to have happen and then the programming language then it turns
that into something that the computer can do something with so so you type in
what's called a human-readable language and then the the either the compiler or
the script interpreter turns that into ones and zeros that computers can
understand so remember a computer only understands on and off 1 & 0
it does not understand if then loop x equals it doesn't understand that it
understands on and are sent off
so what you're doing is you create your programming something called human
readable and then that gets turned into ones and zeros
now when it gets turned into ones and zeros different programming languages
allow this to happen in different ways
so if you want let's say create a device drivers
so you're going to create a driver for a modem
you would probably use something called c plus that is used for doing device
drivers if you were going to create a web database application you would use a
programming language called PHP so this particular language is best suited for
for sending and pulling data from a database so think about programming
languages
the way you would think about any other program
that you use on the computer so you would not go into quickbooks to write a
report
you probably even couldn't even do it if you wanted to
I just like with programming languages you could not write a device driver with
PHP PHP is used for web based database applica applications that's all that can
be used for you can't use it to write device drivers it simply can't do that
the same is true you want to go into word to draw a picture
it's just not built for that so when we're talking about programming language
is again programming languages are like any other application you would use on
the computer
eat programming language is is used to do a specific type of program so PHP is
used for for you is a web based database applications you can program for flash
so you know all those fancy graphics that you see on web sites
there's a programming language that allows you to interact with those things
if you wanted to create an application like QuickBooks or something like word
you might use a programming language called visual basic or the visual studio
if you are going to be trying to create programs that are that are
cross-platform uh you know they can run on linux and they can rack we're on a
mac and they can run on windows
you might use a programming language called Java
why because Java allows you to do that
so the main thing that I want you to understand what these programming
languages is eat programming language is designed to do a certain set of
functions very well
so when you were deciding to write your program basically what you have to do is
you have to decide what you want your program to do and then once you figure
it out what you wanted to do then you figure out the language that you need to
learn or you need to use in order to create the program so so don't think you
know i'm going to learn PHP and then i'm going to write my own operating system
PHP again just doesn't do it and the main thing with programming languages to
understand
is what you're going to be doing is you're going to be taking what is called
human readable code so you actually type out with a text editor or one is
compilers you type out what you want the code to do and then that compiler or
what's called an interpreter turns that into ones and zeros on and off that
that's all the computer cares about
so that's the basic thing to understand the programming language is a lot of
people get confused
remember just like any other application programming language is built to do
specific tasks you would not use quickbooks to write a report you would
not use Microsoft Word to draw a picture it's not built that way
same with programming languages PHP web database applications HTML creating web
pages
java creates cross black the platform Oh programs
so the next terms that you should
when we're talking about programming languages are compiled programming
languages and scripted programming languages
so what does this mean well basically compiled programming languages are the
oldest programming like we just
and basically what happens is you write out your code you know if this happens
then do this
print this etc etc etc you then open up a compiler so compiler is an application
is a piece of software you have on your computer you then feed the compiler
you're so source code so that human readable code that you just created you
feed that to the compiler the compiler turns that into ones and zeros that the
computer understands and then it spits out a program on the other side so an
executable file so you put in all this text
the the compiler turns all that text in new ones and zeros and spits out an
executable program so that program you can then double click or however you run
it on your computer and it will run that way it is now a compiled program that's
what compilers do they term human readable text in to compile programs
then there are scripting languages with scripting languages do is you don't
actually compile the code so you write out all of your code so you know if this
happens then do this then print this you write that out you then simply put that
text onto the server or computer that is going to be running the code you install
something called an interpreter onto the computer and then that interpreter read
the code and then spits out the results to whoever is using the program
so if you ever hear of batch files visual basic script javascript PHP 80ml
any of these types of programming languages you actually sit down at a
text editor you write out all this text you put that file onto your server that
lets say let's say we're talking about a PHP program so when I write PHP programs
i write out all the texts literally in notepad
I then upload that to my web server with a file association of dot PHP
on my web server i have PAP installed so when somebody goes to my PHP script that
PHP interpreter reads the file and then does whatever it is that that that that
file says should happen
so the main thing to understand when you're talking about compiled languages
are scripted languages compiled languages mean you take all that human
readable code you dump it into the compiler it spits out an executable file
so the file it spits out you know if that's all just ones and zeros scripted
languages everything remains as text you install an interpreter onto the computer
that is going to be running that scripted language to install PHP visual
basic or windows script host something like that on to the computer and then
when you run the program that interpreter will read the code that you
but you've given it and then provide you with the results so so this is something
i understand that between compiled and scripted computer languages
now the next terms i'm sure you've heard a lot about you know if you've been
following the the technology industry lately
r AP is and sdk so api's or application programming interfaces SDKs our software
development kits
what are these and why are these important to you well companies let's
say Facebook or Twitter Tumblr or any of these types of things they do very
specific things and in order to grow their influence in the world
they want you average people to be able to create programs that can can either
push or pull data to their sites so like with with with twitter twitter is the
the most popular one for AP is so you can create a program that either sends
posts to twitter so it shows up and Twitter or poles post from Twitter to to
show up in whatever web-based application that you are creating while
the way that your program can do this is through something called API application
programming interfaces
so what this is is twitter or facebook or myspace or any of this
you know they have a closed environment they have a secret sauce
when you create a post on to Twitter you create the post use hit submit and then
it goes off the twitter and then something happens
magic happens right uh and then you know it shows up on your homepage
well the thing is Twitter to prevent hacking and to prevent problems they
don't want to tell anybody about the secret sauce
they don't want to tell anybody how their program actually works
so what they do is they create what are called api's and these are basically
points where your program can connect to their program and they can exchange data
so basically any of these api is that are created you can interact with if
they're not created you can't get behind their wall
so basically like it like Twitter you can do a basic program that would say
you know right
or print uh the last post from Eli computer guy
and so you would write out a line of code that would basically say get last
post from Eli computer guy and print on my particular website
so what happens is you can interact with those those api's are called application
programming interfaces you don't get into their secret sauce you can simply
push and pull certain data
the main thing to understand what these e api's is one of the vendor you know
Facebook Twitter whatever can change these AP is anytime they want so twitter
has done this a couple of times to everybody should grant
the other thing is like I say you have to play by their rules so whether you're
dealing with Google or Twitter etc they will come up with their rule book and
they will tell you how you can interact with those API and those are the only
ways that you can interact with whatever it is that they're doing the next thing
is SDKs for software development kit a lot like AP is but basically so we have
these new devices coming out
iphones ipads I this I that zooms whatever
basically what SDKs are or are there kids that allow you to be able to
program for the device that you're trying to program for so they come with
a lot of special tools they come with things like what are called emulators so
emulators are kind of like like fake devices so you can
have a like a little android phone pop up on your computer and you can create a
program for that little fake android phone to make sure that it works
properly you know if i push this button
what will happen to these software development kits
basically what they do is they package all the information and all the tools
that you need in order program for a device and they
well either give it to you or they they sell it to depending on who you're
dealing with
sometimes like for the Android system the SDKs are completely free for other
systems they're they're going to quote cost you quite a bit of money but
basically the the SDKs software development kits are kids that allow you
to program for particular devices so again
ap is SDKs at this point you don't have to worry about them a lot but it's good
to understand
so the next thing I want to talk
first step in the the programming process so you thought about what
program you want to create let's say you want to create some kind of web
application
well after you thought you want to start creating some web application you are
going to want to do prototyping
so what prototyping is is where you sit down and on plain old pieces of paper or
with something a program like vizio or such
you sit there and you actually sketch out what you want the program to do so
basically uh let's say where we have a program that we want to collect people's
email addresses
you know it's kind of like you know with every man I t.com here we have a little
newsletter link if you want our newsletter you can you put in the email
address you click Submit and that submits the data into our database
so if we're going to prototype this on a piece of paper or on a white board we
would simply you know draw out and we would say okay I want to have a box and
I want the box to have an email address
no place for somebody put an email address and above it it will say email
and below it it will say submit and I write it out like i say on a piece of
paper or on a white board like this then if this is what's going to happen that i
would write out here and I would just put for you know when you hit submit
that then goes into the database and that's all you do basically with
prototyping you literally on a piece of paper write out or draw out how you want
this application to work and you write it out so that later you can have an
idea of how you're actually going to be programming this thing
the biggest problem with programming is that most people don't understand what
they actually want to do so
so they get you know they sit down and they write half a program and they find
out that that what they'd written isn't going to end up doing what they want to
do so they scrapped that and then write another half a program
then find out that's not what they want to do they scrapped that right another
program basically the first thing that you want to do is do prototyping where
you draw everything out so that you understand what you want this
application do like I say even even this little email thing here
this can probably take five or six pages just to write out how everything is
going to work
so for this let's say this is this is the the submit the email
so they put in their email address you hit submit and it goes to the database
well then if we have a report section
so let's say I want to add men page and then under that I would have a report
button and if i click the report button that would have to go to the database
and then that would have to print out a report with all the email addresses and
it basically just get really confusing we're going to go into this more as we
actually start creating programs but the main thing to understand is all
prototype penis is on a whiteboard or a piece of paper you actually just simply
draw out there is there is no complicated stuff for you something draw
out how you want this program to work
so once we've drawn out the prototype
of how we want our little program to work we need to start working on
something called pseudo code so what is pseudo code pseudocode is when you
simply write out long had how you want the program to function how you want
different operations to happen so let's say we're talking about this newsletter
program again
so this text box and we have a submit button right
so basically if we're going to write pseudocode for the submit button so we
want to say when i click the submit button what do I want to have happen so
we would say uh when i click some it
email address and text box should be added to the email database
so basically all we do is rewrite out like that - I like this in longhand we
write out what we want this
what we want to have happen when we click Submit when I click the submit
button
the email address in the tax book should be added to the email database
this does two things for us one it makes us start thinking about the process that
we want to have happen before we actually get into the code actually
writing out the code and it allows us to decide what programming language we're
going to be using so if this is going to be a web-based application going to do a
database
I can say we will probably be using the PHP programming language you know if I
write all this out
I know it's not going to be javascript I know it's not going to be HTML
we're going to get into that later but basically by writing the pseudocode i
can say ok the programming language is I'm going to need is PHP
the other thing again as we go into the more advanced topics with doing
programming is by writing this out before worried about the product
actually programming in the language
it's you
here to understand the logical ideas of what are going to be happening in this
process are so when you write it out like i say you can think you can simply
think about what you want to have happen you're not actually thinking about cold
right now so this is very important
so basically the next step in the process what you do
the first thing is you you think about what you want to create you come up with
an idea hey i wish i could get people's email addresses
then you create prototyping where you actually you know what I say on a
whiteboard or pieces of paper you draw out what you want to have happen then
after that for each thing that you want to have happen you would then write
pseudocode and pseudo code like I say it's just you just write out longhand
what you want to have happen now passed this is where we'll get into actual
classes on programming so we'll have classes on PHP and JavaScript and HTML
so past this is then where you turn that this idea into an actual program into an
actual application so this is as far as we're going to go to Dale i say more
advanced classes were going to talk about more but these these are very very
important steps like I say too many people don't spend enough time on
prototyping too many people don't spend enough time on pseudocode
and if you don't write out what you want to have happen
that is really really difficult to actually program the stuff later
so the final subjective round
about today are the types of programmers out there because like I say you know
everybody when they come into the the technology field the computer field they
say you know I want to do computers
you know I want to do programming and they don't realize that there are a lot
of sub professions in the technology field so you know if you're going to
come into computers you know I t information technology like I do
well you can fix computers or you could fix servers or you could do networking
or you do telephone systems are you do surveillance systems or it was a whole
bunch of stuff that all requires its own skill set
the same is true with programmers a programmer is not a programmer
they all program but they all do different things
so the first type of programmer and probably easiest one for you to get into
is what is called a web programmer so so when you go to a website and all these
kind of fancy stuff happens on the website that is something that a web
programmer does
so basically web programmers program applications that run on the web
things like grabbing people's email addresses you know presenting websites
in a certain way that kind of stuff
this type of thing you can learn at home and you can actually produce real
professional stuff like save just just right out of your house with no real
professional training you just get a few books
you understand how all of it works and you cannot go out there and you can
start and become your own web programmer
the next type of programmer is more like the programmer programmer the the
programmers that you would be thinking about these people you know will be
creating things like device drivers very complicated programs
so basically with with a web programmer you can create a web program in a couple
of hours maybe a week maybe two weeks you know if you just sit down and do it
usually does not take that long for most web programs programmer programmers if
you're creating things like device drivers for a modem or for a video card
you're creating applications like QuickBooks microsoft office
those things take a lot of time so programmers are the guys that just stand
or sit in front of a monitor for 18 hours a day drinking there Joel colas
and yes just writing code so so those are the people like the real serious
programmers
you know that's what they're like they would be learning programming languages
like c plus C sharp
java etc then be on programmers then are the highest level of what are called
software engineers so you know when you're creating one little program that
takes a lot of skill it takes a lot of energy
well when you create massive pieces of software you actually need a lot of
engineering you need project management skills in order to to make this happen
so software engineers will be working on like these large cluster computers
things like that
so this is basically just just a simple idea to give you that there are
different types of programmers again you have the web programmers you can learn
this stuff at home you can create professional stuff you know out of your
bedroom on your laptop computer
there's programmer programmers for this you probably need a college education
you know should go off and get a computer science degree
this will allow you to create the programs that you're used to thinking
about again device drivers quickbooks that kind of stuff and then there's the
software engineer software engineers create big programs mean programs a spot
span you know multiple systems multiple servers you know clusters of computers
etc
so that was a class in two
I mean so you know if you're interested if you're thinking about doing
programming these are the basic concepts that you need to understand before you
actually jump in to doing programming you know people want to jump in and they
want to learn PHP or c plus or or all these different programming languages
before they really understand what programming is about the main thing that
I want you to understand with programming is just like every other
facet of computers or technology
there's different sub careers of programmers and the different
programming languages are built to do different things if you spend a year
learning to do and i'll c plus programming that's not going to help you
create web database applications simply not what it's built for you know you
could spend six months learning PHP but that's not going to help you build
device drivers if that's what you want to do you know if you want to create
robots PHP isn't what's going to teach you to do that
so every programming language is like an application that you would use on your
normal computer just like window just like like word or just like QuickBooks
different programming languages are built to do specific things you would
not use quickbooks to try to write a report for school
it's simply not built that for that again you would not use PHP to write a
device driver
you would not you c plus to write a web based application those programming
language simply are not built to do those things we talked about the
compiled versus the scripted language so compiled is where you take the source
code that human readable code you shove it into a compiler and then it spits out
this executable file with ones and zeros so it compiles your your source code
into a program versus a scripted language where you're so source code
always remains a text file you upload the text file to your server you install
the interpreter on to your server and then the interpreter read the code and
then spits out the results so again why is a on on our web server
it has PHP installed i upload PHP code to the web server when you come to our
website
the interpreter reads the PHP code and then gives you the results we talk about
sba api's and
sdk is a little bit application programming interfaces and software
development kits application programming interfaces are the points that companies
like Twitter Facebook Yahoo Google give you in order to connect with their
systems so so they have a whole secret recipe for how things happen in their
systems and they don't want you messing around with that
so what they do is they give you these api's that allow you to do specific
tasks so if you want to post to post to twitter from a different application
that application will connect to Twitter through an API that will allow that post
to happen if you want to read posts from twitter on a different application that
application would go to that API and then pull the post off of twitter
the main thing to understand what these api's is you get what the company gives
you so facebook twitter has done this a couple of times they can change these
api is at any time
it's all up to them they can give you more or less access
basically you know by by flipping a coin it's all up to them you don't get any
control over what happens in their systems then the SDKs again you've
probably heard about a lot nowadays is called software development kits
so if you're going to be creating applications like I say for the iPhone
the iPad Android devices zooms whatever whatever it is you're going to build
they have sdk is basically these are packaged programming applications that
allow you to create programs for those specific devices we then talked about
prototyping so this is the first step in creating a program no technical skills
required you don't you don't need to know anything other than how to write on
a piece of paper
so with prototyping what you do is you think about what you want your program
to do and then you actually write or draw that out on pieces of paper or a
whiteboard so you draw it out so you have an idea of what this thing is
supposed to look like once you have done the prototyping you then go into
pseudocode so what pseudocode is is you know anywhere you have little buttons on
this this this prototype paper
you would then say when i click this button this is what I want to have
happen by writing that pseudo code you start to logically understand what is
supposed to be had
happening with your system better and that allows you to decide what
programming language you are going to be using and then it's easier to figure out
logical problems when you're not actually wrote writing in the
programming language itself you know when you're just writing a free hand
after that we talked about the different types of programmers you know web
programmers programmers programmer software engineers again with this just
like programming languages
I want you to understand the career of being a programmer has different
subcategories you know again
programmers are not programmers you don't say i want to be a programmer and
then you can do everything
that's not how it works you want to create web database applications you
learn one set of programming if you want to create robots you for another
satellite programming if you want to like start creating artificial
intelligence you know fuzzy logic that has you know neural networks that has
entirely different set of programming
you know it takes a lot of time and energy to learn any one of those sets so
you should understand that you know they are different career fields so that was
a class introduction to programming again not too technical or any of that
our next classes are going to start delving into things like programming in
PHP and JavaScript and HTML and that's where you'll get your hands into the
code but right now you just need to understand these basic concepts so when
we go to writing code you have an idea of what you're doing