JavaScript/PHP/Ruby = Frustration

I have read tutorials on JavaScript and PHP, and just started reading why's Poignant Guide to Ruby.

I have not, and seemingly cannot, reach my AHA! moment.

I think my problem is that everything I read has way to much theory vs.writing practical code.

I actually was enjoying and understanding the aforementioned book on Ruby, until I realized I was reading and not writing. I fired up Coda2 and started pasting code but couldn't get it to do anything. Realized I had to download Ruby and now have no idea what to do with all of the files in that folder.

Right now, I honestly think I need to learn a server side language. I want to write webpages that have the ability to process forms, utilize databases.

I am humbly asking for any advice, tips, magic spells, or a place to get some fairy dust, that can help me condition my brain to retain this good stuff. I think coding will be fun, once I get an AHA moment.

Ruby works perfectly fine as a server-side language for websites. Many people don't use pure Ruby, though, but one of the web frameworks (the most popular being Ruby on Rails).

So unless you found out that you don't like Ruby, why not stick to it? Of course you could also use PHP. It all depends on your personal preferences.

However, if you haven't written any code yourself until now, I think the first step would be to properly setup Ruby (or PHP) and write a simple "Hallo world" script. If this works, you can go about with setting up a webserver etc.

After the installation, create a text file, name it e. g. "hello.rb" and write the following into it:

Code:

print "Hallo world!"

Go to the console and type

Code:

ruby path\to\your\hello.rb

When you see "Hallo world!" on the screen, you've successfully installed Ruby and written your first script.

The next step would be to integrate Ruby in your Editor/IDE. I don't know how this works with Coda2, because I've little to do with the fancy world of Apple.

By the way, I'm not sure if "the poignant guide to Ruby" is really the best book for learning. I find it much too chatty and rather prefer "The Ruby programming language" by Flanagan and Matsumoto. Many people also recommend "Programming Ruby: The Pragmatic Programmer's Guide" by Thomas.

Hi Jaques1. Thank you for responding. I have written quite a bit of "tutorial code", but I am having a hard time applying it to real world applications. Though, I haven't even gotten to the "Hello World" in Ruby because I just realized I hadn't been coding, only reading. I will definitely read that link on installing Ruby.

As far as why I am reading up on Ruby, I read somewhere on the internet that it is better to learn Ruby before moving on to Ruby on Rails. My goal is to use Ruby on Rails.

Ruby actually looks like it will be fun to program with. If I can get the console up and then integrated into my editor, I think I might have a chance with that one. Hopefully, from what I've read, it will help me with other languages such as JavaScript.

I have written quite a bit of "tutorial code", but I am having a hard time applying it to real world applications. Though, I haven't even gotten to the "Hello World" in Ruby because I just realized I hadn't been coding, only reading. I will definitely read that link on installing Ruby.

Great. Actually, playing around with the language, testing code and debugging it is just as important as theoretical knowledge. This will give you a much deeper understanding of the language (and motivation) than if you just write down theoretical code without ever executing it.

Originally Posted by cozy

As far as why I am reading up on Ruby, I read somewhere on the internet that it is better to learn Ruby before moving on to Ruby on Rails. My goal is to use Ruby on Rails.

I think it's generally a good idea to first learn the actual language before you start with frameworks. From what I've seen, Ruby on Rails is rather complex. So it will probably help you a lot if you have a solid understanding of Ruby basics.

Originally Posted by cozy

Ruby actually looks like it will be fun to program with. If I can get the console up and then integrated into my editor, I think I might have a chance with that one.

Installing Ruby shouldn't be too hard. But I don't know if there's good Ruby support in Coda2. If that's not the case, I'd consider switching to a more mainstream IDE like Eclipse.

Originally Posted by cozy

Hopefully, from what I've read, it will help me with other languages such as JavaScript.

Well, that I don't know. Of course knowing one language will make learning another one easier. But every language is different.

Jacques1, thank you for the response. I thought you would disappear after 1 comment. I'm glad you didn't

I am going to purchase "The Ruby programming language" by Flanagan and Matsumoto, and order "Programming Ruby: The Pragmatic Programmer's Guide" by Thomas from Amazon.

I also will be installing Eclipse.

In your opinion, is there a preference between RoR or PHP? If so, could you give me a short answer as to why? Just so I can justify to myself why learning one instead of the other. Not knowing any language leaves me feeling that I need to learn all languages, which is dumb, but leaves me feeling stuck!