Smallest device to code ruby on?

G

Giles Bowkett

Actually I meant the $ everywhere. That's for globals only. Bad thing.
Ya I kno. But if it wuzn't globals then it wuld "disappear" once the
block ends and then it all wouldn't work.. You DID try to run that, right?

BTW. You still all big on words and no show, no bite. Lets see you code
that better and maybe then I can admit you may have a point.. Or are you
chicken? :p

You were serious about that?

people.each do |person|
person.help(end_poverty)
end

Boom. Done.

First of all **rich** North Americans aren't fat. Rich North Americans
have personal trainers and time to go to the gym. Obesity is inversely
linked to income in the US.

Secondly that's what Ruby looks like. The code you wrote didn't even
look like Ruby. You used ifs and globals all over the place and you
ran an iterator on a string without newlines, which does *nothing*.
Ya I kno. But if it wuzn't globals then it wuld "disappear" once the
block ends and then it all wouldn't work.. You DID try to run that, right?

Thirdly, your spelling is all wrong, and of course I didn't try to run
it, none of your variables were defined. Virtually none of that code
would run. And fourth you really don't ever use globals, ever. You
return values from methods. That's how you prevent stuff from
disappearing. But if you're doing a short one-off script, you can
still just define the variables before the block and you don't have
any disappearing problem to contend with.

Anyway:
BTW. You still all big on words and no show, no bite. Lets see you code
that better and maybe then I can admit you may have a point.. Or are you
chicken? :p

How **old** are you? What are you bothering somebody like me for? This
isn't that kind of list. I think it's past your bedtime.

--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com
 
T

Todd Benson

Giles Bowkett kirjoitti:
Ya I kno. But if it wuzn't globals then it wuld "disappear" once the
block ends and then it all wouldn't work.. You DID try to run that, right?

BTW. You still all big on words and no show, no bite. Lets see you code
that better and maybe then I can admit you may have a point.. Or are you
chicken? :p

Csmr

You can't be serious.

But, if you are, just know that globals show a lack of discipline --
not to mention, lack of elegance -- in programming with ruby. You are
kind of fighting the idea of location and control of scope, which is a
powerful tool ... one which you are throwing away.

The only time I've used globals was to play "golf".

Todd
 
C

Casimir P

Csmr wrote, as a reply to Giles' evilmongering:
You were serious about that?

people.each do |person|
person.help(end_poverty)
end

Boom. Done.

