Re: Object Relational Mappers are evil (a meditation)

2010-01-06 Thread Ethan Furman
J Kenneth King wrote: In many contexts I'm sure there is reason to use Perl instead of Python just as there are situations where C is more appropriate than either. However, the mark of a poor programmer in my line of reasoning is one who cannot recognize such distinctions. One must be aware of

Re: Object Relational Mappers are evil (a meditation)

2009-12-29 Thread J Kenneth King
Steven D'Aprano writes: > On Wed, 23 Dec 2009 10:55:19 -0500, J Kenneth King wrote: > >> Steven D'Aprano writes: >> >>> On Mon, 21 Dec 2009 11:44:29 -0500, J Kenneth King wrote: >>> A programmer that lacks critical thinking is a bad programmer. The language they use has no beari

Re: Object Relational Mappers are evil (a meditation)

2009-12-24 Thread Lie Ryan
On 12/24/2009 12:11 PM, Terry Reedy wrote: This buggy idiom survived many years of Python development, missed by virtually everyone. The last statement is false. The hazard of using and/or was well-known back in '97 or so when I discovered or learned it and I believe it was mentioned in the FAQ

Re: Object Relational Mappers are evil (a meditation)

2009-12-23 Thread Steven D'Aprano
On Wed, 23 Dec 2009 20:11:25 -0500, Terry Reedy wrote: >>> Instead the accepted, idiomatic Python way of writing this was to use >>> short-circuit booleans: >>> >>> result = condition and x or y >>> >>> However this idiom is buggy! If x is a false-value (say, 0) then >>> result gets set to y no ma

Re: Object Relational Mappers are evil (a meditation)

2009-12-23 Thread Terry Reedy
Instead the accepted, idiomatic Python way of writing this was to use short-circuit booleans: result = condition and x or y However this idiom is buggy! If x is a false-value (say, 0) then result gets set to y no matter what the value of condition. This is only a bug if one expects otherwise

Re: Object Relational Mappers are evil (a meditation)

2009-12-23 Thread Steven D'Aprano
On Wed, 23 Dec 2009 10:55:19 -0500, J Kenneth King wrote: > Steven D'Aprano writes: > >> On Mon, 21 Dec 2009 11:44:29 -0500, J Kenneth King wrote: >> >>> A programmer that >>> lacks critical thinking is a bad programmer. The language they use >>> has no bearing on such human facilities. >> >> T

Re: Object Relational Mappers are evil (a meditation)

2009-12-23 Thread J Kenneth King
Steven D'Aprano writes: > On Mon, 21 Dec 2009 11:44:29 -0500, J Kenneth King wrote: > >> A programmer that >> lacks critical thinking is a bad programmer. The language they use has >> no bearing on such human facilities. > > That's nonsense, and I can demonstrate it by reference to a single > p

Re: Object Relational Mappers are evil (a meditation)

2009-12-21 Thread Steven D'Aprano
On Mon, 21 Dec 2009 11:44:29 -0500, J Kenneth King wrote: > A programmer that > lacks critical thinking is a bad programmer. The language they use has > no bearing on such human facilities. That's nonsense, and I can demonstrate it by reference to a single programming language, namely Python.

Re: Object Relational Mappers are evil (a meditation)

2009-12-21 Thread r0g
J Kenneth King wrote: > c) This has nothing to do with programming languages. A programmer that > lacks critical thinking is a bad programmer. The language they use has > no bearing on such human facilities. The language may well have a bearing on the quality of the programs generated though,

Re: Object Relational Mappers are evil (a meditation)

2009-12-21 Thread J Kenneth King
Lie Ryan writes: > On 12/17/2009 3:17 PM, J Kenneth King wrote: >> A language is a thing. It may have syntax and semantics that bias it >> towards the conventions and philosophies of its designers. But in the >> end, a language by itself would have a hard time convincing a human >> being to ado

Re: Object Relational Mappers are evil (a meditation)

