How to
Teach Yourself to Code.
How to Teach
Yourself to Code
Now
on
Part 1:
Stop Waiting for the
Perfect Technical CoFounder and Start
Learning How to Code
Why learn how to code?
A lot of you just have
an idea
If youre expecting to find someone
to build that idea for you, its
never going to happen
Demand for developers has
skyrocketed
Think about it
Anyone with any programming
talent is getting offers from
Facebook, Google and dozens of
other startups right now
Why should a programmer choose
your idea over any other?
Well, what if I
pay someone?
1) You will pay too much
1) You will pay too much
2) Youll be unhappy with the process
1) You will pay too much
2) Youll be unhappy with the process
3) Youll get something back you didnt want
WHY?
WHY?
Software is hard to estimate
WHY?
Software is hard to estimate
Should this really take 15 hours, or
am I getting ripped off?
If youre an entrepreneur waiting for
someone to execute your idea for you,
youre not an entrepreneur
If youre an entrepreneur waiting for
someone to execute your idea for you,
youre not an entrepreneur
(sorry)
Pre-Dodgeball I went through 3-4 years thinking I
was going to meet some magical engineer who
would build all the stuff I was thinking about. But I
never met that person, so I taught myself ASP and
MS Access out of a book and got to work just
hacking stuff together. Im still a really shitty
programmer but I know enough to hack a prototype
together.
- Dennis Crowley, Foursquare
Learning how to code
!=
How to be a software engineer
The point is for you to learn to
code well enough to
build a prototype
The point is for you to learn to
code well enough to
build a prototype
(aka Minimum Viable Product)
MVP = quick + dirty
Product with the fewest
number of features needed to
achieve a specific objective.
The Entrepreneurs Guide to Customer Development
Side note: build products that are
valuable despite being ugly
Eventually youll need to
find a lead developer
Knowing how to code helps you
find, pitch and manage good
developers
More and more, the things we
interact with in the world around
us qualifies as
technology
There are 10 kinds of people:
There are 10 kinds of people:
Those who understand binary
and those who dont
Society is quickly dividing
into two groups:
1)
Those that know how to code
they can manipulate the very structure
of the world around them.
2)
Those that dont their lives are
being designed and directed by
those that do.
If youre interested in learning more, read Program or Be Programmed: http://amzn.to/yzd6hm
Part 2:
Choosing a
Programming
Language
I get it,
its scary to
jump in.
C, Java, C++, PHP, JavaScript, Python, C#,
Perl, SQL, Ruby, Shell, Visual Basic,
Assembly, Actionscript, Objective C, Lisp,
Where do you start? Delphi, Pascal, Scheme,
Haskell, Tcl, Fortran, Ada, Lua, ColdFusion,
Cobol, Erlang, D, Scala, Smalltalk, Ocaml,
Forth, Rexx.
Breaking down a web application
Web applications are applications
accessed over the internet
The front-end is what you see
Web Pages
Front-end languages:
HTML
CSS
JavaScript
The back-end is what you dont see
Web Pages
Rules
Programming languages:
PHP, Ruby, Python
Database
Database languages:
SQL
Theyre all the same, just different
PHP
echo Hello World;
Hello World
Python
print(Hello World)
Hello World
Ruby
puts Hello World
Hello World
And then there are
web application frameworks
Web Pages
Rules
Database
Web application frameworks: Ruby on Rails, Django
Web application frameworks
alleviate overhead associated with web
development by providing libraries for
database access, templating frameworks,
and session management. Blah blah blah
blah blah blah blah.
Web application frameworks
alleviate overhead associated with web
development by providing libraries for
database access, templating frameworks,
and session management. Blah blah blah
blah blah blah blah.
build web apps
really quickly
If your goal is to build a
prototype, start with
Ruby on Rails
(aka Rails)
Ruby on Rails
is a web application framework
for Ruby
Rails is the easiest to dive into
Rails is the easiest to dive into
(tons of resources and a huge community)
Rails hides all the stuff you really
dont need to know
Rails is just shortcuts like this
rails new application
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/images/rails.png
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/mailers
create app/models
create app/views/layouts/application.html.erb
create app/mailers/.gitkeep
create app/models/.gitkeep
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
.
.
.
create vendor/plugins
create vendor/plugins/.gitkeep
run bundle install
So you can do stuff like this
Theres a temptation for
programmers to say
Start with PHP or Java
They say this because:
1. it mirrors the way we learn
things in school
2. its how they learned
IGNORE them
With those languages, youll
spend MONTHS learning the
basics so that you can do this:
(make a yellow square)
With Rails, fast and simple
is the name of the game
The ability to get quick and
positive feedback on your
projects is crucial
A final note: Scaling Rails
Does Rails scale?
You scale a site, not a framework
Does Rails scale?
Can a site built with Rails scale?
Yes
Yes
Some of the most heavily trafficked
sites in the world use Rails
Basecamp
Twitter
Shopify
Yellow Pages
Hulu
LivingSocial
Soundcloud
Zendesk
GitHub
Groupon
Part 3:
How I Taught Myself to
Code in One Month
I find traditional learning
extremely tedious
So do you.
(Otherwise youd have learned how to code by now.)
So I developed my own method
I call brute-force learning
In college I used to download
podcasts of classes I was taking
Then Id listen to the podcasts
on the subway or walking
around the city.
Doing this ended up eliminating
hundreds of hours of studying
(also teachers loved my unique perspectives)
Why does this
work?
Have you ever been confused by something
when it's explained one way but when its
explained a different way it just clicks?
If you were in a room full of smart people,
would you ask the same person to explain
something to you over and over again, or
would you ask lots of people?
The result is that learning is
less tedious
More importantly, the stress of
feeling like you have to
learn something the first time
disappears
Its OKAY to not understand
something the first time
Its OKAY to not understand
something the first time
Isnt that sort of the point?
The first time you learn something,
your mind creates a mental map. A
fuzzy picture of all the pieces and
how they fit together.
When you go back, you relearn
the specifics and it all starts to
make more sense
Just speed through as many
introductory tutorials as possible
Heres what I recommend:
Ruby on Rails Tutorial
by Michael Hartl
When you finish, youll be able to
build your own basic web app
But there will be specific
features you dont know how
to implement
Railscasts by Ryan Bates
At some point along the way, you
may feel a temptation to STOP and
learn Ruby (or HTML or CSS)
At some point along the way, you
may feel a temptation to STOP and
learn Ruby (or HTML or CSS)
Dont.
Ruby is huge
Ruby
Rails
Ruby is huge
And you only need to
know a tiny bit of it
Ruby
Rails
Besides, youll learn all the
Ruby, HTML and CSS you need
to know along the way
After youve finished, check out
these fun resources that cover
basic Ruby:
RubyMonk
Ruby Warrior
RubyKoans
Learn Ruby the Hard Way
Troubleshooting
75% of coding is Googling*
75% of coding is Googling*
*totally made up statistic
Stack Overflow
A lot of times you know what
feature you want to build, but you
dont know what its called
For example: Cron jobs let you
schedule tasks in your app
Ask someone
Rails is very popular at
the moment and has a
LARGE
community for support
The best way to learn is to go to a
Rails meetup and ask someone who
knows more than you
in NYC
NYC.rb
NYC on Rails
New York Ruby Meetup
Ruby Nuby
Go attend some
hackathons
and find teams to work with
To hear about hackathons, sign up
for the following mailing lists:
General Assembly
This Week in NYC Innovation
StartupDigest
Startup Weekend
The list of resources I
cant attest to:
Rails for Zombies
Peepcode
Railscasts
Agile Web
Development with
Rails
Ruby on Rails Guides
Hackety-hack
Teamtreehouse
Code School
Part 4: Coding in a nutshell
Installing Rails sucks
Read Section 1.2 of Ruby on Rails
Tutorial
Or watch this Railcast video
Installing Rails sucks
Read Section 1.2 of Ruby on Rails
Tutorial
Or watch this Railcast video
Installing Rails is now
super easy
This is your rails command center
TextMate
Terminal
Google Chrome
Rails uses a Model View Controller
(MVC) architecture
Controller
View
Model
Database
Rails uses a Model View Controller
(MVC) architecture
Web Pages
View
Rules
Database
Controller
Model
What does it mean?
What does it mean?
What does it mean?
Code is just words and <>%=/@:
Github is where you save versions of your
project files
Heroku lets you deploy your app so that its
live in seconds
The story of
How to Teach
Yourself to Code
Now
on
Thank you.
Mattan Griffel
[email protected]
mattangriffel.com