Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: PL/SQL coding style

RE: PL/SQL coding style

From: Glasrot, Nechama <nglasrot_at_edata.com>
Date: Thu, 18 Jan 2001 17:41:55 -0500
Message-Id: <10745.127091@fatcity.com>


This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible.

------_=_NextPart_001_01C0819F.DBAEE7F0
Content-Type: text/plain;

        charset="iso-8859-1"

feuerstein, steven
o'reilly press  

thank you ...

nechama glasrot
Oracle DBA

"There's only one corner of the universe you can be certain of improving, and that's your own self."

-----Original Message-----
From: David Messer [mailto:dmesser_at_prospective-health.com] Sent: Thursday, January 18, 2001 5:11 PM To: Multiple recipients of list ORACLE-L Subject: RE: PL/SQL coding style

Lisa,  

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_at_fatcity.com [mailto:root_at_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_at_morse.com
<mailto:chandini.paterson_at_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

<http://www.orafaq.com>
-- Author: Chandini Paterson INET: chandini.paterson_at_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_at_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_001_01C0819F.DBAEE7F0 Content-Type: text/html; charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>RE: PL/SQL coding style</TITLE>

<META content="MSHTML 5.00.3103.1000" name=GENERATOR></HEAD>
<BODY bgColor=#c0c0c0>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=543454122-18012001>feuerstein, steven</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=543454122-18012001>o'reilly press</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<P><FONT face=Verdana size=2>thank you ...</FONT> </P>
<P><FONT face=Verdana size=2>nechama glasrot</FONT> <BR><FONT face=Verdana
size=2>Oracle DBA</FONT> </P>
<P><I><FONT color=#0000ff face=Verdana size=2>"There&#8217;s only one corner of the
universe you can be certain of improving, and that's your own self."
</FONT></I><BR><FONT color=#0000ff face=Verdana
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Aldous Huxley, writer</FONT> </P>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> David Messer [mailto:dmesser_at_prospective-health.com]<BR><B>Sent:</B> Thursday, January 18, 2001 5:11 PM<BR><B>To:</B> Multiple recipients of list ORACLE-L<BR><B>Subject:</B> RE: PL/SQL coding style<BR><BR></DIV></FONT> <DIV><FONT color=#0000ff face=Arial size=2><SPAN class=504350422-18012001>Lisa,</SPAN></FONT></DIV> <DIV><FONT color=#0000ff><SPAN class=504350422-18012001></SPAN></FONT>&nbsp;</DIV> <DIV><FONT color=#0000ff><FONT size=2><FONT face=Arial><SPAN class=504350422-18012001>When you say "</SPAN><SPAN class=504350422-18012001>&nbsp;</SPAN>Give him Feuernstein's book.&nbsp;<SPAN class=504350422-18012001>"&nbsp; what book&nbsp;do you mean?&nbsp; I can't seem to find a book by such an author on my usual search engine.&nbsp; Amazon gives me '1354 total matches for "bernstein"&nbsp;' when I do a search on 'Feuernstein'</SPAN></FONT></FONT></FONT></DIV> <DIV>&nbsp;</DIV> <DIV><FONT color=#0000ff face=Arial size=2><SPAN class=504350422-18012001>David</SPAN></FONT></DIV> <DIV>&nbsp;</DIV> <DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> root_at_fatcity.com [mailto:root_at_fatcity.com]<B>On Behalf Of </B>Koivu, Lisa<BR><B>Sent:</B> Thursday, January 18, 2001 10:17 AM<BR><B>To:</B> Multiple recipients of list ORACLE-L<BR><B>Subject:</B> RE: PL/SQL coding style<BR><BR></FONT></DIV> <P><FONT size=2>Chandini, </FONT></P> <P><FONT size=2>GOTOS are ABSOLUTE VOODOO.&nbsp; He thinks that SELECT INTO is more readable, how readable is a GOTO??&nbsp; It ISN'T.&nbsp; Good style also involves writing code that does not involve UNNECESSARY PROCESSING.&nbsp; </FONT></P> <P><FONT size=2>Give him Feuernstein's book.&nbsp; That's correct style in my opinion that is not recreating the wheel and utilizing all that PL/SQL does for you. </FONT></P> <P><FONT size=2>I almost liken not using exception handling to not using the classes that are given to you in java.&nbsp; </FONT></P> <P><FONT size=2>But seriously, I've been in the same position.&nbsp; Being the dba, all code that is compiled into the database is my responsibility.&nbsp; When I came here, I screamed bloody murder because exceptions weren't being used, the sqlcode was being passed all over the place instead.&nbsp; I insisted on changes to the standards document to enforce use of exceptions plus educated some of the developers on how to use them.&nbsp; The bottom line is, if you support it, then you give the final yay or nay for the code.&nbsp; </FONT></P> <P><FONT size=2>Of course, you could be direct and just tell him to pull his head out. </FONT></P> <P><FONT size=2>HTH</FONT> <BR><FONT size=2>Lisa</FONT> </P> <P><FONT size=2>-----Original Message-----</FONT> <BR><FONT size=2>From: Chandini Paterson [<A href="mailto:chandini.paterson_at_morse.com">mailto:chandini.paterson_at_morse.com</A>]</FONT> <BR><FONT size=2>Sent: Thursday, January 18, 2001 11:02 AM</FONT> <BR><FONT size=2>To: Multiple recipients of list ORACLE-L</FONT> <BR><FONT size=2>Subject: PL/SQL coding style</FONT> </P><BR> <P><FONT size=2>Hi gurus,</FONT> <BR><FONT size=2>&nbsp; I've just changed jobs quite recently and am already having problems with</FONT> <BR><FONT size=2>my Senior Developer (yippee)</FONT> <BR><FONT size=2>&nbsp; It concerns the PL/SQL coding style.&nbsp; The guy insists that I use 'SELECT</FONT> <BR><FONT size=2>..INTO ' in my code rather than explicit cursors, even though I tried</FONT> <BR><FONT size=2>telling him it is more efficient with the latter. He apparently finds it</FONT> <BR><FONT size=2>more 'readable' with the 'SELECT.. INTO ' and says that the double fetch</FONT> <BR><FONT size=2>(for each row) is 'no big deal'.</FONT> <BR><FONT size=2>&nbsp; Also, he insists of using a lot of GOTOs in his code and expects me to do</FONT> <BR><FONT size=2>the same.&nbsp; I am adamant that we use EXCEPTION handlers to achieve the same</FONT> <BR><FONT size=2>thing (BAsically he checks for error conditions in his code and then does a</FONT> <BR><FONT size=2>'goto error_handler' to handle the error!!!). I prefer using EXCEPTIONS to</FONT> <BR><FONT size=2>handle all my error conditions.</FONT> <BR><FONT size=2>&nbsp; I was just wondering if my concepts are all wrong at this time.&nbsp; I am just</FONT> <BR><FONT size=2>curious to know if any of you find his way of coding style preferable to</FONT> <BR><FONT size=2>mine. (OH, by the way, he was initially a 'C' progrmmer).&nbsp; Any inputs will</FONT> <BR><FONT size=2>be greatly appreciated.</FONT> </P> <P><FONT size=2>Thanks</FONT> <BR><FONT size=2>Chandini</FONT> </P> <P><FONT size=2>-- </FONT><BR><FONT size=2>Please see the official ORACLE-L FAQ: <A href="http://www.orafaq.com" target=_blank>http://www.orafaq.com</A></FONT> <BR><FONT size=2>-- </FONT><BR><FONT size=2>Author: Chandini Paterson</FONT> <BR><FONT size=2>&nbsp; INET: chandini.paterson_at_morse.com</FONT> </P> <P><FONT size=2>Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) 538-5051&nbsp; FAX: (858) 538-5051</FONT> <BR><FONT size=2>San Diego, California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet access / Mailing Lists</FONT> <BR><FONT size=2>--------------------------------------------------------------------</FONT> <BR><FONT size=2>To REMOVE yourself from this mailing list, send an E-Mail message</FONT> <BR><FONT size=2>to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in</FONT> <BR><FONT size=2>the message BODY, include a line containing: UNSUB ORACLE-L</FONT> <BR><FONT size=2>(or the name of mailing list you want to be removed from).&nbsp; You may</FONT> <BR><FONT size=2>also
Received on Thu Jan 18 2001 - 16:41:55 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US