2009-12-18 Thread Lie Ryan
On 12/17/2009 3:17 PM, J Kenneth King wrote: A language is a thing. It may have syntax and semantics that bias it towards the conventions and philosophies of its designers. But in the end, a language by itself would have a hard time convincing a human being to adopt bad practises. Perhaps som

Re: Object Relational Mappers are evil (a meditation)

2009-12-17 Thread Neil Cerutti
On 2009-12-16, J Kenneth King wrote: > The language doesn't encourage anything. It's just a medium > like oil paints and canvas. A painting can be good or bad > despite the medium it is constructed on. The skill of the > painter is what matters. Technically, oil paints do encourage a certain k

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread J Kenneth King
Neil Cerutti writes: > On 2009-12-16, J Kenneth King wrote: >> The language doesn't encourage anything. It's just a medium >> like oil paints and canvas. A painting can be good or bad >> despite the medium it is constructed on. The skill of the >> painter is what matters. > > Technically, oil

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread J Kenneth King
r0g writes: > J Kenneth King wrote: >> Steven D'Aprano writes: >> >>> On Fri, 11 Dec 2009 19:20:21 -0500, Steve Holden wrote: >>> > > Hear, hear! >>> That's all very well, but some languages and techniques encourage the >>> programmer to write bad code. >> >> That's just BS. >> >> Bad

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread r0g
J Kenneth King wrote: > Steven D'Aprano writes: > >> On Fri, 11 Dec 2009 19:20:21 -0500, Steve Holden wrote: >> >>> Hear, hear! >> That's all very well, but some languages and techniques encourage the >> programmer to write bad code. > > That's just BS. > > Bad code doesn't just write itself

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread J Kenneth King
Steven D'Aprano writes: > On Fri, 11 Dec 2009 19:20:21 -0500, Steve Holden wrote: > >> Simon Forman wrote: >> [...] >>> As far as the OP rant goes, my $0.02: bad programmers will write bad >>> code in any language, with any tool or system or environment they're >>> given. If you want to avoid b

Re: Object Relational Mappers are evil (a meditation)

2009-12-11 Thread Steven D'Aprano
On Fri, 11 Dec 2009 19:20:21 -0500, Steve Holden wrote: > Simon Forman wrote: > [...] >> As far as the OP rant goes, my $0.02: bad programmers will write bad >> code in any language, with any tool or system or environment they're >> given. If you want to avoid bad code there's (apparently) no >>

Re: Object Relational Mappers are evil (a meditation)

2009-12-11 Thread Steve Holden
Simon Forman wrote: [...] > As far as the OP rant goes, my $0.02: bad programmers will write bad > code in any language, with any tool or system or environment they're > given. If you want to avoid bad code there's (apparently) no > substitute for smrt programmers who are familiar with the tools

Re: Object Relational Mappers are evil (a meditation)

2009-12-11 Thread Steve Holden
Paul Rubin wrote: > Mick Krippendorf writes: If I knew what First Anormal Form was I (hope!) >> I read it somewhere once, I just can't find or even remember the source. >> I definitely didn't make it up, though I wish I had. > > I found exactly one google hit for it, which is this clpy thre

Re: Object Relational Mappers are evil (a meditation)

2009-10-22 Thread J Kenneth King
that because the ORM meatgrinder makes it somewhere >> > between extremely unpleasant and impossible to make any >> > non-trivial changes to a non-trivial program, especially after >> > it has been populated with data. >> >> Object-relational mappers are l

Re: Object Relational Mappers are evil (a meditation)

2009-10-21 Thread Aaron Watters
it somewhere > > between extremely unpleasant and impossible to make any > > non-trivial changes to a non-trivial program, especially after > > it has been populated with data. > > Object-relational mappers are like putting lipstick on a > pig:http://gizmoweblog.blogspot.com/2

Re: Object Relational Mappers are evil (a meditation)

2009-10-16 Thread mario ruggier
gt; non-trivial changes to a non-trivial program, especially after > it has been populated with data. Object-relational mappers are like putting lipstick on a pig: http://gizmoweblog.blogspot.com/2006/10/putting-lipstick-on-pig.html m ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Object Relational Mappers are evil (a meditation)

