Forum: Ruby Areal noob question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
75216a60e6b8807b2cfa7f97d3678936?d=identicon&s=25 Ryan and Kate Huff (Guest)
on 2006-03-26 19:06
(Received via mailing list)
Can Ruby run without rails?

Do I have to have Ruby gems or is there other ways of using
packages/extensions?


I read the parts of the manual that I thought would explain such but to
me,
the manual takes an "assumed knowledge" POV when it come to explaining
the
details of "what" rails is, why you do/donot need it and the same for
gems.
1fba4539b6cafe2e60a2916fa184fc2f?d=identicon&s=25 unknown (Guest)
on 2006-03-26 19:12
(Received via mailing list)
Hi --

On Mon, 27 Mar 2006, Ryan and Kate Huff wrote:

> Can Ruby run without rails?

Yes: Ruby is a general-purpose programming language.  Rails is a
framework (a suite of programs and programming libraries) written in
Ruby.  Ruby was around and in regular use for about 11 years before
Rails was written.

> Do I have to have Ruby gems or is there other ways of using
> packages/extensions?

It all depends what the package's author (or some third party)
prepares and releases.  Gem format is very popular; you'll also find a
lot of things released as plain tar.gz or .zip files, and there's also
another package-manager in/for Ruby called rpa-base.


David

--
David A. Black (dblack@wobblini.net)
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

"Ruby for Rails" chapters now available
from Manning Early Access Program! http://www.manning.com/books/black
75216a60e6b8807b2cfa7f97d3678936?d=identicon&s=25 Ryan and Kate Huff (Guest)
on 2006-03-26 19:27
(Received via mailing list)
Thank you very much for your insight.  As far as language maturity goes,
Ruby is technically older than PHP if you count it's Japanese heritage.
I
truly love PHP and I REALLY love Java.  Maintaining code in them are
nightmares though.  That's what sparked my interest about Ruby and it's
"less is more" approach to syntax. I still have my reservations because
sometimes complex syntax is the better way to go.  I'll have to see it
for
myself when I throw down some Ruby code and try to "break it".

Ruby is yet to offer the more advance features as JAVA or PHP in my
opinion
but it has the basics covered and now is the time to strike with Ruby in
my
opinion, and ride the wave to the 2nd and 3rd versions.

How are the core's version upgrades handled?  Just stop Apache &
cut/paste
the new runtime files in the Ruby folder - similar to a PHP upgrade I
guess?
5c841628b56df3a68984986e9f095d01?d=identicon&s=25 Andrew Johnson (andrew)
on 2006-03-26 19:45
(Received via mailing list)
On Mon, 27 Mar 2006 02:12:35 +0900, dblack@wobblini.net
<dblack@wobblini.net> wrote:

[snip]
> lot of things released as plain tar.gz or .zip files, and there's also
> another package-manager in/for Ruby called rpa-base.

Too bad rpa doesn't appear to have seen any action since 2004, I rather
liked it as a package/repository/installation system.

andrew
1fba4539b6cafe2e60a2916fa184fc2f?d=identicon&s=25 unknown (Guest)
on 2006-03-26 19:54
(Received via mailing list)
Hi --

On Mon, 27 Mar 2006, Ryan and Kate Huff wrote:

> Thank you very much for your insight.  As far as language maturity goes,
> Ruby is technically older than PHP if you count it's Japanese heritage.

There's no "if about it :-)  Ruby didn't become real when it started
to be popular outside Japan; it was utterly real already.  I saw with
my own eyes, in the Fall of 2002, twenty-three books about Ruby in
Japanese: three on CGI programming, at least one "Learn to Program"
book that used Ruby, and so forth.  Those years are not the
pre-history of Ruby; they're the history of Ruby.

> I truly love PHP and I REALLY love Java.  Maintaining code in them
> are nightmares though.  That's what sparked my interest about Ruby
> and it's "less is more" approach to syntax. I still have my
> reservations because sometimes complex syntax is the better way to
> go.

All else being equal? :-)

> I'll have to see it for
> myself when I throw down some Ruby code and try to "break it".
>
> Ruby is yet to offer the more advance features as JAVA or PHP in my opinion
> but it has the basics covered and now is the time to strike with Ruby in my
> opinion, and ride the wave to the 2nd and 3rd versions.
>
> How are the core's version upgrades handled?  Just stop Apache & cut/paste
> the new runtime files in the Ruby folder - similar to a PHP upgrade I guess?

Apache isn't directly involved, unless you're running CGI stuff and
using Apache, but basically you can upgrade either from the source
code or from a platform-specific package.


David

