On 21.02.2006., at 20:27, Jonathan Ellis wrote:

On 2/21/06, Marko Mikulicic <[EMAIL PROTECTED]> wrote:

Honestly, this is a silly objection. Think about it: you're complaining that changing something from a module-level function into a classmethod impacts the API. Why is this silly? Simply that you can break API compatibility in plenty of ways even if you restrict yourself to classmethods to begin with! Say, by moving a method from class A to class B. And you have similar workarounds if that matters to you: you can leave a stub in class A; you can leave a stub module-level function.

compatibility is a complex issue. But as many complex things it is made from many parts. We could discuss endlessly each of them. I think the thing about modules is one of them, because I've noticed in many years of python programming the tendence of moving top level code to classes. The reasions vary. Modules and classes are not at the same level, they aren't different ways to do the same stuff (consider for example inheritance and polimorphism), althrough you can do many things with modules quite well.

Of course that we all can have different opinions on that, and that's ok. In fact all this discussion is a reply to a request to elaborate on why I personally don't like. So take the answers accordingly. This has nothing to do with critics to sqlalchemy. I think this list is not the place for discussing python patterns.

As I said, the burden of backwards compatibility in Python is not suddenly greater just because you now have more constructs to work with than just classes.

One thing that I admit is that this considerations are marginal details,
but add a little detail here another there...

It's true that Python has evolved, and the style of early libraries now looks outdated. Everyone acknowledges this. But so has any non-dead language evolved. Compare libraries from JDK 1.1 with modern ones, for instance. Does this mean that the 1.1 designers were idiots, or that Java was poorly designed? No.

Were programmers that wrote fortran programs with hunded of global variables called x1,asdf,cs idiots? No. Were windows programmers who followed the hungarian notation idiots? No. But that doesn't mean that their code is good example now.

Some times there is a reasion behind coding style changes and we must learn from history, but, agreed, sometimes its important to not follow trends blindly.

While I admire Knuth that doesn't mean that I would recomend it's style of programming to students; even if he produced one of the most bug-free piece of software.





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to