=== johnnybuoy [n=void@unaffiliated/johnnybuoy] has joined #upstart === Amaranth [n=travis@ubuntu/member/amaranth] has joined #upstart === cortana [n=sam@pc-62-31-146-25-ga.blueyonder.co.uk] has joined #upstart === j_ack [n=rudi@p508D9DD1.dip0.t-ipconnect.de] has joined #upstart === Amaranth [n=travis@ubuntu/member/amaranth] has joined #upstart === fdoving [n=frode@ubuntu/member/frode] has joined #upstart === Amaranth [n=travis@ubuntu/member/amaranth] has joined #upstart === fdoving [n=frode@ubuntu/member/frode] has joined #upstart === imbrandon [n=imbrando@ubuntu/member/pdpc.active.imbrandon] has joined #upstart === Admiral_Chicago [n=freddy@st0660990722.monm.edu] has joined #upstart === maro_ [n=mark@0x55511dab.adsl.cybercity.dk] has joined #upstart === juergbi [n=juerg@80-219-26-249.dclient.hispeed.ch] has joined #upstart === imbrandon [n=imbrando@ubuntu/member/pdpc.active.imbrandon] has joined #upstart === cortana [n=sam@pc-62-31-146-25-ga.blueyonder.co.uk] has joined #upstart === Ingmar [n=ingmar@248.221-241-81.adsl-dyn.isp.belgacom.be] has joined #upstart === Ingmar is now known as Ingmar^ [02:15] <_ion> Any freenet 0.7 users? === johnnybuoy [n=void@unaffiliated/johnnybuoy] has joined #upstart === Amaranth_ [n=travis@ubuntu/member/amaranth] has joined #upstart === Amaranth_ is now known as Amaranth === Admiral_Chicago [n=freddy@st0660990722.monm.edu] has joined #upstart === j_ack [n=rudi@p508D86D9.dip0.t-ipconnect.de] has joined #upstart === Amaranth [n=travis@ubuntu/member/amaranth] has joined #upstart === Md [i=md@freenode/staff/md] has joined #upstart === wasabi_ [n=wasabi@ubuntu/member/wasabi] has joined #upstart === Ingmar^ [n=ingmar@vpna127.ugent.be] has joined #upstart === fatal__ [i=gem@gamezone.fjortis.info] has joined #upstart === Keybuk [n=scott@quest.netsplit.com] has joined #upstart === Amaranth [n=travis@ubuntu/member/amaranth] has joined #upstart === j_ack [n=rudi@p508D86D9.dip0.t-ipconnect.de] has joined #upstart [07:50] <_ion> http://johan.kiviniemi.name/software/random-background/random-background [07:56] hmm? === cortana [n=sam@pc-62-31-146-25-ga.blueyonder.co.uk] has joined #upstart [08:08] <_ion> Sorry, that was offtopic. :-) [08:08] <_ion> Just something i wrote just now. [08:08] seems you realy like ruby.. (: [08:09] I've yet to learn ruby [08:09] on first glance, it seems a little Python like, but without the nice syntax [08:24] <_ion> keybuk: Some propaganda: http://johan.kiviniemi.name/stuff/python-ruby/ :-) === cortana [n=sam@pc-62-31-146-25-ga.blueyonder.co.uk] has joined #upstart [09:09] To get away with less typing, many Python programmers resort to making variables [09:09] (and methods) public even when there's no reason for them to be public. [09:09] that's not true [09:09] Python actively discourages private anything, with the "programmers are consenting adults" theory [09:11] __ is just a name-mangler [09:11] class Foo:def __*(foo) [09:11] just makes the method called __Foo_foo [09:11] so in your example, world.__World_double() is an entirely legal call to get at the "private" method [09:13] in general, that seems to be just a comparison of syntax though [09:13] what's different about the /language/ [09:13] ie. what can I do in Ruby that I cannot do in Python? === cortana [n=sam@pc-62-31-146-25-ga.blueyonder.co.uk] has joined #upstart === cortana [n=sam@pc-62-31-146-25-ga.blueyonder.co.uk] has joined #upstart === cortana [n=sam@pc-62-31-146-25-ga.blueyonder.co.uk] has joined #upstart === Amaranth [n=travis@ubuntu/member/amaranth] has joined #upstart [09:27] _ion: I'd also disagree with that section on private methods, it doesn't reflect python reality [09:28] _ion: on len(obj) vs obj.len(), not sure if that is the reason, but len() will try a couple of different approaches === LarstiQ blinks [09:31] len is a built-in function [09:31] _ion: also problems with "self", notation of instance variables and an example of a class [09:31] it just calls obj.__len__() [09:31] Keybuk: afaik, it can handle __len__ not being there if it has __getitem__ [09:31] it's a shame they didn't just make it a default len() method, but then early Python wasn't as "everything is an object" as modern python [09:32] but yes, that might have something to do with it too === LarstiQ agrees it is not consistent but doesn't care that much === j_ack [n=rudi@p508D86D9.dip0.t-ipconnect.de] has joined #upstart [10:42] <_ion> 0) "Python actively discourages private anything" yes, therefore i like Ruby more. :-) If you like Python more, that's your right. 1) Everything you can do in Ruby, you can do in Python, C, Haskell, Java, Lisp, 68000 asm etc. They are just different. Well, Python doesn't support closures. That's actually a very big win in my opinion. Some people don't regard them as useful (often Python advocates, it seems), and that's their right. [10:42] <_ion> That page is just my personal opinion, and everyone has (and should have) one. :-) [10:43] "closures" ? [10:44] <_ion> http://martinfowler.com/bliki/Closure.html [10:45] python does support closures afaik === LarstiQ reads the link [10:45] <_ion> Creating and referencing functions inside a function does not equal a closure. [10:45] <_ion> http://mail.python.org/pipermail/python-list/2004-July/229478.html [10:45] http://ivan.truemesh.com/archives/000392.html [10:46] that page gives you the Python examples [10:46] ok, so Ruby has first-class closures [10:46] <_ion> If you read that page, you'll notice all the examples are oneliners. [10:46] what does Python have that Ruby doesn't? [10:47] <_ion> That is not very handy. Python has lambda, but it doesn't support multiline code. [10:47] <_ion> Well, currently Python is faster. [10:47] explicitly by choice. [10:47] is everything in Ruby also an introspectable object? [10:47] <_ion> Ruby 2.0 will have a new, fast VM. [10:47] _ion: I'm fine with opinions, but your examples are not how one would write python code, so it's not a fair comparison. [10:48] Keybuk: yes, and you can change the builtin types [10:48] <_ion> Those are examples of how i would write python code. :-) [10:48] so functions are objects, which you can add methods to, or replace? [10:48] _ion: right, you're more writing ruby in python then [10:48] so to make some Ruby code up [10:48] class Random [10:48] def initialize [10:48] <_ion> larstiq: No. I first learned Python, then found Ruby. [10:49] @foo = @bar [10:49] end [10:49] def bar [10:49] ... [10:49] end [10:49] _ion: so? It's not pythonic [10:49] end [10:49] Random.new.foo [10:49] does that work? === LarstiQ is too weak in ruby to say [10:50] Keybuk: one thing that python has is more libraries [10:50] LarstiQ: meh, Python's standard libraries SUCK [10:50] <_ion> @bar (an instance variable) and Random#bar (a method) are different. [10:50] <_ion> class Random [10:50] the most irregularly inconsistent mish-mash of crack on earth [10:50] <_ion> attr_reader :bar [10:50] <_ion> def initialize [10:50] <_ion> @bar = 42 [10:50] <_ion> end [10:50] <_ion> end [10:50] <_ion> Random.new.bar returns 42 [10:50] Keybuk: that may be, ruby has less available [10:51] _ion: that's not what I mean [10:51] could I go #foo = #bar [10:51] ie. create a new method foo that's a copy of the bar method? [10:52] ruby has a distinction beween instance and module attributes, (and private/public), which is something I don't like [10:52] (and ruby doesn't appear to be able to spell "initialise" :p) [10:52] <_ion> class Random [10:52] <_ion> def bar [10:52] <_ion> 42 [10:52] <_ion> end [10:52] <_ion> end [10:53] <_ion> Random.class_eval { alias :foo :bar } [10:53] _ion: can I do Random.foo = Random.bar [10:53] <_ion> Random.new.foo # 42 [10:53] right [10:53] so it appears that a major feature Python has over Ruby is that everything, including methods, is an object [10:53] and that everything is introspectable [10:53] Ruby appears to lack that [10:55] a method in Python is just an object of a particular type that implements a __call__ method that executes the attached Python bytecode, etc. [10:55] oh, another way of doing closures in Python, apparently: [10:55] def foo(self, a, b, c): [10:56] def closure(): [10:56] return a [10:56] some_call(closure) [10:56] that would be _the_ way to do closures? [10:56] although 2.5 has partial() [10:56] that has the same "is executed in the namespace of the calling function" requirements [11:00] of course, the key point about any language is the applicability of that language for certain tasks [11:00] if you're doing low-level systems programming, then you write it in C [11:00] if you're doing any kind of text munging, you write it in Perl [11:00] Python seems to be winning for rapid tool and application creation [11:01] there's a battle between C# and Python for "best GUI development" language [11:01] I've not yet seen anything that makes web apps easy [11:03] Perl, PHP and Python all seem equally bad at it [11:03] Ruby on Rails seems popular this week [11:03] though I must admit, from looking at the code of Typo, I can't see why [11:04] heh, Typo is in ruby and Typo3 in php? Joy :) [11:10] Keybuk, ever looked at django for webapps? [11:11] django is the shit [11:11] and it's been around quite some time so it's not just a fad [11:11] (the django lead dev uses ubuntu ;)) === Amaranth [n=travis@ubuntu/member/amaranth] has joined #upstart === j_ack [n=rudi@p508D86D9.dip0.t-ipconnect.de] has joined #upstart