> On Mon, 27 Mar 2006, Ryan and Kate Huff wrote:
>
> Ruby Power and Light, LLC (http://www.rubypowerandlight.com)
>
> "Ruby for Rails" chapters now available
> from Manning Early Access Program! http://www.manning.com/books/black
>
>
>

--
David A. Black (dblack@wobblini.net)
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

"Ruby for Rails" chapters now available
from Manning Early Access Program! http://www.manning.com/books/black
Bc6d88907ce09158581fbb9b469a35a3?d=identicon&s=25 James Britt (Guest)
on 2006-03-26 20:10
(Received via mailing list)
Ryan and Kate Huff wrote:
> Thank you very much for your insight.  As far as language maturity goes,
> Ruby is technically older than PHP if you count it's Japanese heritage.  I
> truly love PHP and I REALLY love Java.

Could you summarize what you love about PHP and Java?


>
> Ruby is yet to offer the more advance features as JAVA or PHP in my opinion
> but it has the basics covered and now is the time to strike with Ruby in my
> opinion, and ride the wave to the 2nd and 3rd versions.

What are the advanced features you believe Ruby lacks?

(Seriously.  I'm not trolling or asking for a flame war; I'm genuinely
curious how different people perceive and evaluate programming
languages.)

--
James Britt

"A principle or axiom is of no value without the rules for applying it."
   - Len Bullard
75216a60e6b8807b2cfa7f97d3678936?d=identicon&s=25 Ryan and Kate Huff (Guest)
on 2006-03-26 20:33
(Received via mailing list)
Well PHP is a "try to be OO" language, it's not nearly true OO.  JAVA on
the
otherhand is really close to OO.

With PHP I love the languages ability to transition from low to high
level
machine access and it's interpopularity. PHP has a wide lib for
low-level
methods and classes ( file/folder .... etc ).  The biggest "need to
have"
item with PHP is it's localhost operations.  PHP is truly meant for a
web
server.  It functions well within a LAN/Intranet but doesn't deal with
network resources like JAVA does, not even close.

JAVA has to be all about networking, for me anyhow.  It is a super-fast
language (compared to PHP), primarily because it's compiled and not
interpreted.  I'm not as much of a fan of JAVA as I am PHP when it comes
to
a web server due to "politics".

By "politics" I mean everything legal between Billy G. & Sun.  All that
hogwash rendered JAVA a bit clumsy for the end-user becasue of ....
"Would
you like to download this ActiveX Component".  There are a lot of users
that
don't "get that" part.  So as a JAVA programmer you can make these
really
insane web apps but unless the user says, "yes" to the IE prompt
(85%-89% of
surf happens in IE still) it's all pointless and results in alot of
helpdesk
tickets.

If JAVA applets and .OCX files worked seamlessly in the browser, I
wouldn't
be in this thread to tell you the truth.

I guess I'm a lost programmer, I want everything PHP & JAVA wrapped into
1
seamless package (and can work well with MSSQL, MySQL, PostGres, DB2,
...
etc).  I don't know that I'll ever find it but we'll see where Ruby
rates on
my "usable-o-meter".
Bc6d88907ce09158581fbb9b469a35a3?d=identicon&s=25 James Britt (Guest)
on 2006-03-26 21:03
(Received via mailing list)
Ryan and Kate Huff wrote:
> Well PHP is a "try to be OO" language, it's not nearly true OO.  JAVA on the
> otherhand is really close to OO.

Does Ruby's "hardcore" OO suit you?  Ruby is far more OO than either PHP
or Java.

 > ...
> be in this thread to tell you the truth.
>

Interesting.  About all I can say is that we're miles apart on how we
each prefer to build Web applications.

For what it's worth, there are a number of Web development frameworks
for Ruby, some of which include very good support for DTHML/AJAX
client-side widgets; you might want to take a look at Nitro and Rails.

I don't know if you think modern JavaScript (i.e., DOM scripting +
XMLHttpRequest) can replace applets and OCX controls, but it's worth
considering.



--
James Britt

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - The Journal By & For Rubyists
http://www.rubystuff.com      - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com     - Playing with Better Toys
http://www.30secondrule.com   - Building Better Tools
75216a60e6b8807b2cfa7f97d3678936?d=identicon&s=25 Ryan and Kate Huff (Guest)
on 2006-03-26 21:21
(Received via mailing list)
It sure does, working with objects is so much easier than dealing with a
butt load of functions.  That among the "less is more" approach to
syntax is
what has sparked my interest in Ruby.  I am hesitant about undergoing a
"standards conversion" on my employers web server(s) that I maintain
because
I fear that I'll hit a brick wall in Ruby when trying to convert some of
the
applications.

It's just a matter of playing and testing ....
2007c0c37cb176dc3d601cf5724fea54?d=identicon&s=25 David Ishmael (Guest)
on 2006-03-27 14:59
(Received via mailing list)
>Well PHP is a "try to be OO" language; it's not nearly true OO