2009-10-16 Thread Tim Wintle
On Fri, 2009-10-16 at 01:01 +0200, Mick Krippendorf wrote: > Maybe my English (and my memory) is just not so good. I'm german, and > here "abnormal" and "anormal" are both negations of "normal", but with > a slight difference in meaning. "anormal" means just "not normal", > whereas the meaning of "

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Mick Krippendorf
Ben Finney schrieb: > Mick Krippendorf writes: > The word “anormal” appears to have been made up by you. > The negation of the word “normal” is “abnormal”, perhaps you meant > “First Abnormal Form”? Maybe my English (and my memory) is just not so good. I'm german, and here "abnormal" and "anorma

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Ben Finney
Mick Krippendorf writes: > Paul Rubin schrieb: > > Ethan Furman writes: > >> If I knew what First Anormal Form was I (hope!) > > > > It appears to be a made-up term. > > I read it somewhere once, I just can't find or even remember the > source. I definitely didn't make it up, though I wish I h

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Paul Rubin
Robert Kern writes: > I believe he mistyped it. Try "First Abnormal Form": > http://www.sqlmag.com/Article/ArticleID/21369/sql_server_21369.html Ah, that makes sense. Article is subscriber-only but would seem to explain the situation. -- http://mail.python.org/mailman/listinfo/python-list

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Robert Kern
On 2009-10-15 16:37 PM, Paul Rubin wrote: Mick Krippendorf writes: If I knew what First Anormal Form was I (hope!) I read it somewhere once, I just can't find or even remember the source. I definitely didn't make it up, though I wish I had. I found exactly one google hit for it, which is thi

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Paul Rubin
Mick Krippendorf writes: > >> If I knew what First Anormal Form was I (hope!) > I read it somewhere once, I just can't find or even remember the source. > I definitely didn't make it up, though I wish I had. I found exactly one google hit for it, which is this clpy thread. -- http://mail.python

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Mick Krippendorf
Paul Rubin schrieb: > Ethan Furman writes: >> If I knew what First Anormal Form was I (hope!) > > It appears to be a made-up term. I read it somewhere once, I just can't find or even remember the source. I definitely didn't make it up, though I wish I had. Mick. -- http://mail.python.org/mail

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Mick Krippendorf
Ethan Furman schrieb: > If I knew what First Anormal Form was [...] This refers to the Normal Forms one goes through when normalizing relational databases. (http://en.wikipedia.org/wiki/Database_normalization#Normal_forms) The First Anormal Form (FAN) means just lumpin' data together in a comma s

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Paul Rubin
Ethan Furman writes: > If I knew what First Anormal Form was I (hope!) It appears to be a made-up term. -- http://mail.python.org/mailman/listinfo/python-list

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Ethan Furman
Mick Krippendorf wrote: Ethan Furman schrieb: Mick Krippendorf wrote: BTW, the comma-separted-values-in-a-field is officially called the First Anormal Form. There *has to be* some value to it since I've seen it used quite a few times... Just because you've seen something, doesn't mean it ha

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Paul Rubin
Ethan Furman writes: > > BTW, the comma-separted-values-in-a-field is officially called the > > First Anormal Form. There *has to be* some value to it since I've > > seen it used quite a few times... Mick. > > Just because you've seen something, doesn't mean it has value; just > because somethin

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Mick Krippendorf
Ethan Furman schrieb: > Mick Krippendorf wrote: >> BTW, the comma-separted-values-in-a-field is officially called the First >> Anormal Form. There *has to be* some value to it since I've seen it used >> quite a few times... > > Just because you've seen something, doesn't mean it has value; [...]

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Ethan Furman
Mick Krippendorf wrote: Steve Holden wrote: Many such designs make mistakes like using multiple columns (or, even worse, comma-separated values) instead of many-to-many relationships. BTW, the comma-separted-values-in-a-field is officially called the First Anormal Form. There *has to be* som

Re: Object Relational Mappers are evil (a meditation)

2009-10-15 Thread Mick Krippendorf
Steve Holden wrote: > Many such designs make mistakes like using multiple columns > (or, even worse, comma-separated values) instead of many-to-many > relationships. BTW, the comma-separted-values-in-a-field is officially called the First Anormal Form. There *has to be* some value to it since I'v

Re: Object Relational Mappers are evil (a meditation)

2009-10-06 Thread Simon Forman
On Tue, Oct 6, 2009 at 2:00 AM, Carl Banks wrote: > On Oct 5, 7:25 am, Aaron Watters wrote: >> This is a bit off topic except that many Python >> programmers seem to be allergic to typing SQL. >> >> RESOLVED:  Using ORMs leads lazy programmers >> to make bad database designs.  It's better to >> c

Re: Object Relational Mappers are evil (a meditation)

2009-10-06 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit : Aaron Watters schrieb: (snip) FOR EXAMPLE: Consider blogging. The most successful blog software is WORDPRESS. Here is the WordPress data model: http://blog.kapish.co.in/wp-content/uploads/2009/03/wp_2.7.png (snip) Now let's look at the Sakai Blogger tool data mo

Re: Object Relational Mappers are evil (a meditation)

2009-10-06 Thread Bruno Desthuilliers
Carl Banks a écrit : On Oct 5, 7:25 am, Aaron Watters wrote: This is a bit off topic except that many Python programmers seem to be allergic to typing SQL. RESOLVED: Using ORMs leads lazy programmers to make bad database designs. It's better to carefully design your database with no invisibl

Re: Object Relational Mappers are evil (a meditation)

2009-10-05 Thread Carl Banks
On Oct 5, 7:25 am, Aaron Watters wrote: > This is a bit off topic except that many Python > programmers seem to be allergic to typing SQL. > > RESOLVED:  Using ORMs leads lazy programmers > to make bad database designs.  It's better to > carefully design your database with no invisible > means of

Re: Object Relational Mappers are evil (a meditation)

2009-10-05 Thread Simon Forman
On Mon, Oct 5, 2009 at 11:14 PM, Paul Rubin wrote: > Steve Holden writes: >> It seems to me that the biggest sin in databases is a failure to use >> rigorous design techniques. If somebody doesn't understand relational >> theory > > Where does one find out about this

Re: Object Relational Mappers are evil (a meditation)

2009-10-05 Thread Ben Finney
Paul Rubin writes: > Steve Holden writes: > > It seems to me that the biggest sin in databases is a failure to use > > rigorous design techniques. If somebody doesn't understand relational > > theory > > Where does one find out about this? I've somehow managed to av

Re: Object Relational Mappers are evil (a meditation)

2009-10-05 Thread Paul Rubin
Steve Holden writes: > It seems to me that the biggest sin in databases is a failure to use > rigorous design techniques. If somebody doesn't understand relational > theory Where does one find out about this? I've somehow managed to avoid it for an awfully long time, but it begins to look useful

Re: Object Relational Mappers are evil (a meditation)

2009-10-05 Thread Steve Holden
rated values) instead of many-to-many relationships. Sad how such elegant tools are so badly abused so often, isn't it? > So I think to make your point you need some more convincing arguments. > It seems to me that the biggest sin in databases is a failure to use rigorous design t

