Ruby/Statements

From Meshplex

Jump to: navigation, search
Image:Ruby_on_rails_tutorials.jpg
Ruby for complete beginners
Ruby Introduction
What can I use RoR for?
Reasons for choosing RoR over other popular programming languages such as php or asp.net .What makes Ruby so much more special
Where can I find RoR? In what “forms” does it come?
How to install RoR.Solutions for both the novice and professional programmers on Windows,Mac OS X and Linux.Prerequisites.
Ruby programming tutorials for beginners:
Ruby Basics
Ruby Variables, Datatypes, Operators
Ruby Symbols
Ruby Statements
Ruby Converting data to another type: type conversion or typecasting
Ruby Arrays, Hashes, Ranges
Ruby Functions and built in functions
Ruby Control structures
Ruby Regular expressions and blocks
Ruby Loops
Ruby Recursion
Ruby Data Structures
Ruby Methods, Classes, Modules, Namespaces
Ruby Exceptions
Ruby Object Oriented Programming
Ruby Multithreading
Ruby File Handling.Input and Output
Ruby Basic GUI
Ruby and databases.Ruby on Rails and MySQL
Ruby Basic CGI.Using fastCGI
Ruby Basic Networking and web programming
Ruby Basic Graphics
Ajax and Rails.Web 2.0 and what it means
Ruby Testing, Debugging, Automation of tasks
Ruby Apache,Capistrano, Mongrel,lighttpd – reviews and tips
Finding a Ruby on Rails ready web hosting company
BONUS: mini tutorial for a simple RoR application

[edit] Ruby Statements

Generalized, a Ruby statement is each and every instruction you write. For example, this:

x="i'm a statement"

or this:

if (x!=1) 
    y="wrong"

are statements of some sort.

A statement is more of a general programming term not necessarily with a specific format in Ruby.It is true that,unlike C++ for example, you don't need to end each line with a ; sign or the fact that if..else or other conditional instructions might be written in a slightly different way that in other programming languages.

In a more restrictive meaning ("by the book," so to speak), a statement is an instruction that does not return a value. I've met a lot of people that no longer make this distinction though; probably for the wrong reasons. If you were to consider this definition, the second code example I gave would no longer represent a statement, but a larger piece of code.

There isn't much to say about statements in Ruby in particular, you will most likely pick up everything there is to know about them just by following through the tutorial.Check this article to read more about statements.


Previous Next