0% found this document useful (0 votes)
47 views8 pages

The Secret To Learning Code: Reverse Engineering

Learning how to code can be a daunting task for anyone. Reverse engineering is a great way to understand code you've never seen. "Breaking stuff" is a method to see how code works.

Uploaded by

Fiddle Thomas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views8 pages

The Secret To Learning Code: Reverse Engineering

Learning how to code can be a daunting task for anyone. Reverse engineering is a great way to understand code you've never seen. "Breaking stuff" is a method to see how code works.

Uploaded by

Fiddle Thomas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

The Secret to Learning Code - Treehouse Blog

http://blog.teamtreehouse.com/the-secret-to-lea...

Learn

The Secret to Learning Code


Nick Pettit
writes on October 7, 2013

180

44

27

Learning how to code can be a daunting task for


anyone, whether youre a complete beginner or an
experienced professional. Just getting started is
hard enough, but sometimes the best still get
stuck.

Reverse Engineering
If youve never coded before, Treehouse is a great
way to get started. Once you have your footing
and you know a language or two, its easy to
understand code youve never seen by reverse
engineering, or as I like to call it, breaking stuff to
see how it works. This method rarely gets the
1 of 8

Sunday 27 March 2016 12:05 PM

The Secret to Learning Code - Treehouse Blog

http://blog.teamtreehouse.com/the-secret-to-lea...

Home
Subscribe
Free trial

just break anything with reckless abandon and


expect to learn something. You have to take a
methodical approach and break one thing at a
time, then analyze the results of your changes.
When breaking things, you should be looking for
the relationship between parts to understand their
function in the whole.

Learn to Break Stuff


Recently I was forced to do some reverse
engineering in order to advance my own
knowledge. Ive become interested in 3D
programming in the browser, which is a mixture of
well explored territory and new frontiers. Three.js is
an abstraction for a much more complex language
called WebGL, and while three.js is useful enough
to be worth using, its also poorly documented.
How do you learn code without an instruction
manual? Reverse engineering is the only way. The
following is a code example that uses three.js to
create a light:
var light = new THREE.PointLight(0xffffff);
light.position.set(-100,200,100);
scene.add(light);

If you have some programming experience, you


2 of 8

Sunday 27 March 2016 12:05 PM

The Secret to Learning Code - Treehouse Blog

http://blog.teamtreehouse.com/the-secret-to-lea...

Home
Subscribe
Free trial
assumptions.
3. Change variables and function arguments to see if
you can manipulate them in a way that matches your
mental model.
4. Swap the order of various lines to see if things can
be done out of order or if theres some
significance to the sequence of operations.

As you test each line, youll start to build a mental


model and make corrections to other assumptions
you made previously. Soon, the whole picture will
start to make sense. Using the techniques on this
example, we might discover that we can change
the position of the light by reseting the XYZ
coordinates, and that each line is necessary in
order for the whole thing to work. Another tip to
get going more quickly is to use contextual clues,
as many languages are quite similar. In the
example, a hexadecimal value is used when
creating the light. If youve ever coded in CSS,
youll probably recognize this as a color value, even
though the formatting is a bit different.
Reverse engineering isnt the only way to learn and
it should always be backed by more formal
material whenever its available. In fact, I would
argue that tutorials become more valuable once
you have some of the context mapped for yourself.
3 of 8

Sunday 27 March 2016 12:05 PM

The Secret to Learning Code - Treehouse Blog

http://blog.teamtreehouse.com/the-secret-to-lea...

Home
Subscribe
Free trial

8 Responses to The Secret to


Learning Code
CAYdenberg on October 7, 2013 at 5:04 pm said:
I find the hardest thing about reading code is figuring out
where to start. How do you identify which
functions/classes are the essential core of the program
and which merely support or add features. I suppose
deleting entire functions might help there, too.
Reply

pintobeans on October 8, 2013 at 1:23 am said:


Think in terms of verbs and nouns. Compose
your functionality from those units. Eventually,
group things together into classes that model
your objects.
Reply

pintobeans on October 8, 2013 at 1:21 am said:


Hi what font is that in the code screenie?

4 of 8

Sunday 27 March 2016 12:05 PM

The Secret to Learning Code - Treehouse Blog

http://blog.teamtreehouse.com/the-secret-to-lea...

Home
Subscribe
Free trial

How do we get people to understand programming?


http://worrydream.com/LearnableProgramming/
Reply

adolf witzeling on October 9, 2013 at 10:36 am said:


After many years of print design Ive finally made the jump
to webdesign. At first CSS, PHP, JS & HTML seemed too
much for me to handle. Theres just so much to know. I
started breaking it down into smaller pieces by building
my own website. I started to look around for sites that
employ a feature Id like to have on my site as well
(interactive features etc.). Im taking their code and delete
or add until it does what I want. If I get stuck or need
code, w3schools or codeacademy has helped me a lot to
find the missing pieces or code. My biggest problem was
to understand the basics like classes, ids, selectors and
how they relate to each other or need to be formatted.
But Im getting better every day and it all is starting to
make sense little by little. Still got a long way to go but Im
getting there. I just added your site into my reference
toolbox. The more the merrier.
Reply

5 of 8

Sunday 27 March 2016 12:05 PM

The Secret to Learning Code - Treehouse Blog

http://blog.teamtreehouse.com/the-secret-to-lea...

Home
Subscribe
Free trial

came up, it seems great. Ive added to favourites|added to


my bookmarks.
Reply

Leave a Reply
Name *

Email Address (will not be published) *

Website

Submit Comment

6 of 8

Sunday 27 March 2016 12:05 PM

The Secret to Learning Code - Treehouse Blog

http://blog.teamtreehouse.com/the-secret-to-lea...

Home
Subscribe
Free trial

Get started today with


a free trial and discover
why thousands of
students are choosing
Treehouse to learn
about web
development, design,
and business.

Learn more

7 of 8

Sunday 27 March 2016 12:05 PM

The Secret to Learning Code - Treehouse Blog

http://blog.teamtreehouse.com/the-secret-to-lea...

Home
Subscribe
Free trial

Subscribe

2016 Treehouse Island, Inc.


About Careers Blog Affiliate Program Terms Privacy Press Kit Contact

8 of 8

Sunday 27 March 2016 12:05 PM

You might also like