webdevRefinery Forum: Just Starting Ruby? - webdevRefinery Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

User is online TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 12 March 2011 - 12:26 PM (#1)

Just Starting Ruby?


Start here
This is pretty bad, but just a draft of feel.

What is Ruby?
And why you should use it.

Ruby is an object orientated language. Meaning that almost everything is an object, which is common in higher level languages, but not as common in lower languages. A higher level language generally requires more processing power and RAM then a lower level language doing the same thing, but a higher level language will allow you to develop the application faster. Ruby has many built-in methods, meaning that this execute at a lower level in the system and thus are faster, so use them when you can. I love ruby for some of the basic things, like my functions' names can end with a question mark or exclamation mark. Generally a function with a question mark will return true or false. While a function with an exclamation mark will modify the object.
# a "# =>" is common in ruby to say "this is what the output will be"
hash = {:a => 1, :b => 2}
hash.has_key? :a # => true

string = "hello"
string.capitalize # => Hello
string # => hello
string.capitalize! # => Hello
string # => Hello


I'm not to sure what to cover, so leave a post below on what you would like to see and I'll add it :)
If you want to give ruby a shot, try out http://tryruby.org/ for a 15 minute crash course in ruby designed so even non-programmers can learn.
And if you want to install it on your local machine, check out the official ruby website: http://ruby-lang.org/
Reserved.
1


