You are on page 1of 5

A concrete approach to learning how to

program
A solid foundation on which more meaningful learning can happen
by Semmy Purewal | @semmypurewal | Comment | March 6, 2014
Share on twitter Share on googleplusoneshare Share on !aceboo" Share on lin"e#in
Comment
$s someone who has pre%iously taught
computer programming !or nearly a #eca#e, &'m o!ten as"e# (uestions that in%ol%e
)what's the best way to go about learning to program computers,* or )what's the best
way to get a so!tware engineering +ob,* or )how can & learn to buil# mobile or web apps,*
Most o! the rea#ers o! this blog ha%e probably !ace# the same (uestion at some point in
their career- .ow #i# you answer it, &'%e seen many #i!!erent responses/ )come up with
an i#ea !or an app an# buil# it,* or )get a computer science #egree,* or )go rea# 0he
1ittle Schemer,* or )+oin an open2source pro+ect that e3cites you,* or )learn 4uby on
4ails-*
0he interesting thing about these responses is that, !or the most part, they can be
classi!ie# into one o! two categories/ top2#own approaches or bottom2up approaches-
0op2#own approaches are in!orme# by the opinion that it's better to be thrown in the
mi##le o! an application or a !ramewor" which encourages the learner to piece together
"nowle#ge in that conte3t- Many boo"s an# online tutorials use an e3plicit top2#own
approach, o!ten starting with the basics o! a popular metho#ology, !ramewor" or
technology- 0he most %isible e3ample o! this are boo"s on 4uby on 4ails 5 they almost
always ine%itably begin with a #escription o! the Mo#el26iew2Controller #esign pattern,
but #e!er the incre#ible number o! non2ob%ious i#eas that ma"e it up 78b+ect28riente#
Programming, !or instance9-
8n the other han#, a bottom2up approach starts with the basics:!un#amentals o!
programming an# then slowly buil#s your "nowle#ge o%er time- &n contrast to top2#own
approaches, bottom2up approaches try to minimi;e the number o! these non2ob%ious
i#eas that the learner has to ta"e !or grante#- <han $ca#emy an# Co#e $ca#emy are
two e3amples o! online sites that use a bottom2up approach to teaching programming-
=or the most part, they completely lea%e out any speci!ic !ramewor" an# !ocus on
!un#amentals o! programming-
1i"ewise, un#ergra#uate computer science #egree programs ostensibly teach using a
bottom2up approach, but the proli!eration o! ob+ects2!irst teaching metho#ologies an# the
>a%a programming language lea# me to classi!y the programming2relate# portion
ma+ority o! these programs as top2#own 7& ha%e much more to say about this, but &'ll
#e!er it !or now9-
$ssuming you agree with me that these are two broa# approaches to learning so!tware
engineering, it's a little easier to classi!y the pros an# cons o! each- =or e3ample,
proponents o! the top2#own approach o!ten cite the !act that it's easier an# (uic"er to get
something meaning!ul up an# running within a couple o! #ays 7or e%en hours9 which, in
turn, moti%ates a person to want to learn more- 0hey argue that learning a !ramewor" or
a speci!ic technology !rom the start ma"e learners more employable more (uic"ly- Critics
counter that it's #i!!icult to un#erstan# an# internali;e top2#own approaches, an# that this
can o!ten o%erwhelm beginners lea#ing them to gi%e up-
Proponents o! bottom2up approaches argue that it's easier to grasp small chun"s o!
"nowle#ge that can then be built upon an# that this approach ten#s to pro%i#e a more
soli# !oun#ation on which more meaning!ul learning can happen- 8pponents woul# say
that most o! the programming e3amples that are share# in a bottom2up !ashion are
contri%e#, an# because o! this beginners will get bore# an# gi%e up-
&n my min#, there are goo# arguments !or an# against both o! these approaches- ?ut my
e3perience has shown me that bottom2up approaches ten# to be better !or the %ast
ma+ority o! beginners, while only a select !ew beginners can easily e3cel at the top2#own
approach- My hunch is that most o! these !ol"s who e3cel at learning %ia top2#own
approaches ha%e some "in# o! prior e3perience with programming, or ha%e some natural
inclination towar#s being a#ept with technology-
So what #oes this mean i! you're a learner, & am o! the opinion that !or most people a
bottom2up approach to learning so!tware #e%elopment is !ar superior to a top2#own
approach #espite the !act that it ta"es a little longer to be able to actually turn your i#eas
into a reality- 0his shoul# not be surprising 5 you can't e3pect to write an incre#ible
no%el in a !oreign language while you're +ust learning the language@
.ow can we turn this into a concrete approach to learning !or beginners, =irst, i! you're
a beginner an# you're e%aluating a tutorial, a boo", a bootcamp, or any other purporte#
metho# o! learning so!tware #e%elopment, the absolute !irst thing you shoul# #o is as" i!
the material !ollows a bottom2up approach or a top2#own approach- $n#, unless that you
ha%e some bac"groun# in computer programming, you shoul# almost always pre!er
bottom2up approaches-
8nce you !in# a soli# learning tool that teaches using a bottom2up approach, what's the
best way to learn, & ha%e a pretty contro%ersial opinion on this/ & thin" it's absolutely
essential that beginners start memori;ing the basics as soon as possible- & thin" that
memori;ation is (uic"ly becoming a lost art2!orm when it comes to higher learning-
Aou'%e probably hear# people spea" o! it #isparagingly 7)#on't memori;e, internali;e*, )&
suc" at memori;ing stu!!*, )& hate tests where & ha%e to regurgitate memori;e# !acts*9-
8n the other han#, when you're in elementary school you're largely !orce# to spen# time
memori;ing your multiplication tables- Bhy, ?ecause your basic multiplication tables are
buil#ing bloc"s o! more complicate# algorithms li"e long #i%ision- 0his isn't much
#i!!erent !rom memori;ing synta3 in a programming language/ the more natural it is !or
you to write an i!2statement or a !or2loop, the easier it is to use those as buil#ing bloc"s
!or more comple3 programs-
&'ll a#mit that memori;ation is not always the best way to learn e%ery topic, but & belie%e
that when +ust starting out with programming it's absolutely essential that you practice it-
Bhy, ?ecause it re#uces !riction, an# i! there's one thing that lea#s to !rustration !or
beginners, it's !riction-
Bith that in min#, here's some concrete a#%ice !or people +ust starting out an# loo"ing to
get into web application #e%elopment- &n !act, &'# go a bit !urther an# say that this is a
goo# plan to get starte# learning any type o! so!tware engineering- 8b%iously, this isn't a
one2si;e !its all plan, but & thin" it's pretty goo# !or the ma+ority o! learners +ust starting
out-
1- 1earn the basics o! a wea"ly2type# language, an# a%oi# languages that !orce or
strongly encourage ob+ect2oriente# programming with classes- Seriously 5 i!
someone mentions )classes* or )inheritance* to you, it's a goo# i#ea to run the other
way- Bhile & agree that these topics are essential to so!tware #e%elopment in
general, & strongly belie%e that they shoul# not be taught to beginners-
&n light o! this, & thin" an i#eal language !or beginners is >a%aScript because 7a9 a >S
interpreter is rea#ily a%ailable in most web2browsers, 7b9 it's not super2opinionate#
about it's ob+ect2oriente# nature, 7c9 it com!ortably a#mits both imperati%e
programming an# basic !unctional programming, an# 7#9 it's wi#ely use# in in#ustry
7yes, e%en outsi#e o! client2si#e web2#e%elopment 5 &'m currently a #e%ice engineer
wor"ing with embe##e# >a%aScript9-
Spea"ing more concretely, &'# recommen# learning how to #o the !ollowing in
>a%aScript, pre!erably in this or#er/
$- learn how to print something out 7console-log9
?- learn how to #eclare an# #e!ine %ariables
C- learn basic arithmetic operations 7inclu#ing the remain#er operator9
C- learn loops 7!ocus on )!or* loops9
D- learn abstracting repeate# co#e as !unctions
=- learn strings an# basic string manipulations using !or loops
E- learn arrays, an# array metho#s !or looping 7!ocus on )!oreach* loops9
.- learn to create an# manipulate ob+ects as aggregate #ata
Memori;e these things an# practice them e%ery #ay by writing a program that #oes
something simple 7=i;;?u;;, !or instance9 !rom memory-
2- 1earn the basics o! Eit, an# learn to use it !rom the comman#2line- 0his means
starting with !our basic Fni3 comman#s !irst 7ls, pw#, m"#ir, c#9- Bhen #oing this,
learn to mentally represent your !ilesystem as a Gtree' 7or a hierarchical structure9-
8nce you'%e mastere# the Hni3 comman#s an# ha%e some practice na%igating your
!ile system !rom the comman# line, learn a !ew basic Eit comman#s- Speci!ically
!ocus on git init, git status, git a## an# git commit9- Practice %isuali;ing the repository
as a simple lin"e# structure o! commits, e%en i! that means #rawing a picture
occasionally-
8nce you'%e memori;e# the basics o! Eit, integrate it into your wor"!low when
learning the !ollowing things-
I- 1earn the basics o! .0M1- ?e able to create a simple .0M1 page !rom memory-
1earn about the C8M an# how to thin" about .0M1 as speci!ying a hierarchical tree
structure- Spen# some time thin"ing about how this relates to the hierarchical mo#el
o! the !ile system that you learne# in the pre%ious step-
4- 1earn CSS selectors an# how they allow you to ;ero2in on certain parts o! the
C8M- 1earn about the relationships between C8M elements- 1earn what it means
!or a C8M element to be a parent or a chil# o! another C8M element- 1earn how this
#i!!ers !rom a #escen#ant or an ancestor relationship- Memori;e selectors that allow
you to select elements %ia these relationships-
J- 1earn >Kuery, an# !ocus primarily on its C8M manipulation abilities 7sure, it's not
necessary anymore with (uerySelect, but it's still wi#ely use# an# 5 (uite !ran"ly 5
it's !un9- 1earn to insert an# remo%e elements !rom the C8M using >Kuery, an#
practice %isuali;ing how this a!!ects the tree structure that's #e!ine# by the C8M-
6- Practice e%ent2han#ling an# C8M manipulation in >Kuery 7e-g- practice ma"ing
manipulating the C8M when a user clic"s on something, or at a speci!ie# time
inter%al9-
L- Practice more with >a%aScript ob+ects, an# thin" about them as %ariable
aggregators- 1earn how they can be use# to represent more comple3 #ata than the
basic >a%aScript #ata types- 1earn how to use an# manipulate these structures-
Fn#erstan# an# #e!ine >S8M an# how it relates to >a%aScript ob+ects-
N- 1earn to pull in >a%aScript ob+ects !rom a !ile using >Kuery's get>S8M !unction-
Fsing similar techni(ues, use a simple >S8MP $P& 7li"e =lic"r's, !or instance9 to
practice using $>$O !or pulling in #ata- Practice inserting an# remo%ing this #ata !rom
the C8M-
$t this stage, buil#ing a simple sli#eshow that cycles through =lic"r images is an
incre#ible pro+ect that will really test your ability to ma"e things happen using all o! the
!un#amentals learne# pre%iously-
& thin" i! you ma"e it this !ar, you'%e mastere# a large number o! essential concepts in
programming an# Computer Science- Speci!ically, you'%e learne# the most essential
elements o! computer programs 7i! an# i!2else statements, loops, %ariables, ob+ects,
!unctions, arrays9 an# you'%e learne# to thin" in terms o! important #ata structures li"e
lin"e# lists 7Eit commits9 an# trees 7the C8M an# your !ile system9- $t this point, you're
#e!initely rea#y to mo%e on to more a#%ance# topics-
Reference : http://radar.oreilly.com/2014/03/a-concrete-approach-to-learning-
how-to-program-for-beginners.html