Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Good tutorials for learning ruby
- - By newbie Date 2010-08-02 02:28
I am trying to learn gosu, but unfortunately I do not know enough ruby to do it. You guys seem to know a lot about programming in ruby, so I was wondering where you learned ruby from. Any replies are appreciated greatly. Thanks, newbie. (That's why I made my name that XD)
Parent - - By jlnr (dev) Date 2010-08-02 03:06
I used the famous Pickaxe Book (http://www.pragprog.com/titles/ruby/programming-ruby), but I think it's not very good nowadays. Like all the programming books I read, it was okay for people who already know another programming language.

If you do not know any programming at all, but you know anyone who does, it's usually the fastest to ask him or her to explain the basics to you. Variables, functions/methods, "if", "while", "class" are similar in most programming languages and the Gosu example programs only use very, very basic Ruby.

I am curious though, does anyone have any experience with this book? http://www.pragprog.com/titles/ltp2/learn-to-program-2nd-edition
I have lots of people ask me how to get into Ruby as a first language, but honestly I don't feel like recommending the Pickaxe.

And then there is http://mislav.uniqpath.com/poignant-guide/ :)
Parent - - By newbie Date 2010-08-02 03:40 Edited 2010-08-02 04:09
Thanks for replying so fast, jlnr.
As for game programming knowlege I first started with XNA, (not a good idea, folks) and I had to learn C# just to use most of the tutorials, but I wanted to dive straight in to game programming, so I ignored C#. So, I spent about 7 months figuring the stupid thing out, then decided to move on to Ruby after I heard how easy it is. So here I am, two days after I decided to change languages.

(EDIT) I don't know any programmers aside from a robotics programmer (I'm 12, give me a break) so getting tutored isn't an option. Oh yeah, I also used reality factory, but that's not a language.
Parent - By jlnr (dev) Date 2010-08-02 07:05
Transferring knowledge between C# and Ruby should be really easy, actually, but sounds like you didn't get good literature on that either :)

I know that getting proper lectures at 12 is hard (got ridiculed for asking, I hope I can crush that guy's company one day). Kind of sad how there is still no really awesome tutorial online. What I did was to get involved into a scriptable game because you can start out by slowly changing existing stuff. Maybe you can get through the source code of some existing games. Some explicitly have scriptable interfaces in the Showcase section.

I also helped teach some programming 101 for years, so if you don't know *any* good book that is a good start into programming in general, I am going to recommend "The Structure and Interpretation of Computer Programs": http://mitpress.mit.edu/sicp/ It certainly makes for a good second book because it explains the functional influences in Ruby (eg. map), but the whole OO idea will be missing.
Parent - By erisdiscord Date 2010-08-06 05:09
Bahaha. I'm not sure if why's (poignant) guide is a good starting point for a new programmer since I already had experience with other languages, but it made me weep tears of joy. What a book! Yeah, I recommend reading it even if you don't need to.

As usual, I am late to the fray. It seems the forum has neglected to inform me of these new postings. :)
Parent - - By RavensKrag Date 2010-08-03 16:47
I have a book called Beginning Ruby: From Novice to Professional.  It's published by Apress, and is quite helpful. 

Also, there's an interactive tutorial of sorts that I believe is linked to on the ruby website.  That is helpful, but it's basically an irb prompt with some help, so you have to do certain sections all at once or it gets messed up.  Still helpful though.
Parent - By newbie Date 2010-08-03 18:34
If it's good I guess I'll buy it after I overcome the debt to my parents. Thanks for suggesting
- By newbie Date 2010-08-02 04:03 Edited 2010-08-02 19:30
The poigant guide seems a little outdated, Ruby doesn't use the print function anymore; it uses puts now. But thanks for showing me anyways, it's hilarious :)

(EDIT) Never mind, just found out you CAN use the print function.
- By AmIMeYet Date 2010-08-02 14:42
I think I got some knowledge from 'RGSS For Dummies' when I was a total scripting noob.
It's actually written for an entirely different ruby game system (RPG Maker's Ruby Game Scripting System, to be precise), but the general ruby principles are written for total beginners so that might still be useful.

1: The Basics # A sort of summary
2: Variables
3: Flow Control
4: Containers and Methods
5: Object Oriented Programming and More
6: Game Programming # Probably a bit too specific
7: Windows for Dummies # Waay too specific

They're really basic and only explain 'half' the facts, but they might be a good stepping stone to understanding this language and the basics of all programming languages.

Just thought I'd share.
- - By newbie Date 2010-08-02 15:39 Edited 2010-08-02 17:27
Thanks again guys :) @jlnr yes, I actually know a lot about programming now,(if loops, for loops and so on) but Ruby seems to be confusing for me right now. Maybe a little practice'll do the trick :) @amimeyet You know, that was the first tutorial I read - but after reading the first chapter I realized it was for rpg maker xp and stopped reading. But if it helped you learn, I'll read it :) BTW, I found this tutorial on the ruby website, called 'from other languages to ruby' and I was wondering if that would be a good tutorial, even though c# isn't in the list. Once again, any help will be greatly appreciated
Parent - - By newbie Date 2010-08-02 19:47
I know this is totally off-topic, but how do I install gems?
Parent - - By jlnr (dev) Date 2010-08-02 20:50
"gem install <name>" in a command prompt in Windows, might need to be prefixed with 'sudo' on other systems.

Also, try to use the tree structure of this board effectively. ;)
Parent - By newbie Date 2010-08-02 23:33
Right, sorry. I couldn't figure out where to put the installation code, and I didn't want to start a new thread. Thanks again for answering :)
Parent - - By kyonides Date 2010-08-03 00:17
There's something you should worry about, don't use too many $global variables as RGSS does. That only makes your game engine use more resources than those you should actually need. RGSS is one of the worst examples of how to deal with such $variables. Many of them (like all those $data_ ones) could have been simple Constants or class or module methods instead.
Parent - By newbie Date 2010-08-03 00:49
Thanks, kyonides :)
Up Topic Gosu / Gosu Exchange / Good tutorials for learning ruby

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill