Helpful Information
 
 
Category: Ruby Programming
Ruby. I need help getting started.

Hello folks!

I'm a nub at ruby. I have the book caled Agile Web Development with Rails (2nd Edition) and I pretty much know a half decent amount.

Anywho, what I need to do is create a page that allows people to do these things:

1) Submit content (Logged in)
2) View content (Logged in or noe)
3) Create an account, and be either a finder, or a findee. (Both can submit content)
4) Let the finder be able to find findees based on the location(s) they listed themselves in.

I just need help getting started. Once I'm started I'm sure I can figure out where to go from there.

Thanks a bunch
-Amir

I'm a rubyer, but not a railser, so i've lifted the next chunk off the rails site:

rails path/to/your/new/application
cd path/to/your/new/application
ruby script/server
You're running Ruby on Rails! Follow the instructions on http://0.0.0.0:3000/

You'll need to set up models and controllers then and continue like any other rails application. Try looking at the site
http://www.rubyonrails.com/

I'm a rubyer, but not a railser, so i've lifted the next chunk off the rails site:

rails path/to/your/new/application
cd path/to/your/new/application
ruby script/server
You're running Ruby on Rails! Follow the instructions on http://0.0.0.0:3000/

You'll need to set up models and controllers then and continue like any other rails application. Try looking at the site
http://www.rubyonrails.com/

Thanks, but thats not exactly what I'm looking for. What I need help doing is getting the baseline of code. Like all the files and stuff.

Thanks
-Amir

Follow the docs. I can't just write your code for you, that's not what i'm here to do. I'm here to provide assistance with troubles you're having and point out helpful links.

The tutorial will be enough to get you going.

Just few quick questions. I didn't want to open separate thread just for this.
How is Ruby on Rails used on site? Is it something like Perl (scripting), or Ajax (framework)? Why would someone prefer Ruby over Python/Perl for scripting?
IMHO, Perl is most powerful for that purpose.

it's done as FastCGI typically. Ruby is a wonderful language IMO, that's why people like it. Ajax isn't a framework silly.

But I've heard that Perl is most powerful here. And why do you say that Ruby is wonderful language? Because of syntax, or what?

BTW, I know what Ajax is, but i don't know how to say it in english :D ...

It's flexible and the syntax is alright (i object to the constant 'end', but then python's classes constant 'self' is worse)

eg. you can use lambda expressions (blocks) effectively. Like we can loop through a list and print each item like so:

list.each {|z| puts z}

Because ruby operates solely on return values (unless you use an inplace modifying method), you can do things like this

"my string, hello world".reverse.split().reverse.remove(2).each {|x| puts "and the token is: #{x}"}

or something like that.

"my string, hello world".reverse.split().reverse.remove(2).each {|x| puts "and the token is: #{x}"}
Nice...
Then why most people use perl instead of ruby for scripting? It's not that hard to learn new language.
BTW, I learned PHP&MySQL basics yesterday, and i got book about Joomla! and started reading it. It's amazing what can you do with PHP&MySQL...
And i'll probably need something for scripting sometimes. As i (still) don't know Ruby/Perl, i wanna know which one's best. Perl has excellent string manipulation and regexp, and ruby... i don't know.

Ruby is the better language, perl has CPAN and is installed on more servers.

Essentially, ruby will make more readable code and is more fun to piss around with, perl is usually quicker to develop applications because there's usually a module that does exactly what you need. PHP is also a scripting language fwiw.

I'm still PHP beginner. Is it smart to use other scripting languages? PHP supports OO, Polymorphism, etc...

btw, if i ever need scripting language, i'll try Perl. Good readability isn't important to me. Perl has big community, and lots of modules.
Also, I rarely see someone looking for Ruby programmers. I see that PHP/MySQL/Perl programmer are most wanted. And i'm business oriented :D

I could have sworn you came to this forum claiming .net experience...

PHP is the most wanted IME, perl a touch less so. I'd take php, you will need a good 8 months to properly get to grips with perl (buying a small o'reilly reference has been essential to my perl programming, the syntax is often so tricky that i want to doublecheck it instead of testing and risking it being wrong)

I have much experience with small-medium scaled application developing in C#. I wanted to learn ASP.NET, but my MSSQL died in one accident, and unfortunately, i'm on Dial-up, and my pirate got busted, so i can't get VS2005 from him. (Murphy's laws? :D).

Now i want to learn PHP/MySQL. I'll leave ASP.NET for later.

Which language is best depends on more factors than you or I can imagine. In terms of expressiveness Perl may well be better since it gives you the flexibility to create new (and in theory) cleaner abstractions.

