Just had some discussion about OO concepts, abstract classes and interfaces in Java and Python in #gnome-nl. I still dislike the fact Python and other interpreted languages got no enforced interface implementation support.
A little comparison (not meant to be disrespectful againt anyone):
When you're living in a Java world, you can go out on friday night, meet some person implementing the Girl interface, invite her at your place and have some fun (you know ;-)).
When you're Python, you might go out on friday night, meet some person who tells you "it" implements the Girl interface and at a first sight does so, as get_voice_timbre returns "girl" and has_boobs returns true. Then you take the person home, to your bedroom, and find out, well, it's a shemale.
Got the picture? :-)
Anyway... SoC news will follow later on!
Advertisement:
Comments:
Pak gewoon de ouderwetse aanpak: het is vrijdagavond, je gaat niet uit maar programmeert je eigen dame, a la Weird Science. Succes gegarandeerd!
Put another way, just because Person p implements the IGirl interface is no guarantee that it actually inherits all the internals of a proper Girl.
In any even, without static types, you do need to test a bit more (you can't just compile and assume it'll work), which IMHO is a good thing.
Hugo: too bad, you might be missing the point.
Ronald: zeker niet, het is geen persoonlijk verhaal ofzo he ;-) Waren erover bezig met stratos en JanC, en plots kwam dat in me op (ok, ik was niet helemaal nuchter). Leek me nog een leuke vergelijking, blijkbaar kunnen sommige mensen ook hier niet tegen :-/
Michael: I know you can check whether all things you want to be defined are actually defined, but that's just something I whish I shouldn't be forced to do. It's mainly a matter of personal taste.
chapeaurouge: Thanks :-)
Jeff: This is just an analogy, maybe somewhat "on the edge", but hey... I've read worse things before :-/
http://en.wikipedia.org/wiki/Adapter_pattern
In other words:
Python: Girlfriend
Java: Prostitute
In practice, I find the Python way easiest. You can always implement the Java way in Python if you want. (I've never seen anybody do this.) You can't easily implement the Python way in Java. And often it's really handy.
Of course, I (slightly) prefer the Lisp way, which is roughly "just like Python, except you can declare types like C/Java if you want" (but again, I've almost never seen this done).
It's great that people are questioning things (I've got my own list of Python pet peeves), but in this case I think the market has spoken: languages without Java-type-strictness are winning, and programmers in languages that allow both ways tend to not do the Java way. Sorry. But the SML people would probably love you. :-)
I'm happy to say I found myself a Python girl :)
interface Girl
interface Girlfriend extends Girl
;-)