Re: Object Relational Mappers are evil (a meditation)

2009-10-05 Thread Diez B. Roggisch
Aaron Watters schrieb: This is a bit off topic except that many Python programmers seem to be allergic to typing SQL. RESOLVED: Using ORMs leads lazy programmers to make bad database designs. It's better to carefully design your database with no invisible means of support and there is no reaso

Re: Object Relational Mappers are evil (a meditation)

2009-10-05 Thread Bruno Desthuilliers
Aaron Watters a écrit : This is a bit off topic except that many Python programmers seem to be allergic to typing SQL. What I am mostly allergic to is manipulating sql queries as strings and resultsets as lists of tuples. I strongly prefer a higher level representation of both the queries and

Object Relational Mappers are evil (a meditation)

2009-10-05 Thread Aaron Watters
This is a bit off topic except that many Python programmers seem to be allergic to typing SQL. RESOLVED: Using ORMs leads lazy programmers to make bad database designs. It's better to carefully design your database with no invisible means of support and there is no reason to not use SQL directly

Re: object-relational mappers

2008-04-04 Thread Michael Ströder
M.-A. Lemburg wrote: > On 2008-04-01 22:40, Aaron Watters wrote: >> I've been poking around the world of object-relational >> mappers and it inspired me to coin a corellary to the >> the famous quote on regular expressions: >> >> "You have objects and a