In practice it's very rare for Perl programmer (or most programmers for that matter) to "waste time" on abstraction.

This goes beyond proper code formatting: if you have 10 seeming random operators coming into play no amount of indentation will make it read well!

The typical solution to poor abstraction in programs is to littler the code with comments detailing every little detail, violating the DRY principle. When the code changes slightly and the comments are outdated these comments make your code even more cryptic :(.

(Of course, poor code can be written in any language, but so can good code).


Ruby, which has less potential for expression than Perl, oddly manages to produce cleaner programs in far more cases. This is in part one reason for Ruby's increasing success.

Perl may be more productive for the moment but as more modules become available for Ruby the gap between what you can do quickly in each language is rapidly decreasing; spurred on by the fact that once a module has been written it can be easily maintained, and not just by the person who wrote it.

If I had a penny for every time I've gotten a module from CPAN that didn't work, or was out of date I'd have around 10 pence :).

It sounds low but I done relatively little programming in Perl, so the number of dud modules is actually quite high*. Or at least for what I was doing.


So choosing a language based on the short term productivity gains is just asking for trouble.


This is without going into the relative merits of either language; the benefits of there abstract or concrete syntax or the absence of this or that feature. Both are Very capable and will serve you well so why not learn both?

Perl is the current standard scripting language (especially on *nix) but this is changing slowly. There have been several books pointing at Ruby as the Next big industry programming language.

You may notice that more and more *nix distros are relying on utilities written in other languages like Python, Ruby and even Haskell.


I think, eventually, we'll all get back to writing Lisp ;).

I hope this was helpful,

Mark.


* Most Perl code is messy IME and messy code is hard to maintain so it doesn't get maintained.

Excellent post, Mark :D


Both are Very capable and will serve you well so why not learn both?

Both languages have same purpose. Why should i learn both if I'm gonna use only one? I wanna learn the one which is more powerful, and has good support. When i learn it, i'm gonna use it for everything, and i'll ~master it after some time.

Ruby is similar to Python. It has clean code, and is powerful.
Perl has the best support for regular expressions (very important feature to me).

I'm still not sure which one is better for me... I wanna develop MMORPGs like http://www.darkthrone.com , hattrick , or herowar . I already have few ideas for some MMORPGs.
How can scripting language help me here? I just learned some advanced stuff about PHP. PHP has everything i need for MMORPG. Now i'm confused...

PHP is probably the best solution because it's instaled on just about every linux server out there and it has ideal functions for what you're trying to do. I've yet to come across a shared hosting package with mod_lisp, mod_python is rare to see and even rarer is ruby/fastcgi.

Mark: I'd only write perl like that if it was a 2 minute script i never wanted to touch again. If I was designing something to be used again, i'd take the time to design it properly.

You can always ask web host owner/admin to add support.

I'll just stick to PHP&MySQL for now. Until i need something that PHP isn't capable to do.

You can always ask web host owner/admin to add support.

I'll just stick to PHP&MySQL for now. Until i need something that PHP isn't capable to do. You think a host is going to hook up lisp support for 1 person, creating extra load on his server for everyone else? No.

You can always ask... It doesn't cost you anything. Maybe some other users already requested that, and i'll be the one that will make admin add support. ;)

Excellent post, Mark :D

Both languages have same purpose. Why should i learn both if I'm gonna use only one? I wanna learn the one which is more powerful, and has good support. When i learn it, i'm gonna use it for everything, and i'll ~master it after some time.

Ruby is similar to Python. It has clean code, and is powerful.
Perl has the best support for regular expressions (very important feature to me).

I'm still not sure which one is better for me... I wanna develop MMORPGs like http://www.darkthrone.com , hattrick , or herowar . I already have few ideas for some MMORPGs.
How can scripting language help me here? I just learned some advanced stuff about PHP. PHP has everything i need for MMORPG. Now i'm confused...

To get a better grip on common programming practices? There is some overlap in what you'll learn from both languages but both languages can be used for the same things.

I think that the inclination is to do large application development in languages like Ruby or Python rather than Perl simply because Perl programs tend to be terser and harder to maintain.

Things like OO aren't easily explored in Perl 5, and OO is a major idea in the programming industry as you should know.

Just so you know all three languages have full support for Regular Expressions and text manipulation in general but Ruby and Perl both have them built right into the language :).


PHP is really tied to one domain: writing web application. There has been some attempt to take it into the world of general purpose programming but I think this is very questionable, it just wasn't designed for it!


Finally, learning languages is a skill in itself. If you want to become good at learning new programming languages then you have to learn more than one :cool:.

Take care,

Mark.










privacy (GDPR)