Page 2 of 2

Posted: Mon Nov 17, 2008 2:54 am
by the_impaler
I solved some of the challenges with perl and some in C . There is a certain requirement for some of the challenges - the challange itself would be a piece of code. I have seen code in python, C and scheme (or was it Lisp) so far. While you don't have to know those languages you better know more than one programming language. In some of the challenges you would need to do reverse engineering or disassembly,
I started to learn groovy and it was so much fun - now I try to solve all the challanges in groovy.

Posted: Mon Nov 17, 2008 6:39 am
by gfoot
I actually like the explicit "self" in Python. The lack of scoping seems more troublesome in cases like list comprehensions, where I just assume that variables defined in the comprehension won't overwrite globals.

Does Ruby have sensible scoping but still no variable declarations? How does it work?

Posted: Mon Nov 17, 2008 3:41 pm
by sigi
gfoot wrote:I actually like the explicit "self" in Python. The lack of scoping seems more troublesome in cases like list comprehensions, where I just assume that variables defined in the comprehension won't overwrite globals.
I don't see the benefit of the explicit "self". It's something you have to mention in your method's argument list only because there is no lexical scoping that could provide you with an implicit "self" (if I understand things correctly). Thus, it clutters your source code, and that's it.
Does Ruby have sensible scoping but still no variable declarations? How does it work?
I'm not sure if I understand the question. Ruby has lexical (static) scoping, which means that a variable is in scope if it lexically is visible at that point in the code. Variables spring into existence when you use them (just as in Perl), so you never have to declare anything.

The Wikipedia has a good explanation of static vs. dynamic scoping with some Perl examples among others (Perl provides both, so it's a good language to explain the concept).

Posted: Mon Nov 17, 2008 7:18 pm
by the_impaler
gfoot wrote:I actually like the explicit "self" in Python. The lack of scoping seems more troublesome in cases like list comprehensions, where I just assume that variables defined in the comprehension won't overwrite globals.

Does Ruby have sensible scoping but still no variable declarations? How does it work?
If you are looking for Ruby and you have good java knowledge I would recommend groovy - it was a very short learning curve for me. Groovy has closures with dynamic scope and default "it" variable. It also has "self" and "super" etc.

Posted: Tue Nov 18, 2008 3:41 pm
by Allosentient
I actually prefer C#, though if you are not using Windows I wouldn't recommend it. You can download Visual C# 2008 Express for free from Microsoft. I achieved some decent scores on this site with it.