Re: object-relational mappers

2008-04-03 Thread M.-A. Lemburg
On 2008-04-01 22:40, Aaron Watters wrote: > I've been poking around the world of object-relational > mappers and it inspired me to coin a corellary to the > the famous quote on regular expressions: > > "You have objects and a database: that's 2 problems. > So

Re: object-relational mappers

2008-04-03 Thread Luis M . González
On 3 abr, 11:06, Bruno Desthuilliers wrote: > Luis M. González a écrit : > > > I have come to the same conclusion. > > ORMs make easy things easier, but difficult things impossible... > > Not my experience with SQLAlchemy. Ok, I still not had an occasion to > test it against stored procedures, but

Re: object-relational mappers

2008-04-03 Thread Luis M . González
Yes, webpy's db api can be used in stand-alone scripts if you want. See below: import web db = web.database(dbn='mysql', db='northwind', user='root') x = db.select('employees') ... Another good thing is that, since queries return Storage objects (similar to dictionaries), they are much more flexi

Re: object-relational mappers

2008-04-03 Thread Diez B. Roggisch
Bruno Desthuilliers schrieb: > Jarek Zgoda a écrit : >> Bruno Desthuilliers napisał(a): >> >>> Now my own experience is that whenever I tried this approach for >>> anything non-trivial, I ended up building an "ad-hoc, >>> informally-specified bug-ridden slow implementation of half of " >>> SQLAlche

Re: object-relational mappers

2008-04-03 Thread Bruno Desthuilliers
Jarek Zgoda a écrit : > Bruno Desthuilliers napisał(a): > >> Now my own experience is that whenever I tried this approach for >> anything non-trivial, I ended up building an "ad-hoc, >> informally-specified bug-ridden slow implementation of half of " >> SQLAlchemy. Which BTW is not strictly an ORM

Re: object-relational mappers

2008-04-03 Thread Marco Mariani
Bruno Desthuilliers wrote: >> A simple select query would be db.select('customers') or >> db.select('customers', name='John'). >> But you can also resort to plain sql as follows: db.query('select * >> from customers where name = "John"'). >> >> Simple, effective and doesn't get in your way. > > S

Re: object-relational mappers

2008-04-03 Thread Bruno Desthuilliers
Luis M. González a écrit : > I have come to the same conclusion. > ORMs make easy things easier, but difficult things impossible... Not my experience with SQLAlchemy. Ok, I still not had an occasion to test it against stored procedures, but when it comes to complex queries, it did the trick so f

Re: object-relational mappers

2008-04-03 Thread Jarek Zgoda
Bruno Desthuilliers napisał(a): > Now my own experience is that whenever I tried this approach for > anything non-trivial, I ended up building an "ad-hoc, > informally-specified bug-ridden slow implementation of half of " > SQLAlchemy. Which BTW is not strictly an ORM, but primarily an attempt > a

Re: object-relational mappers

2008-04-03 Thread Tim Golden
Marco Mariani wrote: > Tim Golden wrote: > >> I've recently used Elixir and found it very useful for a small-scale >> database with no more than a dozen tables, well-structured and >> easily understood. I'd certainly use it again for anything like that >> to save me writing what would amount to bo

Re: object-relational mappers

2008-04-03 Thread Marco Mariani
Tim Golden wrote: > I've recently used Elixir and found it very useful for a small-scale > database with no more than a dozen tables, well-structured and > easily understood. I'd certainly use it again for anything like that > to save me writing what would amount to boilerplate SQL. But I'd > hate

