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.
Programming Challenges.
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.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'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.Does Ruby have sensible scoping but still no variable declarations? How does it work?
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).
-
- Posts: 61
- Joined: Wed Apr 30, 2008 3:31 am
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.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?
-
- Posts: 273
- Joined: Thu Apr 10, 2008 9:47 pm