Ask HN: How can I become a better programmer?

16 points by piratebroadcast ↗ HN
I've been learning Ruby and Rails for about 6 months now. To be honest, I still feel really behind when I see these complex functions on stack overflow. I am willing and able to put as much time and effort into it as I need, so I'm hoping someone would have some advice or words of encouragement. Some people seem to "get it" so much faster.

17 comments

[ 3.0 ms ] story [ 46.3 ms ] thread
Some Ruby specific tips:

Go through the last 2 years of Railscasts videos. (purchase a subscription to get all of them; not sure it's taking new signups right now though)

Sign up for RubyTapas. Five minute videos, 3 times a week, but most of them are ninja tips.

CodeSchool - some of the advanced Ruby courses are challenging, and get into some of the minutiae that you don't see in basic Rails apps.

Build stuff! Not fake apps, but apps that do things. Maybe an app to scrape HN and hit you up on SMS when your favorite authors post. An app to schedule volunteer hours for your church or other favorite organization. Etc. The act of building real apps will force you to learn some of the finer points of the language.

Make those apps open source, then connect them up to Code Climate. (free for OSS) Going through the process of increasing your code's GPA will help you improve.

Read Practical Object Oriented Design in Ruby by Sandi Metz.

I'm a member- They are taking new signups, just billing for the first month and allowing the other months to be for free until he figures out if he is retiring or not. I will begin codeschool tomorrow. Thank you.
Yeah, I'm a Railscasts member too, and know he extended existing members, but was too lazy to look up what that meant for new subs :-)
The cold reality is that some people do "get it" faster. Programming is a prime example of activities that reward highly intelligent people.

But I think programming is fair. It's fair in a sense that if you work hard, there will be a notable return of becoming a better programmer. Read more code and write more code. You will get better.

Let me guess: you consider yourself a highly intelligent person.
No, I am average.
There are a bunch of books that will help with all programming: - Code Complete (Steve McConnell) - Pragmatic Programmer - Software Craftsmanship by Robert Martin - Test-driven design by Kent Beck

But the way I have always learned most is working alongside people who were smarter than I am, with more experience, and enough patience to explain stuff that wasn't obvious. If that's not easy in the real world, try contributing to an open source project.

Build something hard.

Toy apps teach you how to use libraries and google error messages. Building something will force you to spend time thinking about how not to code yourself into a corner, how to structure your app and how to be efficient. It will also give you an outlet to put all the things you lean in books/railscast etc into practice.

- are there meetups around you or remote pair programming? If not, start something. Doesn't have to be more than a few people in a coffee shop. The railsbridge curriculum is really well done: http://workshops.railsbridge.org/

- tooling: learn heroku, github/git, unit and functional /integration tests, capistrano, Firebug/chrome dev tools, selenium/watir etc (etc could include continuous integration/deploy libs,

http://pragprog.com/book/pg_git/pragmatic-guide-to-git

http://guides.rubyonrails.org/testing.html

- learn a couple editors. e.g for scala/java/clojure, I think people should learn one of emacs/vim and IntelliJ.

- the db/serialization/search trilogy: learn JSON, XML (just to read XML, pretty important in javaland), a relational database, a nonSQL, and a fulltext indexing lib e.g. sphinx or elastic. Look at protobufs, avro also

- learn linux setup/tuning pretty thoroughly (inital setup with ssh, iptables, postgres, etc), basic monitoring tools, and the stuff that heroku or digital ocean or linode provide.

Probably all the suggestions here are valid. I'll just add that my programming improved a lot by working at a place that did code reviews and had really good senior programmers.
You may just be trying to learn too much too fast. Set small goals for a side project and focus only on that, without getting distracted. Like anything else, you gotta put the time in, but if you don't "genuinely love it" you are frankly doomed. Software development is simply too hard to do unless you love it. Remember the fun is in the challenges too, so never get discouraged. You have to enjoy the challenges and enjoy the journey (which means lots of confusion until you finally get it). But it should be fun the whole time, or else "you're doing it wrong!" LOL.
Read this https://code.google.com/p/tokland/wiki/RubyFunctionalProgram... and master it by refactoring some of the source code that you work on. Also follow up the references to work by Joe Armstrong and Rich Hickey. If there is anything there that is unclear, then google for pages that explain it in a non-Ruby context.

And read everything written by Uncle Bob starting with his books "Clean Code and "Clean Coder". He has a lot of blog articles out there as well as various conference videos. And he is also a Ruby developer in addition to C++ and Java.

Learn and apply the SOLID principles http://blog.rubybestpractices.com/posts/gregory/055-issue-23... and maybe read some more of those Ruby Best Practices articles.

Don't let the speed freaks drive you. Many of them are writing bad code fast. It is better to write clean maintainable code at a slower rate than it is to rush into things and create a complex unmaintainable mess. It is possible that some of the complex code that you have difficulty with is actually bad code and not something to emulate in your practice.

P.S. focus on learning Ruby not on Rails. Ruby is the basis for Rails but Rails is not the only Ruby game in town. Someday Rails will fade away but Ruby will still be going strong with new frameworks like Sinatra or Celluloid or Cramp.

The online tutorials are good, but I'd suggest finding some local events that other Rails devs are attending and network.

You can learn a lot from these people just by showing up and expressing a desire to learn.