Re: object-relational mappers

2008-04-03 Thread Luis M . González
I have come to the same conclusion. ORMs make easy things easier, but difficult things impossible... The best approach I've seen so far is webpy's (if we are talking of web apps). It isn't an ORM, it is just a way to make the database api easier to use. Queries don't return objects, they return so

Re: object-relational mappers

2008-04-03 Thread Tim Golden
Paul Boddie wrote: > ... I've come to realise that most object-relational mappers are > solving the wrong problems: they pretend that the database is somehow > the wrong representation whilst being a fast enough black box for > holding persistent data (although I doubt that man

Re: object-relational mappers

2008-04-03 Thread Paul Boddie
! I agree with those who question why you'd want to treat a relational database like a big dictionary, and although the interface between queries, results and program data structures can often seem quite awkward, I've come to realise that most object-relational mappers are solving the wrong pr

Re: object-relational mappers

2008-04-02 Thread castironpi
* > > care about using a *relational* database, and *don't* want to hide it > > away. What I don't want is to have to build my queries as raw strings. > > And that's where SQLAlchemy shines : it's not primarily an "ORM", it's > > an higher-level P

Re: object-relational mappers

2008-04-02 Thread hdante
On Apr 2, 10:50 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > > Try Rails' ActiveRecord. Your problems should reduce to (lg lg > > 2)^(1/12). > > python> (log(log(2)))**(1.0/12.0) > Traceback (most recent call last): > File "", line 1, in ? > ValueError: negative number cannot be raised to a fr

Re: object-relational mappers

2008-04-02 Thread Aaron Watters
> Try Rails' ActiveRecord. Your problems should reduce to (lg lg > 2)^(1/12). python> (log(log(2)))**(1.0/12.0) Traceback (most recent call last): File "", line 1, in ? ValueError: negative number cannot be raised to a fractional power So you are saying the problems will get really complex? :

Re: object-relational mappers

2008-04-02 Thread hdante
ines : it's not primarily an "ORM", it's > an higher-level Python/SQL integration tool that let you build your > queries as Python objects (and also, eventually, build an ORM if you > want to...). "Some object-relational mappers seek to eliminate the use of SQL e

Re: object-relational mappers

2008-04-02 Thread Bruno Desthuilliers
Aaron Watters a écrit : > I've been poking around the world of object-relational > mappers and it inspired me to coin a corellary to the > the famous quote on regular expressions: > > "You have objects and a database: that's 2 problems. > So: get an object-relat

Re: object-relational mappers

2008-04-02 Thread Bruno Desthuilliers
hdante a écrit : > On Apr 1, 5:40 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: >> I've been poking around the world of object-relational >> mappers and it inspired me to coin a corellary to the >> the famous quote on regular expressions: >> >> "Y

Re: object-relational mappers

2008-04-01 Thread hdante
On Apr 1, 5:40 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > I've been poking around the world of object-relational > mappers and it inspired me to coin a corellary to the > the famous quote on regular expressions: > > "You have objects and a database: that&#x

Re: object-relational mappers

2008-04-01 Thread Matthew Woodcraft
Aaron Watters <[EMAIL PROTECTED]> wrote: > I've been poking around the world of object-relational > mappers and it inspired me to coin a corellary to the > the famous quote on regular expressions: > "You have objects and a database: that's 2 problems. > So: ge

Re: object-relational mappers

2008-04-01 Thread Jason Scheirer
On Apr 1, 1:40 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > I've been poking around the world of object-relational > mappers and it inspired me to coin a corellary to the > the famous quote on regular expressions: > > "You have objects and a database: that&#x

object-relational mappers

2008-04-01 Thread Aaron Watters
I've been poking around the world of object-relational mappers and it inspired me to coin a corellary to the the famous quote on regular expressions: "You have objects and a database: that's 2 problems. So: get an object-relational mapper: now you have 2**3 problems." That i