
Learning to Code: Lessons from building a simple Rails app with Treehouse - jasonshen
http://www.jasonshen.com/2013/learning-to-code-lessons-from-building-a-rails-app-with-treehouse/?hn
======
doktrin
If you check out the Devise documentation, you'll notice it recommends hand-
rolling your own authentication first. This is, IMO, a wise approach -
especially if you plan to eventually deploy an app in the wild.

To piggyback on that, I personally think Rails is a poor intro to programming
- even web development. What it provides in terms of early results is often at
the cost of understanding what it does and why.

~~~
jasonshen
Hey doktrin - thanks for sharing your perspective! I did see that notice on
Devise's documentation. I think Hartl's Rails Tutorial will go through a more
basic user auth process.

If you think Rails is a poor first choice - what's your recommended language
and why?

~~~
doktrin
> _If you think Rails is a poor first choice - what's your recommended
> language and why?_

At the risk of being a little pedantic, I think Ruby is a great choice (Rails
being a web framework). Sinatra is much more lightweight Ruby framework that I
personally think is more appropriate when starting out. It offers far fewer
abstractions (or, "magic") and is a radically simpler beast. To put some
numbers on that assertion, the codebase itself is less than 1/100th the size
of Rails.

If working with a different language, I recommend starting with some similar
level of abstraction. Sinatra-esque frameworks typically offer enough
functionality to make development fun while not obfuscating too much of the
logic. Spark (Java) is Sinatra inspired. While I've never seriously developed
in Python, web.py has been on my to-use list for quite some time.

~~~
jasonshen
No worries - you're right, I should have said framework. Will look into
Sinatra!

~~~
scottmagdalein
Hey Jason, I'm a learner just like you and have only been working with Ruby
for about 8 months. I'm a Treehouse customer and mix those video courses with
Codecademy for reinforcement.

I started trying to learn Rails at the same time that I was learning Ruby.
That was a bad choice and I gave up after a couple months. When I started back
at it recently, I dove straight into Ruby alone and left the frameworks out of
it. After I felt comfortable enough in Ruby, I added Sinatra and love it.

Rails is powerful, but Sinatra is "just enough" for beginners like us.

------
startupfounder
I have had a very similar experience to Jason learning Ruby on Rails through
Team Treehouse.

I was sick of just being the Hustler for my startups, I raised seed rounds,
but could not get my hands dirty in code. Why I No Get My Act Together?!?!?

I have tried to teach myself to code since 2007. I started my first profitable
web company at age 20 without being able to afford a computer, but had to pay
someone to code it up for me. Why I No Get My Act Together?!?!?

I know that I am not a lead developer or even close, but I am learning the
fundamentals and am able to build my own prototypes without bugging someone to
be my co-founder. Now I can show them even if the prototype is sh*tty (read:
less then great).