Have you seen PHP v5: http://us3.php.net/zend-engine-2.php

-Dave
2007c0c37cb176dc3d601cf5724fea54?d=identicon&s=25 David Ishmael (Guest)
on 2006-03-27 15:24
(Received via mailing list)
>> Thank you very much for your insight.  As far as language maturity goes,
>> Ruby is technically older than PHP if you count it's Japanese heritage.
>> I truly love PHP and I REALLY love Java.
>
>Could you summarize what you love about PHP and Java?

I'm still learning Ruby (so don't flame me too hard here), but some of
the
programming paradigms I've grown accustomed to such as inline scope
declarations and type hinting are missed (at least by me).

protected foo( SomeObject o ) { ... }

In that one line I can tell you that the method is protected and
requires
SomeObject to be passed to it.  Versus Ruby's:

protected

def foo( o )
    ...
end

My issue here is that the 'protected' declaration might not occur
anywhere
near the method which means I either have to scan up the class file
looking
for that declaration or use reflection on the class.  This is one of
those
"less is more" view points where its nicer to declare protected once and
anything after it assumes that scope, yet I find it obscure since it
might
be distant from a method I'm interested in.  I'm also not sure what 'o'
is
supposed to be.  Should that be a String, Fixnum, or maybe a custom
Object
(I guess I could inspect the method code to help identify what 'o' is)?


-Dave
10d4acbfdaccb4eee687a428ca00a5d8?d=identicon&s=25 Jim Weirich (weirich)
on 2006-03-27 15:51
David Ishmael wrote:
> I'm still learning Ruby (so don't flame me too hard here), but some of
> the
> programming paradigms I've grown accustomed to such as inline scope
> declarations and type hinting are missed (at least by me).
>
> protected foo( SomeObject o ) { ... }
>
> In that one line I can tell you that the method is protected and
> requires
> SomeObject to be passed to it.  Versus Ruby's:
>
> protected
>
> def foo( o )
>     ...
> end

Can't help much with the protected issue, but

  def foo(some_object)
  end

Tells you what foo expects as an argument.

--
-- Jim Weirich
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2006-03-27 15:59
(Received via mailing list)
On Mar 27, 2006, at 7:52 AM, Jim Weirich wrote:

>> requires
>> SomeObject to be passed to it.  Versus Ruby's:
>>
>> protected
>>
>> def foo( o )
>>     ...
>> end
>
> Can't help much with the protected issue, but

Sure we can!  ;)  Use the other protected method declaration syntax:

def foo...

def bar...

protected :foo, :bar

Hope that helps.

James Edward Gray II
2007c0c37cb176dc3d601cf5724fea54?d=identicon&s=25 David Ishmael (Guest)
on 2006-03-27 16:12
(Received via mailing list)
I didn't know you could do that (seems I learn something new about Ruby
everyday)!  That's pretty handy, however to be useful it should be at
the
top of the class versus at the bottom (after the methods are declared).
The
following generates an error ...

class Test
  protected :foo

  def foo
  end

end

>ruby Test.rb
Test.rb:2:in `protected': undefined method `foo' for class `Test'
(NameError)
        from Test.rb:2

I understand why I get the error (I'm declaring a method before it's
seen)
but logically, the scope declaration should appear (IMO) at the top of
the
class along with class properties and attr_* statements.  Why can I
declare
an attribute readable/writeable/both before it's declared but not
methods?
It seems like the interpreter should peek ahead for methods too.
*shrug*

-Dave
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2006-03-27 16:25
(Received via mailing list)
On Mar 27, 2006, at 8:12 AM, David Ishmael wrote:

> Why can I declare an attribute readable/writeable/both before it's
> declared but not methods?
> It seems like the interpreter should peek ahead for methods too.
> *shrug*

Using one of the attr* methods just declares a new method or two for
you (as a shortcut).  No peeking ahead is involved.

James Edward Gray II
A402df36168b81b31c17adcbb5ae8cf4?d=identicon&s=25 Pistos Christou (pistos)
on 2006-03-27 19:16
Jim Weirich wrote:
>> def foo( o )
>>     ...
>> end
>
> Can't help much with the protected issue, but
>
>   def foo(some_object)
>   end
>
> Tells you what foo expects as an argument.

We must next ask: Do we care what the
class/type/race/gender/religion/political-inclination of some_object is?

def foo( some_object )
  # All I care about is...
  if some_object.respond_to? do_some_job
    some_object.do_some_job
  end
end

David Ishmael: It looks like you might still have some grime stuck to
your clothes from previous languages.  :)  I've been doing Ruby now for
about 4 years, coming from a Java background, and type declarations like
you pointed out are one thing I just don't miss, nor found the need for
in Ruby...
This topic is locked and can not be replied to.