User is offline TheDevMan 

  • kthnxbai AKA |{7|-||\|xb41
  • Group: Members
  • Posts: 617
  • Joined: 04-April 10
  • LocationIllinois, USA
  • Expertise:Graphics

Posted 12 March 2011 - 01:25 PM (#2)

Also,
http://railsforzombies.org/
Posted ImagePosted ImagePosted Image
If someone has helped you out, or you like their post, click on the Posted Image sign under their reply :)
0


User is offline Koen 

  • Leroy Jenkins
  • Group: Members
  • Posts: 2503
  • Joined: 10-March 10
  • Locationthe Netherlands
  • Expertise:HTML,CSS,Javascript,Graphics

Posted 12 March 2011 - 01:34 PM (#3)

View PostTheDevMan, on 12 March 2011 - 01:25 PM, said:


Rails is not the same as Ruby. The topic's title is "Just starting Ruby?", not "Just starting Rails?"
Please click the + if I helped you!
Twitter: @KoenKlaren

<callumacrae> YOU DID A ROMNEY
0


User is offline Kyek 

  • Founder of wdR
  • Group: Administrators
  • Posts: 5078
  • Joined: 20-February 10
  • LocationPhiladelphia, PA, USA
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 12 March 2011 - 01:40 PM (#4)

These threads aren't as much for teaching the languages as they are to describe what it's for and in what cases you might want to use it over other languages :) It might be good to touch on what Rails is/what it's for, along with maybe Sinatra, and what Ruby is capable of outside of web frameworks. Look at, for example, PHP's and Node.js's for ideas. It's more like a FAQ that tells you a bit about what the language is good at and what you use it for :)
0


User is offline ShanePerreault 

  • Sleep Burns My Eyes
  • Group: Members
  • Posts: 1075
  • Joined: 19-March 10
  • LocationChicago, USA
  • Expertise:PHP,Java,Javascript,Ruby on Rails,SQL

Posted 14 March 2011 - 08:45 PM (#5)

An explanation mark? I believe it's an exclamation mark.

Languages: PHP | JS | Ruby | Rails | C# | Python | Java
0


User is offline danielhep 

  • Group: Members
  • Posts: 94
  • Joined: 19-March 10
  • Expertise:HTML,CSS,Java

Posted 12 December 2011 - 12:55 PM (#6)

What's the difference between Ruby and Ruby on Rails?
Posted Image
Seing Doubles.
0


User is offline Ruku 

  • I do Linux and that Internet thing.
  • Group: Members
  • Posts: 1349
  • Joined: 17-April 10
  • Location/root
  • Expertise:HTML,CSS,PHP,Javascript,Python,SQL

Posted 12 December 2011 - 01:26 PM (#7)

View PostDjH, on 12 December 2011 - 12:55 PM, said:

What's the difference between Ruby and Ruby on Rails?

Ruby is a programming language and interpreter, like PHP. Rails is a web application framework, written in Ruby, a bit like Zend Framework or CakePHP. You can use Ruby for a heck of a lot besides writing web applications, it's just that Rails is popular because it's so freaking awesome.
1


User is offline danielhep 

  • Group: Members
  • Posts: 94
  • Joined: 19-March 10
  • Expertise:HTML,CSS,Java

Posted 13 December 2011 - 12:59 AM (#8)

View PostRuku, on 12 December 2011 - 01:26 PM, said:

Ruby is a programming language and interpreter, like PHP. Rails is a web application framework, written in Ruby, a bit like Zend Framework or CakePHP. You can use Ruby for a heck of a lot besides writing web applications, it's just that Rails is popular because it's so freaking awesome.

Is rails mainly/only for web applications?
Posted Image
Seing Doubles.
0


User is offline Mo3 

  • Brogrammer
  • Group: Moderators
  • Posts: 1950
  • Joined: 21-July 10
  • LocationStuttgart, Germany
  • Expertise:PHP,Java,Javascript,Python,Ruby on Rails,Node.js

Posted 13 December 2011 - 01:06 AM (#9)

View PostDjH, on 13 December 2011 - 12:59 AM, said:

Is rails mainly/only for web applications?


Yes, it's a web framework.

Quote

A person who thinks all the time has nothing to think about except thoughts. So he loses touch with reality, and lives in a world of illusion called the past. Things are not explained by the past, they are explained by what happens right now. That creates the past, and it begins here. That's the birth of responsibility.
0


User is offline Kyek 

  • Founder of wdR
  • Group: Administrators
  • Posts: 5078
  • Joined: 20-February 10
  • LocationPhiladelphia, PA, USA
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 13 December 2011 - 09:34 AM (#10)

One of its really strong suits is in API building, though. So even if you're not building a client-facing website, Rails is still hella useful for creating a webservices interface for your application. REST is particularly easy with Rails, because instead of standard "Controllers" you can set up your controller as a "resource" that handles CRUD requests. Very slick.
0


User is offline Cyril 

  • Group: Members
  • Posts: 2544
  • Joined: 03-August 10
  • Expertise:HTML,CSS,PHP,Javascript,Graphics

Posted 13 December 2011 - 10:08 AM (#11)

View PostKyek, on 13 December 2011 - 09:34 AM, said:

One of its really strong suits is in API building, though. So even if you're not building a client-facing website, Rails is still hella useful for creating a webservices interface for your application. REST is particularly easy with Rails, because instead of standard "Controllers" you can set up your controller as a "resource" that handles CRUD requests. Very slick.


You know what's next on your list of things for Hydrogen then :P

website :: github :: twitter :: dribbble :: forrst
html, css, php, javascript, graphics
0


User is offline Kyek 

  • Founder of wdR
  • Group: Administrators
  • Posts: 5078
  • Joined: 20-February 10
  • LocationPhiladelphia, PA, USA
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 13 December 2011 - 10:45 AM (#12)

View PostCyril, on 13 December 2011 - 10:08 AM, said:

You know what's next on your list of things for Hydrogen then :P

Ha xD. I really need to build something like that in. When I need to quickly put a REST API together, I generally use Node.js + Express, which is funny because Express is more or less a clone of Sinatra. But that would be slick in Hydrogen as well if I could do it without making too many assumptions about the programmer's code.

But back on topic -- woo Rails!
0


User is offline Mo3 

  • Brogrammer
  • Group: Moderators
  • Posts: 1950
  • Joined: 21-July 10
  • LocationStuttgart, Germany
  • Expertise:PHP,Java,Javascript,Python,Ruby on Rails,Node.js

Posted 13 December 2011 - 11:02 AM (#13)

View PostKyek, on 13 December 2011 - 10:45 AM, said:

But back on topic -- woo Rails!


Huh, I didn't know you had a crush on Rails :P If it only performed and scaled as well as Django or PHP..

Quote

A person who thinks all the time has nothing to think about except thoughts. So he loses touch with reality, and lives in a world of illusion called the past. Things are not explained by the past, they are explained by what happens right now. That creates the past, and it begins here. That's the birth of responsibility.
0


User is offline Kyek 

  • Founder of wdR
  • Group: Administrators
  • Posts: 5078
  • Joined: 20-February 10
  • LocationPhiladelphia, PA, USA
  • Expertise:HTML,CSS,PHP,Java,Javascript,Node.js,SQL

Posted 13 December 2011 - 11:11 AM (#14)

Ha -- Rails is a beautiful piece of work, no doubt. I've just not used it yet because my only use cases that would call for it, I can fill with Node.js. Doesn't mean Rails isn't awesome :)
0


User is online TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 13 December 2011 - 11:32 AM (#15)

View PostDjH, on 13 December 2011 - 12:59 AM, said:

Is rails mainly/only for web applications?

Mainly. Only, no. We've used it for internal API for our user system, as Kyek was kind of mentioning before. Benefits were that we could have a nice API that took little to no time to develop and have it be easily accessible to all applications since it wasn't also hosting a website. However, once we have the time we will be coming back and doing it in C++
Reserved.
0


User is offline kwicher 

  • Group: Members
  • Posts: 2
  • Joined: 13-January 12
  • LocationCambridge, UK

Posted 13 January 2012 - 07:41 PM (#16)

If you want to learn basic Ruby programming enroll for a free online course at the rubylearning.com. There are really nice people there. I've learned there and helped in teaching for some time.

MTFBWY

K
0


User is offline Struki 

  • Group: Members
  • Posts: 48
  • Joined: 18-October 11
  • LocationZagreb, Croatia, EU
  • Expertise:HTML,CSS,PHP

Posted 30 January 2012 - 07:03 AM (#17)

Well I have been php developer for some years now, and lately I've have grown some interest in Ruby. So my question is what would I benefit if I decide to learn new language like ruby?
Can php and ruby be used simultaneously in same aplication/website, would that make any sense?
0


User is online TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 30 January 2012 - 08:24 AM (#18)

View PostStruki, on 30 January 2012 - 07:03 AM, said:

Well I have been php developer for some years now, and lately I've have grown some interest in Ruby. So my question is what would I benefit if I decide to learn new language like ruby?
Can php and ruby be used simultaneously in same aplication/website, would that make any sense?

Can they, no and yes, should they, absolutely not :P (unless you have a damn good reason and not because you want to 'diversify')

Benefits, faster development then PHP (vanilla). Framework has built-in test suite. A TON of libraries that are as easy as adding one line to install, example:
gem 'devise'
gives you a user system (that's really customizable). Also I love ruby's method signatures
object.exists? and object.destroy!


I want to try Java soon or C++, miss my static typing.
Reserved.
0


User is offline Struki 

  • Group: Members
  • Posts: 48
  • Joined: 18-October 11
  • LocationZagreb, Croatia, EU
  • Expertise:HTML,CSS,PHP

Posted 30 January 2012 - 09:00 AM (#19)

Can it be run on your apache localhost (mamp,etc) out of the box or do I need some additional tweeks? I've seen some code and scripts in ruby and it seems that it takes some work to get a simple ruby script to run on local host server, something php does by default.
0


User is online TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 30 January 2012 - 12:58 PM (#20)

View PostStruki, on 30 January 2012 - 09:00 AM, said:

Can it be run on your apache localhost (mamp,etc) out of the box or do I need some additional tweeks? I've seen some code and scripts in ruby and it seems that it takes some work to get a simple ruby script to run on local host server, something php does by default.

PHP does not run by default, it's just normally setup. Rails uses webrick by default so you just use
rails s
great for debugging. Hosting is a bit different.
Reserved.
0


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Enter your sign in name and password


Sign in options
  Or sign in with these services