After trying your code, Ruby sayz:
NameError: undefined local variable or method `people' for main:Object
from (irb):1 etc.

Dont look done to me.

Yup. I am serious about that, even if I aint serious about this post. You
better put your funny hat on.

And yanno whats the difference between you an' me? All u are is HOT AIRE!
My code works just fine in IRB or as a standalone ruby script. I have
eleet HRRS scills. Haha!
First of all **rich** North Americans aren't fat.

I never claimed they *all* were, simply hoped that you fatsos would
participate, too ...
Secondly that's what Ruby looks like. The code you wrote didn't even
look like Ruby. You used ifs and globals all over the place and you ran
an iterator on a string without newlines, which does *nothing*.

Well yanno what, Mr. Big Ruby Shot? My code works great and does exactly
what its supposed to do. I stand by my excellent script.

AND btw its readable by people who dont kno inch of RuwBe. Well... sorta.

Unlike you know whose code... *makes annoying chicken sounds*
Thirdly, your spelling is all wrong, and of course I didn't try to run
it, none of your variables were defined. Virtually none of that code
would run.

It runs 100%, interpreted, virtually, on xen or damn compiled.
*neeneenenee-ner*
And fourth you really don't ever use globals, ever.

Watch me. THINK GLOBALLY, ACT LOCALLY.

How **old** are you? What are you bothering somebody like me for? This
isn't that kind of list. I think it's past your bedtime.

Dont try that condescending attitude on me, it wont work on me cowboy. I
aint one of your cartoon foxes. *spits*

You come around talkin all that trash 'bout my code. Still you aint got
nothin' on me and nothin' to show for your big words but an used keyboard.

I'm still waiting for your version of that code bit. Man or mouse? I'm
starting to think that talk about Big J being behind your sofa is just
hot air, too.

And all others' too.

Lets see your best Human Readable "Make A Better World" Ruby-script.
Christmas spirit or Cowboy spirit.. or not. .

After all, its a ruby language group. (yes its a code challenge)

"RichFatNorthAmerican".each do |help|
if ($doingNext = nil || $doingNext = "SurfingForPr0n")
$donation = false
help << $doingNext.replace("Help End Poverty!")
end
end
#Disclaimer: Seems like a nice deal. In reality I have no idea whut it is!
#do stuff
#...
if $donation == true
$doingNext.gsub!("Help", "Aww, relax mang! You already did Help")
else
$doingNext << " Check out http://laptopfoundation.org/participate/ "
end
puts $doingNext
 
T

Todd Benson

Csmr wrote, as a reply to Giles' evilmongering:
Lets see your best Human Readable "Make A Better World" Ruby-script.
Christmas spirit or Cowboy spirit.. or not. .

After all, its a ruby language group. (yes its a code challenge)

There are better ways to ask for help. Dude, just look at rubyquiz
archives or actual code from raa or rubyforge.
"RichFatNorthAmerican".each do |help|
if ($doingNext = nil || $doingNext = "SurfingForPr0n")

BTW, this ^^^^^ if condition will always be true
$donation = false
help << $doingNext.replace("Help End Poverty!")
end
end
#Disclaimer: Seems like a nice deal. In reality I have no idea whut it is!
#do stuff
#...
if $donation == true
$doingNext.gsub!("Help", "Aww, relax mang! You already did Help")
else
$doingNext << " Check out http://laptopfoundation.org/participate/ "
end
puts $doingNext

I do like some of the art on your site. The actual art, though,
shouldn't be copyrighted -- I have a pretty cool book called something
like "Mathographics" that has a lot of the same stuff.

I do like the look of your website (no sarcasm there).

Todd
 
M

Matt Todd

Casimir Pohjanraito
I do like some of the art on your site. The actual art, though,
shouldn't be copyrighted -- I have a pretty cool book called something
like "Mathographics" that has a lot of the same stuff.

I do like the look of your website (no sarcasm there).

This is OT, but I agree, I like some of the artwork on there.

Perhaps we can have a Rubyquiz to create visuals like that that have
distinct meanings, much like one tool I saw on the web ages ago that
analyzed the structures of websites' HTML and produced visual
node-trees that represented each node on the DOM and colorized
depending on the type of node/content.

Would be fun to make something like that to graph LoC or whatever
other metrics could be visualized.

Thoughts?
 
C

Casimir

Todd Benson kirjoitti:
There are better ways to ask for help. Dude, just look at rubyquiz
archives or actual code from raa or rubyforge.
I am not asking for help. I already get paid to ruby.

I am just trying to find and explore new ways to approach and code ruby.

Lol plus Giles said my script sucked, which it didnt, hence the
challenge. Now whether there are there any rubyists worthy of the
challenge still remains to be seen. So far none.
BTW, this ^^^^^ if condition will always be true
Yes. Its a statement.
I do like some of the art on your site.

Thank you. It is there to be enjoyed by anyone with eyesight and access
to net. I hope you did enjoy the art and the site.
The actual art, though,
shouldn't be copyrighted

Are you saying that artists are not entitled to the copyrights to their
own (unique) works? So in the same vein programmers, musicians or
screenwriters shouldn't copyright their works? Nevermind, just get back
to the challenge.


Csmr
 
R

Rolando Abarca

I'm starting to get bored with this thread, so, in an effort to stop
it, let's see what casimir wrote with his 1337 ruby h4ck1ng abilities:
Note: I'm only doing this because I'm bored, had a terrible night, and
casimir tried to run some pseudo-code before, not even realizing
someone was writing pseudo code. So, I'm going to analyze your code in
the same way (a nonsense operation to some nonsense code):

1 "RichFatNorthAmerican".each do |help|
2 if ($doingNext = nil || $doingNext = "SurfingForPr0n")
3 $donation = false
4 help << $doingNext.replace("Help End Poverty!")
5 end
6 end
7 #Disclaimer: Seems like a nice deal. In reality I have no idea
whut it is!
8 #do stuff
9 #...
10 if $donation == true
11 $doingNext.gsub!("Help", "Aww, relax mang! You already did Help")
12 else
13 $doingNext << " Check out http://laptopfoundation.org/participate/
"
14 end
15 puts $doingNext

1: what's the point of doing "each" to a string?
2: this condition will always be true, remember, conditions should use
==, or === or some other operator that returns a boolean value, unless
you are testing for something else.
4: where's help defined?
4: what are you replacing?. Here, doingNext is set to "Help End
Poverty!"
10: where do you set donation to true?, because you test in line 2 is
always a "true" value, donation is always set to false.
13: so far, and because the code above, this is always executed.
15: end of nonsense code.

What you wrote is similar to doing something like this:

if nil
here(some, ruby, code)
that(has, no, meaning) << but
with a {
valid syntax
}
end
puts "i'm so kewl with my h4x0r sk1lzz"

Hint for casimir: some times, in order to make a joke or something
similar, people write pseudo-code, that it's not intended to be run,
and usually its written using the syntax of the language in question,
for instance, what Giles wrote:

people.each do |person|
person.help(end_poverty)
end

is much more valid than what you wrote.

ps: I will not reply to any of your responses in this thread. If you
want to say something, please mail me directly.
Let's recycle some bits and stop the noise. Please let's get back to
our regular schedule.

regards,
 
T

Todd Benson

I'm starting to get bored with this thread, so, in an effort to stop
it, let's see what casimir wrote with his 1337 ruby h4ck1ng abilities:

Yeah, I'm pretty much done with it too, but will chime in for kicks.
1 "RichFatNorthAmerican".each do |help|
2 if ($doingNext = nil || $doingNext = "SurfingForPr0n")

The guy/gal either doesn't know what "if" is for or is simply saying
that any label such as "RichFatNorthAmerican" will never, ever donate
in an obfuscated way. Still, the use of globals I don't get though,
except maybe for trying to make a statement, which csmr alluded to
earlier in the thread (forgive my run-on sentences).
3 $donation = false
4 help << $doingNext.replace("Help End Poverty!")
5 end
6 end
7 #Disclaimer: Seems like a nice deal. In reality I have no idea
whut it is!
8 #do stuff
9 #...
10 if $donation == true
11 $doingNext.gsub!("Help", "Aww, relax mang! You already did Help")
12 else
13 $doingNext << " Check out http://laptopfoundation.org/participate/
"
14 end
15 puts $doingNext

irb(main):001:0> puts " Check out http://laptopfoundation.org/participate/"

[snip excellent analysis from Rolando of code misbehavior]

Finally, I'll say to csmr, you either don't know what you are doing or
you do and are polluting a list with a joke that doesn't help kids
with free laptops who might want to learn Ruby.

I'll get off the soapbox now.

Todd
 
C

Casimir

Its a tough crowd.

Too bad all of you three, Giles, Todd and Rolando are wrong in relation
to how well my code works, or whether some lines actually do anything.
Theres nothing useless or broken in it. I dont deny it could be "better"
ruby.

But none of you can offer nothing but trolling as you replied in
english, not in ruby. If its so bad, show me a better version. Bottom
line: Giles, Todd, Rolando: Put (sum ruby) up or shut up.

More details below:

Rolando Abarca kirjoitti:
1 "RichFatNorthAmerican".each do |help|

1: what's the point of doing "each" to a string?
Its a request...
4: where's help defined?
On line 1, see above.
4: what are you replacing?. Here, doingNext is set to "Help End
Poverty!"
Yes. And on line 2 its set to "SurfingForPr0n". Which is whats replaced.
10: where do you set donation to true?, because you test in line 2 is
always a "true" value, donation is always set to false.
It might be set to true at "do stuff". But you have to actually do that,
just reading some code wont make it so.
13: so far, and because the code above, this is always executed.
Unless donation is true.
15: end of nonsense code.
Whats nonsense to you is fun to me. Stop taking yourself and your
programs so damn seriously is what I always say.
Let's recycle some bits and stop the noise. Please let's get back to
our regular schedule.

On the usenet, no-one can hear you scream...
 
M

Marc Heiler

Please avoid horribly ugly globals such as $doingNext when there are
more elegant solutions available.
 

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

Forum statistics

Threads
474,274
Messages
2,571,366
Members
48,055
Latest member
RacheleCar

Latest Threads

Top