Message-Id: <10745.127088@fatcity.com> From: "David Messer" Date: Thu, 18 Jan 2001 15:10:30 -0700 Subject: RE: PL/SQL coding style This is a multi-part message in MIME format. ------=_NextPart_000_006E_01C08160.CC22CC50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit RE: PL/SQL coding styleLisa, When you say " Give him Feuernstein's book. " what book do you mean? I can't seem to find a book by such an author on my usual search engine. Amazon gives me '1354 total matches for "bernstein" ' when I do a search on 'Feuernstein' David -----Original Message----- From: root@fatcity.com [mailto:root@fatcity.com]On Behalf Of Koivu, Lisa Sent: Thursday, January 18, 2001 10:17 AM To: Multiple recipients of list ORACLE-L Subject: RE: PL/SQL coding style Chandini, GOTOS are ABSOLUTE VOODOO. He thinks that SELECT INTO is more readable, how readable is a GOTO?? It ISN'T. Good style also involves writing code that does not involve UNNECESSARY PROCESSING. Give him Feuernstein's book. That's correct style in my opinion that is not recreating the wheel and utilizing all that PL/SQL does for you. I almost liken not using exception handling to not using the classes that are given to you in java. But seriously, I've been in the same position. Being the dba, all code that is compiled into the database is my responsibility. When I came here, I screamed bloody murder because exceptions weren't being used, the sqlcode was being passed all over the place instead. I insisted on changes to the standards document to enforce use of exceptions plus educated some of the developers on how to use them. The bottom line is, if you support it, then you give the final yay or nay for the code. Of course, you could be direct and just tell him to pull his head out. HTH Lisa -----Original Message----- From: Chandini Paterson [mailto:chandini.paterson@morse.com] Sent: Thursday, January 18, 2001 11:02 AM To: Multiple recipients of list ORACLE-L Subject: PL/SQL coding style Hi gurus, I've just changed jobs quite recently and am already having problems with my Senior Developer (yippee) It concerns the PL/SQL coding style. The guy insists that I use 'SELECT ..INTO ' in my code rather than explicit cursors, even though I tried telling him it is more efficient with the latter. He apparently finds it more 'readable' with the 'SELECT.. INTO ' and says that the double fetch (for each row) is 'no big deal'. Also, he insists of using a lot of GOTOs in his code and expects me to do the same. I am adamant that we use EXCEPTION handlers to achieve the same thing (BAsically he checks for error conditions in his code and then does a 'goto error_handler' to handle the error!!!). I prefer using EXCEPTIONS to handle all my error conditions. I was just wondering if my concepts are all wrong at this time. I am just curious to know if any of you find his way of coding style preferable to mine. (OH, by the way, he was initially a 'C' progrmmer). Any inputs will be greatly appreciated. Thanks Chandini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Chandini Paterson INET: chandini.paterson@morse.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). ------=_NextPart_000_006E_01C08160.CC22CC50 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: PL/SQL coding style
Lisa,
 
When you say " Give him Feuernstein's = book. "  what book do you mean?  I = can't seem=20 to find a book by such an author on my usual search engine.  Amazon = gives=20 me '1354 total matches for "bernstein" ' when I do a search on=20 'Feuernstein'
 
David
 
-----Original Message-----
From: root@fatcity.com=20 [mailto:root@fatcity.com]On Behalf Of Koivu, Lisa
Sent: = Thursday, January 18, 2001 10:17 AM
To: Multiple recipients of = list=20 ORACLE-L
Subject: RE: PL/SQL coding style

Chandini,

GOTOS are ABSOLUTE VOODOO.  He thinks that SELECT = INTO is=20 more readable, how readable is a GOTO??  It ISN'T.  Good style = also=20 involves writing code that does not involve UNNECESSARY = PROCESSING. =20

Give him Feuernstein's book.  That's correct = style in my=20 opinion that is not recreating the wheel and utilizing all that PL/SQL = does for=20 you.

I almost liken not using exception handling to not = using the=20 classes that are given to you in java. 

But seriously, I've been in the same position.  = Being the=20 dba, all code that is compiled into the database is my = responsibility. =20 When I came here, I screamed bloody murder because exceptions weren't = being=20 used, the sqlcode was being passed all over the place instead.  I = insisted=20 on changes to the standards document to enforce use of exceptions plus = educated=20 some of the developers on how to use them.  The bottom line is, if = you=20 support it, then you give the final yay or nay for the code.  =

Of course, you could be direct and just tell him to = pull his=20 head out.

HTH
Lisa

-----Original Message-----
From:=20 Chandini Paterson [mailto:chandini.paterson@mors= e.com]=20
Sent: Thursday, January 18, 2001 11:02 AM =
To: Multiple recipients of list ORACLE-L
Subject:=20 PL/SQL coding style


Hi gurus,
  I've just = changed jobs=20 quite recently and am already having problems with
my=20 Senior Developer (yippee)
  It concerns = the PL/SQL=20 coding style.  The guy insists that I use 'SELECT
..INTO ' in my code rather than explicit cursors, even though I = tried
telling him it is more efficient with = the latter.=20 He apparently finds it
more 'readable' with = the=20 'SELECT.. INTO ' and says that the double fetch
(for=20 each row) is 'no big deal'.
  Also, he = insists of=20 using a lot of GOTOs in his code and expects me to do
the same.  I am adamant that we use EXCEPTION handlers to = achieve=20 the same
thing (BAsically he checks for error = conditions=20 in his code and then does a
'goto = error_handler' to=20 handle the error!!!). I prefer using EXCEPTIONS to
handle all my error conditions.
  I was just=20 wondering if my concepts are all wrong at this time.  I am = just=20
curious to know if any of you find his way of coding = style=20 preferable to
mine. (OH, by the way, he was = initially a=20 'C' progrmmer).  Any inputs will
be = greatly=20 appreciated.

Thanks
Chandini

--
Please see the official = ORACLE-L FAQ:=20 http://www.orafaq.com=20
--
Author: Chandini = Paterson=20
  INET: chandini.paterson@morse.com

Fat City Network Services    -- (858)=20 538-5051  FAX: (858) 538-5051
San Diego,=20 California        -- Public Internet = access /=20 Mailing Lists
----------------------------------------------------------------= ----=20
To REMOVE yourself from this mailing list, send an = E-Mail=20 message
to: ListGuru@fatcity.com (note EXACT = spelling of=20 'ListGuru') and in
the message BODY, include a = line=20 containing: UNSUB ORACLE-L
(or the name of = mailing list=20