IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Fuel on the fire
Python:

\nclass foo:\n    bar = 'blah'\n    baz = 0\n\n    def __init__(self):\n        self.bar = ''\n        self.baz = 5\n\n>>> foo.bar\n'blah'\n>>> foo().bar\n''\n>>> foo().baz\n5\n>>> foo.baz\n0\n


That is, by specifying the "variables" in the classdef, they become members of the class itself. However, when you instantiate foo, the __init__ "constructor" will rebind those values for the object which "self" refers to, without changing the class member values. If we took those 2 lines out of __init__, then lookups of "bar" and "baz" would return the class values.

Which is neither here nor there in answering your question... ;)
New Hey, that's neat!
I had the opportunity to learn Python for a major project. Unfortunately, the Python expert had quite a bit of language arrogance. :-/ So the learning didn't happen.

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New It does make extensibility a snap.
One thing I love about Python is -- no, back up -- one thing I hate about other languages is that once you've defined/declared a class, it's difficult to extend objcts of that class, especially if you're another developer (and especially one who doesn't want to customize the original code). In Python, it's dead simple: "thing.new_attribute = 5"...you don't have to muck about with getters and setters, subclassing, or private/protected namespaces (unless you *want* to).

Bummer about the "expert". :(
New He was very much in love with doing things "correctly".
Unfortunately, he had a great deal of trouble understanding when "correctly" was different from "right". Everyone else was quite a bit more sanguine about The Right Way To Do things. We had quite a row about the object API (in PHP) and how it auto-cached and lazy-loaded information. We experimented with one new object with a more CS-correct way, just to shut him up, and it wasn't a good idea. The inconvenience of one class with a wildly different interface far out-weighed any marginal benefit from the different way of doing it.

As you might have noticed, I tend to distrust over-enthusiastic people. That's what took me so long to get into Debian...

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New Seems surprisingly like javascript
which is my current daliance. Well, actually, I have professional reasons to learn it but I'm finding its kind of fun too.




"Whenever you find you are on the side of the majority, it is time to pause and reflect"   --Mark Twain

"The significant problems we face cannot be solved at the same level of thinking we were at when we created them."   --Albert Einstein

"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses."   --George W. Bush
New I kinda like JavaScript.
It keeps reminding me of what Visual BASIC should have been. Pity the DOM in most browsers tends to let it down.

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New Yup; the name binding and scopes are very similar
     What makes a "real" programming language? - (drewk) - (20)
         I think he's deluding himself. - (static) - (3)
             No doubt - (drewk) - (2)
                 An anti-example. - (static)
                 There are plenty - (jake123)
         You can do that in C# -NT - (altmann) - (1)
             Perfect :-D -NT - (drewk)
         That programmer is an idiot - (ben_tilly)
         You can do that in just about any modern language. - (admin) - (1)
             No invasion fleet, please! Just nuke it from orbit. -NT - (CRConrad)
         Fuel on the fire - (FuManChu) - (6)
             Hey, that's neat! - (static) - (2)
                 It does make extensibility a snap. - (FuManChu) - (1)
                     He was very much in love with doing things "correctly". - (static)
             Seems surprisingly like javascript - (tuberculosis) - (2)
                 I kinda like JavaScript. - (static)
                 Yup; the name binding and scopes are very similar -NT - (FuManChu)
         Well, since C often does "declaration only at first use"... - (CRConrad)
         Counter example - (tuberculosis) - (1)
             Great suggestion; seconded! -NT - (CRConrad)
         Sounds like a language holywar brewing over there - (tablizer)

Not straight enough to make a perfect structure.
59 ms