I am now going through the Rails Tutorial by Michael Hartl:
<http://ruby.railstutorial.org/> after going through:
[https://teamtreehouse.com/subscribe/plans?referrer=jameshigh...](https://teamtreehouse.com/subscribe/plans?referrer=jameshighsmith)
and have even played around with changing my terminal:
[http://net.tutsplus.com/tutorials/tools-and-tips/how-to-
cust...](http://net.tutsplus.com/tutorials/tools-and-tips/how-to-customize-
your-command-prompt/) played with heroku, github, html, css, js....

I can't wait to go through more: <http://programming-motherfucker.com/> as
well as learn python and django.

So right with you Jason, more non-tech guys should get their act together and
put in the time.

~~~
j_s
Go go gadget self-described hustler, url-shortening only the referral link in
your post. Url shorteners are not healthy for the web and are pointless on
hacker news. Referrals are fine, just be up-front instead of hiding behind a
url shortener.

goo.gl/0BUvL ->
[https://teamtreehouse.com/subscribe/plans?referrer=jameshigh...](https://teamtreehouse.com/subscribe/plans?referrer=jameshighsmith&utm_source=Referral%20Program&utm_medium=url&utm_campaign=Referral%20URL)

~~~
startupfounder
Thanks for pointing this out, it has been changed back.

EDIT: My inner hustler was trying to get out, I put him back in his cage where
he belongs.

------
jimrhoskins
Congrats on deploying your app Jason!

All of the lessons learned in your article are really good ones, particularly
about reading documentation, and even copying code at first. It's something we
struggle with at Treehouse, we want our courses to be as smooth and error free
as possible, but it's a bit disingenuous to portray building an app as
something so smooth.

Developers encounter errors, Google error messages, and dig through docs all
the time. We're trying to integrate some of the bugs we encounter into the
videos, to hopefully shed some insight onto how to troubleshoot when errors
inevitably occur.

~~~
jasonshen
Thanks Jim! I loved having you as a teacher. One suggestion: can you make
cheat sheets for all the code we write in each module? Would be nice to be
able to recreate the app from scratch without watching all the videos.

~~~
jimrhoskins
What a great idea! Thanks!

------
hayksaakian
One note about copying code:

You'll learn syntax much faster if you hand re-type instead of copy pasting
code.

~~~
TDL
I have been writing code for only about 18 months now and re-typing ~85% of
what I see has been incredibly helpful to me. I couldn't agree more with this
point.

------
prezjordan
Congrats, Jason! Looks great.

The thing about Rails, for me at least, is that there's _so much_ to it and it
covers so many different bases that it's really tough to "learn it." For me,
it's been a matter of two years of starting projects, throwing them out, and
starting them again to get where I am - a fairly confident Rails programmer. I
was also fortunate enough to get to work with a rails app for two summers [0]
where my coworkers helped me a ton.

But guides? I don't know, they never really worked for me. It was the hands-on
that I really needed, and it looks like your project with Treehouse is exactly
that.

I'm still looking for the hands-on stuff [1] (shameless plug) to grow as a
developer, since as a student I only have so much time for side projects. I've
found that teaching Rails to others - I recently started an Open Source
Society at my school - also helps immensely.

[0]: <http://www.evidon.com>

[1]: <http://jordanscales.com/resume.pdf>

~~~
jasonshen
Hey Jordan - thanks for sharing your journey! I realize this is the first step
in a long journey and this post is for those people on the other side of the
fence, who may be anxious about even getting started.

Yes, I agree that nothing beats hands on work! Love the hustle.

------
hmart
Quoting Steve Klabink: “Starting Rails today is like starting to watch a soap
opera in the 7th season.” <http://words.steveklabnik.com/rails-has-two-
default-stacks>

~~~
hmart
From the first chapter of Railstutorial : Ruby , gems, rails, git. Bundler,
MVC ... Git Branch,Edit, Commit, Merge, Push. Heroku ... Some of them aren't
easy or intuitive concepts, you need to work really hard. I think rails isn't
beginner friendly anymore, but that isn't entirely bad.

------
hipsters_unite
While this is an interesting case (having done the Treehouse tutorial myself),
I've got to say that you can't beat Michael Hartl's book for a decent intro to
working with Rails.

~~~
sergiotapia
I disagree.

It's good to read bits and pieces here and there, but he deviates too much
into Git, Github, Heroku, Unit Testing, etc.

I want to learn Rails and Ruby. An already hard enough task.

There's no reason to smash my face into so many new concepts at once.

-Source: Myself when I starting out with Rails.

A much better source I found is the book Agile Web Development with Rails from
Pragmatic Programmer Bookshelf:

[http://pragprog.com/book/rails4/agile-web-development-
with-r...](http://pragprog.com/book/rails4/agile-web-development-with-rails)

Starts with dumb, .html.erb files, for static HTML, then slowly builds up on
previous lessons - WITHOUT GOING TOO MUCH OFF TANGENT.

Unit tests, rspec! the second coming! yada yada. I wanted to learn Rails, most
newbie want that as well.

~~~
jasonshen
Hey sergiotapia, thanks for sharing your thoughts! What did you think about
the top review on Amazon to this book? [http://www.amazon.com/Agile-
Development-Rails-Pragmatic-Prog...](http://www.amazon.com/Agile-Development-
Rails-Pragmatic-
Programmers/dp/1934356549/ref=sr_1_1?ie=UTF8&qid=1360106887&sr=8-1&keywords=Agile+Web+Development+with+Rails+%284th+edition%29)

One must work hard to grasp what is being taught. It requires a lot of
motivation, reviewing and double checking. Too much is given at once, in the
wrong order and with little explanation (if any). Too much is left open.
Proper subject matter review for a consistent explanation isn't
available.There is a summary at the end of each chapter, but it is as a
statement of goals "achieved" and not an explanation. I could list many
examples. One can easily get lost following (or trying to follow...) the book.
It can be a real pain.

------
jzig
I've done Hartl, as well as several Code School courses and a couple other
tutorials, yet I still don't feel confident enough in my skills or knowledge
to begin my own project or contribute to an open source one. I feel like
something is missing from these education sites.

~~~
danneu
The part that's missing is the part where you start your own projects so that
you have something to apply the knowledge to. Else you're just reading about
surfing and wondering why you don't feel ready to surf yet. Maybe just one
more surfing book?

You don't need confidence because your projects don't need to leave localhost.
Most don't no matter how experienced you are. They're for your own education.

I have 102 projects in my Code/ directory. I have only 5 repositories on
Github.

------
nsomaru
I wonder how new devs feel about learning Rails now that yaml has been
discovered to be a serious attack vector, and will possibly (probably) be a
source of many security concerns in the future.

~~~
jaredmcateer
I feel much better now. Rails enjoyed that near invincible status long enough
and the other shoe was bound to drop sooner rather than later. Now that we've
got this out of the way, as well as the mass assignment issue of last year,
maintainers will hopefully take POCs and disclosures more seriously in the
future.

