Quicky.

Discussion in 'Ruby' started by skt, Nov 9, 2006.

  1. skt

    skt Guest

    Alright, can somebody point me to a guide that doesn't leave me all
    kinds of confused?
    For instance.
    def thingHere(self, params)
    @params = so and so

    I guess I just don't "get it" I mean I do, I'm inches away but there are
    still a ton of hurdles I need to get over, like...thinking correctly for
    instance.

    Somebody please help me. Haha

    --
    skt


    "I sing a song, falling upon deaf ears; unsung."
    skt, Nov 9, 2006
    #1
    1. Advertising

  2. skt

    skt Guest

    Once again, I think you all kindly for your quick response to my "quick"
    question.
    I need to be patient, but for me it's all or nothing. I WANT to learn
    this, but these frustrating little roadblocks are driving me crazy.

    I understand you can define them as self as well?
    example
    def self(username, pass, etc, etc)
    @username = blah
    @pass = blah
    and so forth?
    Vihan Pandey wrote:
    > Hi,
    >
    > Alright, can somebody point me to a guide that doesn't leave me all
    >> kinds of confused?
    >> For instance.
    >> def thingHere(self, params)
    >> @params = so and so

    >
    >
    > i can understand the confusion for somebody trying programming / a new
    > programming language for the first time. There are as Paul very
    > rightly said
    > ``a lot of free, terrific information available to help you learn
    > Ruby" and
    > ``you need to be patient and take it a step at a time".
    >
    > If your question is for an extremely simple(albeit a slightly outdated
    > page)
    > tutorial you can check this out :
    >
    > http://www.math.umd.edu/~dcarrera/ruby/0.3/
    >
    > If you are having specific difficulties on what @some_thing is then
    > please
    > read
    > this :
    >
    > http://www.math.umd.edu/~dcarrera/ruby/0.3/chp_04/classes.html
    >
    > Basic knowledge of simple Object Oriented concepts would help as well.
    >
    > It would be prudent for you try all the examples and the exercises. It
    > requires some time and commitment, but then what doesn't to get things
    > right
    > :)
    >
    > Regards,
    >
    > - vihan
    >



    --
    skt


    "I sing a song, falling upon deaf ears; unsung."
    skt, Nov 9, 2006
    #2
    1. Advertising

  3. On 09.11.2006 08:28, skt wrote:
    > Once again, I think you all kindly for your quick response to my "quick"
    > question.
    > I need to be patient, but for me it's all or nothing. I WANT to learn
    > this, but these frustrating little roadblocks are driving me crazy.
    >
    > I understand you can define them as self as well?


    I do not know whether you can - actually I never bothered to try it out.
    Since "self" is special it is a bad idea to use it for method or
    variable names. My 0.02EUR

    robert
    Robert Klemme, Nov 9, 2006
    #3
  4. skt

    Hugh Sasse Guest

    On Thu, 9 Nov 2006, skt wrote:

    > Once again, I think you all kindly for your quick response to my "quick"
    > question.
    > I need to be patient, but for me it's all or nothing. I WANT to learn this,
    > but these frustrating little roadblocks are driving me crazy.
    >
    > I understand you can define them as self as well?
    > example
    > def self(username, pass, etc, etc)


    You have just defined a method called self. This will confuse
    the heck out of you later: self refers to the current "instance"
    and is often left out in Ruby code. It is an object, not a method.
    Basically, don't do that.

    > > Alright, can somebody point me to a guide that doesn't leave me all
    > > > kinds of confused?
    > > > For instance.
    > > > def thingHere(self, params)


    In Python and some other languages you make the first parameter of a
    method refer to the object. You don't need to do that in Ruby.

    > > > @params = so and so


    @params = params
    would be the Ruby idiom here. Set the "instance variable" value to the
    supplied parameter.

    @params is an "instance variable" -- a variable that lives inside
    each instance. If you read up on Object Orientation you will find
    things about "Has-A" and "Is-A" relationships. An object "Is-A"
    Type (which for Ruby is more than just it's class, because
    individual objects can be modified -- see the stuff on Duck Typing
    when you are ready to know that level of detail.) But in the simple
    cases an Object "Is-A" Whatever-its-class-is. However, an object
    "Has-A" instance variable, or it has more than one.

    My friend's car Is-A Nissan Micra. It Has-A steering wheel, but
    then it Is-A Car, and all Cars have one. (A class is an object and
    it can be substituted for its parent class. A Human Is-A Mammal, etc.)

    Hugh
    Hugh Sasse, Nov 9, 2006
    #4
  5. On 11/9/06, skt <> wrote:
    > Alright, can somebody point me to a guide that doesn't leave me all
    > kinds of confused?


    The Little Book of Ruby:
    http://www.sapphiresteel.com/IMG/pdf/LittleBookOfRuby.pdf

    It explains the complete basics. Assumes little on the part of the
    user. You will quickly exhaust its usefulness, but as a bootstrap
    guide for beginners its invaluable.

    You can then wean yourself onto quick references like this:
    http://www.zenspider.com/Languages/Ruby/QuickRef.html

    And you should have enough foundation level stuff to make your
    own programs, or follow the examples and content in some of
    the main books.
    Richard Conroy, Nov 9, 2006
    #5
  6. --------------enigBB6F7A9776646E8496966342
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable

    skt wrote:
    > Once again, I think you all kindly for your quick response to my "quick=

    "
    > question.
    > I need to be patient, but for me it's all or nothing. I WANT to learn
    > this, but these frustrating little roadblocks are driving me crazy.
    >=20
    > I understand you can define them as self as well?
    > example
    > def self(username, pass, etc, etc)
    > @username =3D blah
    > @pass =3D blah
    > and so forth?


    You're skipping past concepts, trying to get working code without
    actually knowing one bit of what you're doing. Down on the caffeine, and
    maybe tell us what programming experience you have already, if any?

    Things will get much easier if you have some which other people can
    establish analogues to, and if not, there's resources which are targeted
    at first-time programmers that take a different approach than ones aimed
    at people who already know other object-oriented programming languages.

    My guess is that you don't have any experience with OO programming at
    all, and are trying to follow the wrong material.

    Also, dropping code snippets that make no sense and abuse "etc" and
    "blah" isn't really helping anyone.

    David Vallner


    --------------enigBB6F7A9776646E8496966342
    Content-Type: application/pgp-signature; name="signature.asc"
    Content-Description: OpenPGP digital signature
    Content-Disposition: attachment; filename="signature.asc"

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.5 (MingW32)

    iD8DBQFFUxkxy6MhrS8astoRAi5cAJ9IZ5tUrLUBHxVR32KGvl8XVbmcyACeNMAp
    k5OeMvpTwpst2Sl1jDN8S1s=
    =ZIvI
    -----END PGP SIGNATURE-----

    --------------enigBB6F7A9776646E8496966342--
    David Vallner, Nov 9, 2006
    #6
  7. [OT] Constructive Criticism (was Re: Quicky.)

    On Nov 9, 2006, at 6:04 AM, David Vallner wrote:

    > You're skipping past concepts, trying to get working code without
    > actually knowing one bit of what you're doing. Down on the
    > caffeine, and
    > maybe tell us what programming experience you have already, if any?
    >
    > Things will get much easier if you have some which other people can
    > establish analogues to, and if not, there's resources which are
    > targeted
    > at first-time programmers that take a different approach than ones
    > aimed
    > at people who already know other object-oriented programming
    > languages.
    >
    > My guess is that you don't have any experience with OO programming at
    > all, and are trying to follow the wrong material.
    >
    > Also, dropping code snippets that make no sense and abuse "etc" and
    > "blah" isn't really helping anyone.


    I find the abusive tone of this message equally unhelpful. There no
    need for you to answer a question here, if it bothers you.

    James Edward Gray II
    James Edward Gray II, Nov 9, 2006
    #7
  8. skt

    Ross Bamford Guest

    On Thu, 2006-11-09 at 21:04 +0900, David Vallner wrote:

    > Also, dropping code snippets that make no sense and abuse "etc" and
    > "blah" isn't really helping anyone.


    Much like the growing trend of programmers trying to (t/pr)each English.
    Most unhelpful. If you can't read it, skip it, I say.

    --
    Ross Bamford -
    Ross Bamford, Nov 9, 2006
    #8
    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. =?Utf-8?B?anNhbGU=?=

    Session Quicky

    =?Utf-8?B?anNhbGU=?=, Dec 20, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    318
    Hans Kesting
    Dec 20, 2004
  2. trapeze

    need quicky help..

    trapeze, Sep 6, 2007, in forum: C Programming
    Replies:
    5
    Views:
    291
    bismi.kamal
    Sep 17, 2007
  3. Christopher Campbell

    Tuples/Records/Quicky Objects + Read Only Arrays?

    Christopher Campbell, Jan 1, 2006, in forum: Ruby
    Replies:
    6
    Views:
    130
    Christopher Campbell
    Jan 1, 2006
  4. skt

    Another quicky, sorry.

    skt, Nov 9, 2006, in forum: Ruby
    Replies:
    6
    Views:
    82
    spooq
    Nov 9, 2006
  5. Mel

    quicky... form & pop up...

    Mel, Dec 15, 2004, in forum: Javascript
    Replies:
    3
    Views:
    69
Loading...

Share This Page