Quicky.

S

skt

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
 
S

skt

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?
 
R

Robert Klemme

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
 
H

Hugh Sasse

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.

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 = 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
 
R

Richard Conroy

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.
 
D

David Vallner

--------------enigBB6F7A9776646E8496966342
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
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--
 
J

James Edward Gray II

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
 
R

Ross Bamford

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top