[PLUG] Is PHP a good intro programming language?
Wil Cooley
wcooley at nakedape.cc
Thu Jan 30 22:20:03 UTC 2003
On Thu, 2003-01-30 at 22:14, Phil Tomson wrote:
>
> OK. Not to get too much into language wars ;-) but Ruby has _real_
> operator overloading:
>
> class Foo
>
> def +(other)
> #do whatever you need to do to add foo's together
> end
>
> def [](index)
> #do whatever you need to do to index into your foo
> end
>
> def []=(index,value)
> #assign some foo index a value
> end
>
> end
>
> ....not a complete example, of course...
> I find Python's __operatorname__ way of doing operator overloading
> annoying.
Aside from using a different naming convention, what does this do that
Python can't?
> Yes, lots of Pythonisas say this. For me I found it caused trouble from
> the first Python program I tried to type in. I played with Python for
> about three hours and then decided it wasn't for me mostly based on
> this indentation as syntax thing (but also, it seemed odd to have to
> pass in self everywhere to your instance methods, at least in their
> definitions, and all those __xyz__ method names)... I think the
> Python/Ruby choice is one of taste - they
> both have a lot of similar features. I also tend to find that if you're
> coming from Perl you'll probably prefer Ruby.
I've come to like the whitespace syntax thing. It really saves the
wrists and vision. The only think I miss is being able to flash to the
opening brace with '%' in vi.
Wil
--
Wil Cooley wcooley at nakedape.cc
Naked Ape Consulting http://nakedape.cc
* * * * Linux, UNIX, Networking and Security Solutions * * * *
QCSNet http://www.qcsn.com
* * * * T1, Frame Relay, DSL, Dial-up, and Web Hosting * * * *
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
URL: <http://lists.pdxlinux.org/pipermail/plug/attachments/20030130/576afc56/attachment.asc>
More information about the PLUG
mailing list