Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Forced obfuscation of local function calls

Name: Anonymous 2011-10-24 6:00

Learn why Ruby is a badly designed mess if you don't know it already: http://ceaude.twoticketsplease.de/articles/ruby-and-the-principle-of-unwelcome-surprise.html

Name: Anonymous 2011-10-24 6:12

Go back to reddit if you didn't already.

Name: Anonymous 2011-10-24 6:20

>>2
Butthurt Ruby rockstar codepoet.

Name: Anonymous 2011-10-24 6:28

I laugh at those pathetic languages that can't get scoping right. Even C does it properly.

The problem now is that in Ruby you can (and usually do) leave off the parentheses enclosing the arguments on function call.
Outside of a context in which variables are immutable, that's really not what I'd call good style.

Name: >>2 2011-10-24 6:33

>>3
It's just common knowledge that Ruby is a misdesigned pile of shit.

Name: Anonymous 2011-10-24 7:22

foo = foo || 200
Do expert programmers really need to do this kind of shit with their ``properly'' designed languages?

Name: Anonymous 2011-10-24 10:31

>>6
I guess it's equivalent to
if(!foo)
 foo = 200;


Better known as the pseudo-object-oriented-C pseudo-singleton idiotm
Foo *foo;
...
if(!foo)
 foo = new_Foo(bar, baz); /* equivalent to foo ||= new_Foo(bar, baz);


Does anyone else find the lack of semicolons in Ruby disturbing?

Name: Anonymous 2011-10-24 10:45

>>7
Why would one want to emulate singleton instead of use a global variable?

Name: Anonymous 2011-10-24 10:49

>>8
Doesn't need to be initialized unless it's used.

Name: Anonymous 2011-10-24 11:00

>>9
That isn't an optimization. It is a useless branch each time you want to retrieve the object.

Name: FrozenVoid 2011-10-24 11:08

>>6
foo=foo||defvalue <==this is called sentinel value and its pretty common even outside of scripting languages, but using this carelessly is too common so foo must be initialized before the check to default value and changed later, like this:
foo=defvalue // foo is known to have default value before call
foo=bar()||foo // foo is now modified, if bar() returns null foo is preserved and any later code may call it without check

Name: Anonymous 2011-10-24 13:22

>>6
I enjoy this idiom in every language that supports it. Much better than having a built-in concept of default values.

The article wasn't abut this idiom though, but about how it interacts badly with optional function-call syntax.

Name: Anonymous 2011-10-24 17:01

Ruby is actually a very nice language, and these are just retarded quirks.

Using the variables names that are the same as functions is retarded programming. I would argue that the language shouldn't even allow this, or have an option.

Name: Anonymous 2011-10-24 17:05

>>13
Why do you hate freedom?

Name: Anonymous 2011-10-24 18:24

I dislike ruby because every third line in an average ruby program is just "end". Lua has the same problem. At least use braces, for Hitler's sake.

Name: Anonymous 2011-10-24 19:57

>>15
gb2 python, ``redditor''

Name: Anonymous 2011-10-24 20:43

>>13 kill yourself faggot
>>14 back to Iran, ameritard
>>15 "end" takes three keystrokes to type; a brace takes two keystrokes to type; a square bracket only one
>>16 lead by example you cocksucking faggot

Name: Anonymous 2011-10-24 20:46

>a square bracket only one
Not on my keyboard, ``      ''

Name: Anonymous 2011-10-24 21:12

>>18
enjoy third world, faggot

Name: Anonymous 2011-10-25 5:26

>>19
хуй

Name: Anonymous 2011-10-25 5:29

>>17
a square bracket only one
But I swapped my square brackets with parens!

Name: Anonymous 2011-10-25 7:32

>>19
says the AA+ ``first worlder''

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List