in reply to Re: EZDBI is an easier interface to SQL databases
in thread EZDBI is an easier interface to SQL databases

mugwumpjism says:
Once you divorce yourself from the concept of tables and rows and start thinking in terms of objects, life becomes a lot easier...
Maybe you could elaborate on why you think so. From here, looking at the 30-line program that you wrote that is "equivalent code" for my 11-line program, the reasons are far from obvious.

What's the benefit that justifies a 2-3x increase in code size?

--
Mark Dominus
Perl Paraphernalia

  • Comment on Re: EZDBI is an easier interface to SQL databases

Replies are listed 'Best First'.
Re: Re: EZDBI is an easier interface to SQL databases
by runrig (Abbot) on Oct 11, 2001 at 20:43 UTC
    Maybe you could elaborate on why you think so. From here, looking at the 30-line program that you wrote that is "equivalent code" for my 11-line program, the reasons are far from obvious.

    What's the benefit that justifies a 2-3x increase in code size?

    I agree that it doesn't necessarily make life any easier, and the code increase (line count-wise) is alot less extreme if you ignore the Tangram schema setup and the comments and the line breaks for readability. But the benefit is that its a tool for 'object persistence'. Which puts Tangram and EZDBI in entirely different categories anyway. But I do appreciate the examples of both :)

    Update:Re: Dominus's reply - I also said 'ignoring the Tangram ... setup', which is everything up to the 'package main'. Which you can count or not. I figure there's an argument for not counting it since its a constant that, once set up, you can do as much inserting/deleting/updating/selecting as you like. So IF you don't count it, then the amount of code is not much greater.

    Since the original program didn't have any objects, I don't see how that could be a benefit in this case.

    That was my point, the two modules are for entirely different things :) Making DBI EZ or storing objects in a database. And how can you say its not a benefit in this case just because your script didn't have any objects. I kind of think of Harry Potter as an object :)
    Besides, if you're going to make that sort of argument, then I submit that this script is far superior:

    use HarryPotter; InsertHarryPotter(); IsPotterInTheHouse(); PrintHarry() for SelectPotter(); DeletePotter(); SelectPotter() and DamnPotter();
      Says runrig:
      the code increase (line count-wise) is alot less extreme if you ignore the Tangram schema setup and the comments and the line breaks for readability.
      I did ignore the comments and the line breaks. Whether you count them or not, it is still three times as long.

      the benefit is a tool for 'object persistence'
      Since the original program didn't have any objects, I don't see how that could be a benefit in this case.

      --
      Mark Dominus
      Perl Paraphernalia