I really don't think you should advise someone to read "_why's poignant guide to ruby" as an introductory text. The sillyness is very distracting, the humor doesn't suit everyone, it's not very well structured and the information density is quite low. I feel there's a ready chance it will be demotivating. I definitely didn't consider it a decent introduction to Ruby or programming. </heresy>
Much as I love _why's works, you may have a point - I've been reading through http://pine.fm/LearnToProgram/ on the suggestion of a couple commenters on the post, and I'm pretty impressed so far. I'm going to forward it along to the friend whose question spawned the post.
There needs to be more content geared to people who know nothing about programming. Those people have the highest hurdles to jump, as they don't even know what they don't know.
I couldn’t imagine jumping into programming (or even wanting to) without a problem to solve first. That’s the whole point of programming, anyway. If someone wants to learn programming, maybe we could help by directing them towards a problem they’d find interesting.
I don’t think a problem has to be significant to be useful to someone. I just think it’d be ideal to work towards a product (no matter how trivial) that the beginner could feel proud of and actually appreciate how it’s helping them.
Learning programming “for learning’s sake” sounds great, but it also sounds damn hard without goals.
You've got a good point! The post under discussion actually contains a slightly modified version of the email I sent to my friend. The original version had a paragraph toward the end that more specifically tried to show her a few ways that programming could be relevant to her daily life - she's got a job that would particularly benefit from some automation in the form of a few self-rolled Ruby scripts.
I've given a variation of this "how to start programming" email to someone else before, and with that person I made the mistake of not pointing out how programming could be relevant to their daily life; I think that email was significantly less useful as a result, so I'm trying to iterate a little bit.
I have seen the greatest success rates with individuals who want to scratch an itch. Someone who has an idea of something they want to build. This way they relate their problem solving and the solutions they find. For example when they decide that their program needs to write a file, they go and look for information on how to write a file, take it and implement it in their program. Conversely someone who goes through a tutorial of how to write a file does not have the situational reference to call upon to remember that accomplishment. I have found that individuals who learn programming via tutorials general do so through a good deal of repetition.
I have taught two people to program from scratch and I did so with both by finding a project that they wanted to do. One was a character creator for the pen and paper Deadlands and the other was an accounts receivable batch crediting application. Both individuals where self-sufficient in less than a month and where able to search and answer all of their own questions within three.
that's been the most difficult part for me, actually -- finding fun problems that I could work on that aren't completely impossible. I spent a lot of time reading books on Python when I should have just been playing with code.
I learned programming by hacking on other people’s code – manipulating it to fit my needs. Try to find an open source project you can mess with.
I can’t say for sure how much fun this’ll be for you: The next time you think to yourself, “I wish this thing worked like this” or “I wish this thing had this feature”, if it’s open source, just load up the code and start playing with it. Your problem might be easier to solve than you’d think.
Depends on your definition of fun, but I've used text books to give me practice exercises, instead of having to invent problems myself. (It's also a good way to learn a language's way of working, rather than learning how to implement your old thought patterns in a new language.)
Something like SICP has problems that are fairly interesting from a mathematical perspective as well as a coding one. I don't know if there's the equivalent for Python, but it might be worth checking.
Different strokes. I got into programming by goofing off. Sometimes I wonder about all these droids around me and all their silly "problems" they are obsessed with solving.
With my experience, the way I first got into programming was when a friend shows me visual basic many years ago when i was 12. The idea that I could actually "paint" my own application by dragging and dropping buttons, text-fields/etc fascinated me to no end.
It was this fascination of being able to create my own applications that got me stuck into it all. It was never a problem that needed solving.
I started a little blog about trying to learn to code from scratch: http://newbiehacker.wordpress.com/ As that blog post says, it is really difficult finding resources for people who want to learn but really have no programming background whatsoever.
That's a great blog - it's really interesting to see what the code-o-sphere looks like to a newcomer!
I saw that you were having a little trouble dealing with some of the proper-noun Concepts thrown at you in Beginning Ruby, and that you weren't entirely sure where to go next in terms of finding exercises not already in the book.
As far as the Concepts go, it's probably best to approach them all as a bunch of different ways of solving the one main problem in programming: complexity[1]. When you're coding anything longer than ten lines, you're usually tackling a problem that's too big to fit into your head all at once. So, you need to break the problem into a bunch of little chunks. Coders do this by building abstractions.
All an abstraction is is the act of deciding you've got a problem ("I need a way to print the contents of the screen!"), solving that problem (by writing code that grabs whatever's being output to the screen, translates it into something the printer can deal with, and prints it), and then hiding that solution from anyone who has that problem. The key here is that you're hiding the solution, but you do expose an interface - a "print_document" function, say - that allows them to benefit from your hard work without having to think about it[2].
That's really what nearly every programming technique is all about: minimizing complexity. So when you see big scary words like Encapsulation and Polymorphism and Mix-Ins, just remember: they're almost certainly just different ways of minimizing the amount of stuff you have to think about at any point in time, and if they're any good at letting you do that, they're probably worth learning about.
Oh! And as far as finding fun exercises to work on goes: Try writing something that'll automate a chore in your daily life. Say, an automated grocery list, or a "books to read" list, or an apocalypse-detector that checks every five minutes to see if Google's down. You know what they say about the sky and the limit and all that :)
-
[1] “Managing complexity is the most important technical topic in software development. In my view, it’s so important that Software’s Primary Technical Imperative has to be managing complexity" - Steve McConnell, Code Complete
[2] "Civilization advances by extending the number of important operations which we can perform without thinking about them" - Alfred North Whitehead
I'm in the very exact situation like you. I also do not have a programming background and started to learn to program (Ruby) last fall. "Learn to Program" was also my starting point. Like you said in your blog, it is a decent book, but didn't get me very far. Being involved in a Rails project, the ultimate goal is to master Rails in a way that I can work on small features for our project. Right now, I'm kind of cross-reading "Heads First Rails" and "Beginning Ruby". "_why's poignant guide to Ruby" is also on my reading list, but more because of my fascination for _why.
One advice (from beginner to beginner) is to find yourself a good mentor. I've got to know a Rails programmer and he is helping me to get into Rails and giving me advice on good ways to work (using the command line etc) and how to solve problems in Rails.
I've never been able to successfully use Hackety Hack, as back when _why was still actively developing it and I was still on a Windows box, it would always insta-crash on my machine, but it's always sounded like a great idea, and I'm definitely looking forward to 1.0!
As someone who's never really been able to break into coding my biggest problem with most of the learning material is it does not tackle a broader perspective on problem solving. Learning syntax and libraries is easy. Knowing where to apply them and how to architect your program is the really hard part. I'm not sure how you learn that other than experience and for a novice that means countless hours of work before they can produce anything unique and useful.
Unfortunately, that does seem to be the case at this point, although if anyone has any good references for novices, I'd certainly love to see them. So far, the best I've ever seen the situation summed up has been in the top comment on http://news.ycombinator.com/item?id=90782 .
It's the right approach, they teach you the concepts so that you can pick up any language and run with it. It uses Python but it's not about Python, which is a clean language that has a great support system (perhaps the most essential part in learning how to code).
Thanks I'll check both of these links out. I'm designing a little Google Maps based web app that has already had two major architectural changes due to issues I hadn't considered. Before I go forward with it I want to go through these resources and try to get the third iteration right.
HTDP starts off pretty basic, but it's by the same people as SICP (a famous textbook), and if it's anything like that book, it's "surprisingly deep", so don't dismiss it too quickly as "too easy"...
Hopefully it works out pretty well - I haven't heard back from her about it yet what with school and all, but hopefully she'll have some questions in a week or so, and working through them would probably be really educational for both of us.
I think she was probably interested for a couple of reasons.
* First, the house we live in has a strangely high proportion of coders, and so she hears us get really excited in our discussions about programming on a pretty regular basis. I think this is probably one of the main reasons that other people who live in the same house have, in the past, asked me the same question she did.
* Second, she thinks coding seems pretty practical; it comes up in a bunch of fields, so it's probably a pretty useful skill to have.
I think that most of the people I know either have no idea what coding is and see it as a foreign and scary thing, or, like her, they think that it must be pretty useful, and are curious about it. It'd be pretty nice if we were able to convert those in the former camp to be in the latter, but I think that what's even more important than that is that people who are already curious about programming should immediately be made aware of the fact that programming is fun as hell.
Best of luck! Sounds like a pretty good idea, actually - I just grabbed the .pdf for the manuscript of the Python version of the book from http://greenteapress.com/thinkpython/thinkpython.html and sent it off to my Kindle for a rainy day.
Just like everything else, the decision's based on nothing but trade-offs. Here's my analysis.
If you learn PHP:
* You'll be able to see results running in your Web browser a lot quicker
* Your knowledge will be really relevant if you're looking to work on slightly older, more established Web sites like Facebook or Yahoo!, but
* You probably won't learn very good programming practices on your own - PHP has been pretty notorious for this, but maybe this has changed with PHP5, I haven't been keeping up.
If you learn Ruby:
* First you'll have to learn the language, and then you'll basically have to learn a framework like Sinatra or Rails before you'll be able to do awesome Web things
* Your knowledge will be really relevant to most startup-style Web sites begun since 2005 or so (e.g. Yelp, which is written in Python, which is basically sort of like a sister language to Ruby, give or take)
* You'll be much more likely to learn a lot of really good programming practices as you go that will serve you throughout your career.
Having worked with both PHP and Ruby, I'd recommend Ruby, because I think it's easier to learn, it's more fun, and it's a better investment; I'm pretty sure most HNers would agree if given the choice between those two languages, but your sample of respondents is probably pretty biased :)
Thanks for the response. I'd prefer to learn Ruby over PHP but I'm hesitant because it seems like PHP has a larger audience / more documentation that would help me in my quest to create web apps.
Googling for help with errors in PHP would be easier I imagine, seeing as more people know PHP. Also, there are a lot of existing PHP scripts that I could build off of.
PHP has been more dominant in the Web world for a longer period of time, that much is definitely certain, and there's a lot of resources out there already. I think this Google Trends chart captures my impression of the relationship between the two languages, though: http://www.google.com/trends?q=php%2C+ruby&ctab=0&ge...
In addition, although you're definitely right in that there must be much more PHP documentation out there, you're not going to have much difficulty Googling for Ruby errors either - just because there will be fewer results doesn't at all mean that there won't be any. Just like in any other programming language mainstream enough to be considered a good language to learn on, any problem you have in that language will have already been experienced by someone else, and there'll almost definitely be an easily found Google result that'll solve that problem.
If you're really on a quest to create web apps and you'd like to invest in knowledge that'll help you and your webapps grow, I'd really strongly recommend learning Ruby (or Python) over PHP.
edit: on closer examination of that Google Trends chart, it looks like a good chunk of the Ruby results are from non-programming-related hits, but I'd still be willing to bet that the overall trend is the same.
"Your knowledge will be really relevant if you're looking to work on slightly older, more established Web sites like Facebook or Yahoo!"
Many newer sites are using PHP as well. PHP is used on established sites, but that just means that it's a proven concept. I also see many more jobs for php developers than Ruby (I have seen a few startups using ruby).
"You probably won't learn very good programming practices on your own - PHP has been pretty notorious for this, but maybe this has changed with PHP5, I haven't been keeping up."
I suppose this is true. But I think you can pickup good programming practices in any language.
Another reason to learn php is because it uses a C-style syntax, which will make it much easier to transition to other languages like c/c++/javascript/c#/Java.
Ruby uses a syntax all its own that you can pretty much only use in Ruby.
I also don't feel people should be learning a programming language through frameworks. It's like learning how to add and subtract using a calculator.
What beginners need to learn is programming concepts that they can use in any language.
You've definitely got some valid points. I think I may be biased toward Ruby and Python because I like programming in them so much, in addition to the fact that I feel that my knowledge of them directly contributed to the quality and quantity of job offers I received when I was on the market.
My enjoyment of programming in Ruby and Python may have something to do with them both being scripting languages, and having easily-accessible REPLs (for the uninitiated: Read-Eval-Print-Loops, like irb, a program I mention and show example output from in my post). In addition, scripting languages just... feel easier. If you've got Python installed on your computer, go ahead and pop up a terminal if you'd like to follow along:
The real power of Python and Ruby is that I can do awesome stuff without even thinking about it. At all. At least half the time I have a problem, the most I have to do is one Google search to find the built-in library I need.
The point I'm trying to make is that, syntax aside, I feel like Python and Ruby just get out of my way most of the time, so I can focus on solving problems and learning programming concepts I can learn in any language.
So I hear about scripts in web-based contexts, but also in get-repetitive-shit-done-on-my-computer contexts. What's good for that, and what would work on Windows machines?
Well, you've got a few options. Ruby and Python can both meet that get-repetitive-shit-done criterion, but you have to do a little extra work in order to get them install on Windows last I checked (although Ruby offers a one-click installer, which you can download via http://www.ruby-lang.org/en/ ). Your other option would be to google "windows batch file", which is basically Windows' native way to write scripts.
You may have other options, and hopefully someone can correct my misconceptions and fill in the gaps where I didn't mention a good option.
In any case: Ruby (and Python too, as it turns out: http://www.python.org/download/windows/ ) offer installers for Windows and can get repetitive shit done, and are pretty fun to write, so I'd recommend you take a look at either language. I use Python myself.
Good suggestion. A commenter on my post also recommended Chris Pine's "Learn to Program," which lives online at http://pine.fm/LearnToProgram/ - I haven't looked at it in-depth, but it seems like it has potential.