Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #7448

Re: Bad database design can cause unnecessary coding

From "M. Strobel" <sorry_no_mail_here@nowhere.dee>
Newsgroups comp.lang.php
Subject Re: Bad database design can cause unnecessary coding
Date 2012-11-03 19:00 +0100
Message-ID <afl4egF9vukU1@mid.uni-berlin.de> (permalink)
References <cnKks.137076$Tf3.11521@fx12.am4> <afhg10Ff1jjU1@mid.uni-berlin.de> <mg5ls.149526$it2.4719@fx22.am4>

Show all headers | View raw


Am 03.11.2012 10:14, schrieb Tony Marston:
> "M. Strobel"  wrote in message news:afhg10Ff1jjU1@mid.uni-berlin.de...
>>
>> Am 02.11.2012 08:12, schrieb Tony Marston:
>>> When you design your database for your PHP application are you aware that some of
>>> your design decisions can have a detrimental effect when it comes to writing the code
>>> to access that database?
>>
>> All your design decisions can have a detrimental or beneficial effect. The word "can"
>> even is too weak, since the database design is the base of your application.
>>
>> I don't like the phrasing "code to access the database". What you want to access AND
>> use is your data.
>>
>> Maybe I am nitpicking, but precision in wording shows precision in concept. That is
>> what programmers need.
>>
>> /Str.
> 
> Instead of nitpicking over the words I used why don't you try and show how
> intelligent you are by commenting on the 14 "bad" practices that I have identified.
> Do you agree with them? Do you disagree? Do you have any more to add? Or does your

another kind of answer:

The general problem is that you throw condensed knowledge at novices. They most often
won't be able to understand and make use of it.

Then your advice often is simply on the coding convention level, not on the design
level. Coding conventions can be different, but they must be consistent. Example
Gotcha #1: Multi-table JOINS:

First you give a complex select example with outer joins that is outright nonsense,
because the joined tables are not used. Then you advice against table aliases.

My standards: name every integer primary key column with "id". Name every foreign key
with the name of the corresponding object. Table aliases on selects must be standard,
and leave out AS because it is only noise.

Example: the product id is "id", the product id in the orders table is product_id.

This all does not answer the question which design decisions have a detrimental
effect on _coding_ .

/Str.

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Bad database design can cause unnecessary coding "Tony Marston" <TonyMarston@hotmail.com> - 2012-11-02 07:12 +0000
  Re: Bad database design can cause unnecessary coding "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-11-02 09:53 +0100
    Re: Bad database design can cause unnecessary coding "Tony Marston" <TonyMarston@hotmail.com> - 2012-11-03 09:14 +0000
      Re: Bad database design can cause unnecessary coding "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-11-03 18:01 +0100
        Re: Bad database design can cause unnecessary coding Jerry Stuckle <jstucklex@attglobal.net> - 2012-11-03 15:03 -0400
        Re: Bad database design can cause unnecessary coding "Tony Marston" <TonyMarston@hotmail.com> - 2012-11-04 10:11 +0000
          Re: Bad database design can cause unnecessary coding "Peter H. Coffin" <hellsop@ninehells.com> - 2012-11-04 14:37 -0600
      Re: Bad database design can cause unnecessary coding "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-11-03 19:00 +0100
        Re: Bad database design can cause unnecessary coding "Tony Marston" <TonyMarston@hotmail.com> - 2012-11-04 10:18 +0000
          Re: Bad database design can cause unnecessary coding Jerry Stuckle <jstucklex@attglobal.net> - 2012-11-04 07:29 -0500
  Re: Bad database design can cause unnecessary coding Jerry Stuckle <jstucklex@attglobal.net> - 2012-11-02 06:48 -0400
    Re: Bad database design can cause unnecessary coding Goran <goran@nospam.com> - 2012-11-02 12:34 +0100
      Re: Bad database design can cause unnecessary coding Jerry Stuckle <jstucklex@attglobal.net> - 2012-11-02 07:48 -0400
        Re: Bad database design can cause unnecessary coding "Tony Marston" <TonyMarston@hotmail.com> - 2012-11-03 09:28 +0000
          Re: Bad database design can cause unnecessary coding "J.O. Aho" <user@example.net> - 2012-11-03 10:56 +0100
            Re: Bad database design can cause unnecessary coding "Tony Marston" <TonyMarston@hotmail.com> - 2012-11-04 10:09 +0000
              Re: Bad database design can cause unnecessary coding Jerry Stuckle <jstucklex@attglobal.net> - 2012-11-04 07:32 -0500
              Re: Bad database design can cause unnecessary coding "J.O. Aho" <user@example.net> - 2012-11-04 16:45 +0100
          Re: Bad database design can cause unnecessary coding Jerry Stuckle <jstucklex@attglobal.net> - 2012-11-03 10:52 -0400
      Re: Bad database design can cause unnecessary coding The Natural Philosopher <tnp@invalid.invalid> - 2012-11-02 11:56 +0000
    Re: Bad database design can cause unnecessary coding "Tony Marston" <TonyMarston@hotmail.com> - 2012-11-03 09:17 +0000
      Re: Bad database design can cause unnecessary coding Jerry Stuckle <jstucklex@attglobal.net> - 2012-11-03 10:54 -0400
        Re: Bad database design can cause unnecessary coding Luuk <luuk@invalid.lan> - 2012-11-03 16:06 +0100
          Re: Bad database design can cause unnecessary coding Jerry Stuckle <jstucklex@attglobal.net> - 2012-11-03 11:25 -0400
  Re: Bad database design can cause unnecessary coding Denis McMahon <denismfmcmahon@gmail.com> - 2012-11-02 11:13 +0000
    Re: Bad database design can cause unnecessary coding "Tony Marston" <TonyMarston@hotmail.com> - 2012-11-03 09:31 +0000
      Re: Bad database design can cause unnecessary coding Denis McMahon <denismfmcmahon@gmail.com> - 2012-11-03 13:08 +0000
        Re: Bad database design can cause unnecessary coding Jerry Stuckle <jstucklex@attglobal.net> - 2012-11-03 10:55 -0400
        Re: Bad database design can cause unnecessary coding "Tony Marston" <TonyMarston@hotmail.com> - 2012-11-04 10:04 +0000
  Re: Bad database design can cause unnecessary coding Luuk <luuk@invalid.lan> - 2012-11-03 11:04 +0100
    Re: Bad database design can cause unnecessary coding "Tony Marston" <TonyMarston@hotmail.com> - 2012-11-04 10:30 +0000
  Re: Bad database design can cause unnecessary coding Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-11-15 15:49 +0100
    Re: Bad database design can cause unnecessary coding "Peter H. Coffin" <hellsop@ninehells.com> - 2012-11-15 12:03 -0600

csiph-web