Am I missing something with Python not having interfaces?
Bruno Desthuilliers
bruno.42.desthuilliers at websiteburo.invalid
Wed May 7 03:59:06 EDT 2008
jmDesktop a écrit :
(snip)
> On the dynamic typing,
> isn't that the same sort of thing that lots of scripting languages
> do?
This is not restricted to scripting languages - that is, unless you'd
call Smalltalk, Erlang or common lisp "scripting languages".
Also and FWIW, static typing in C is mostly here to help the compiler
optimizing, and it's very common to use void pointers and typecast to
get some genericity (cf the sort() function in C stdlib). And you have
the same pattern in Java with "generic" containers storing only "object"
instances, then you have to cast your objects back to the appropriate
type (which may fails, leading to a runtime error).
> VBScript doesn't require you to define your variables,
You mean "to declare the type of your variables" ? Neither OCaml nor
Haskell require this, and they are both statically and strongly typed.
> but I
> don't really want to use it for anything
Neither do I, but not because of dynamic typing. By experience, dynamic
typing works just fine for most applications. And by experience too,
static typing doesn't magically make your code bullet-proof.
> (used to use it a lot in
> Classic ASP.) I believe everyone that Python is great, but some of it
> doesn't make sense to me as to why.
Quite a lot of Java stopped making sens to me since I learned some other
languages. And most of the "OO" (hem) complexity, patterns madness etc
you'll typically find in Java code only exists because of the language's
arbitrary restrictions and lack of expressivity.
Learn Python, learn Ruby or (preferably) Smalltalk, learn common lisp or
(preferably) Scheme, learn OCaml or (preferably) Haskell, learn Erlang,
and you'll find out that there's much more in programming and languages
than can be dreamt of in Java's philosophy !-)
More information about the Python-list
mailing list