Why no perl style 'use strict' in ruby.

Discussion in 'Ruby' started by Ben Edwards, Jul 13, 2007.

  1. Ben Edwards

    Ben Edwards Guest

    First let me say I much prefer developing in ruby that perl. Ive been
    developing in both for about three months (maintaining old perl
    scripts and doing new stuff in ruby).

    I am however not totaly sure why ruby does not have something like
    perls 'use strict'. It seems that use strict is safer and can help
    you spot errors qucker. I also have to confess that I prefer strong
    predefined typing for the same reason but understand this may not be
    as OO.

    Peoples thoughts pleas,
    Ben
    --
    Ben Edwards - Bristol, UK
    http://www.flickr.com/photos/41303704@N00/ - have a look at my pics
    If you have a problem emailing me use
    http://www.gurtlush.org.uk/profiles.php?uid=4
    (email address this email is sent from may be defunct)
    Ben Edwards, Jul 13, 2007
    #1
    1. Advertising

  2. Ben Edwards

    Guest

    , Jul 13, 2007
    #2
    1. Advertising

  3. On Jul 13, 2007, at 8:54 AM, Ben Edwards wrote:

    > I am however not totaly sure why ruby does not have something like
    > perls 'use strict'.


    The strict pragma does three things in Perl. Two of the items are to
    forbid the use of symbolic references and "barewords." Ruby doesn't
    support these features, so it's not an issue.

    The other feature of the strict pragma is to avoid creating random
    global variables every time one is mentioned. In Ruby, globals look
    different from other variables (the leading $), so this is not really
    a problem. Local variables need to be assigned to before use, since
    that's Ruby's method of declaration. That solves the same problem
    the strict pragma handles for Perl.

    James Edward Gray II
    James Edward Gray II, Jul 13, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    862
    Mark Rae
    Dec 21, 2006
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,762
    Smokey Grindel
    Dec 2, 2006
  3. Kza
    Replies:
    4
    Views:
    412
    Andrew Koenig
    Mar 3, 2006
  4. Franck
    Replies:
    4
    Views:
    120
    thundergnat
    Jun 15, 2004
  5. Martina

    why is important to use : use strict?

    Martina, Sep 19, 2005, in forum: Perl Misc
    Replies:
    6
    Views:
    94
    J├╝rgen Exner
    Sep 20, 2005
Loading...

Share This Page