Write Tiny Chunks of (Reusable) Code

preview_player
Показать описание
Don't you hate spaghetti code? Loops that start on line 75 and end on line 243....uncommented, obscure algorithms that make you nervous just THINKING about trying to fix their bugs....we've all been there, we've all done it. But how do we STOP doing it? Steven explains in this video how to use one very wonderful technique - nested subprograms - to dramatically, radically improve code readability and banish spaghetti code from your application.

==================================================

Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Рекомендации по теме
Комментарии
Автор

Steven, you are the best ill apply your methods it makes so much sense.

I have very bad approach to do programming even while going through others codes. I complicate most of the times the logic

userzzzabc
Автор

I can say by experience that this approach can make your life a lot easier, and your code easier to both explain and maintain later. Specially when you have to work with a lot of different applications and scripts, so you will forget about them over time.

I wish I had found this back when I began working with PL/SQL code, but I guess it's a good thing I came to the same conclusion than this video by myself at some point. Now most of my old code has been properly grouped and reduced, so even the less experienced of my coworkers can easily figure out what's going on. It is really the right thing to do in most cases.

Nice video as always, Steven.

TheDragShot
Автор

Great work Steven, appreciate all the effort you did to put your experience in video. Easiest and most effective way to learn.

navnitranjan
Автор

Very very helpful to someone who is fairly new to PL/ SQL like me!! 

Thanks,
Cory

coryholmes
Автор

Hi Steven,

From your perspective, what is an acceptable level of nesting for subprograms?

I use level of one:
Main program
- Subprogram1
- Subprogram2

I think that with level two or more code may become more difficult to read and maintain:
Main program
- Subprogram1
-- Nested subprogram 1.1
-- Nested subprogram 1.2
- Subprogram2
-- Nested subprogram 2.1
--- Nested subprogram 2.1.1

mikhaill
Автор

Top Down Design! yes, that is my favorite method. flow chart nested flow chart.. each process box is a procedure. (we don't draw flowchart..just imagine)

siakhooi
Автор

Great content! Keep'em coming. :)

ViniciusSorrentino
Автор

Hi Steven,

Coincidentally,   I was discussing this technique with a co-worker today.  I had written two nested sub procs but they had parameters that were passed to them.  She asked why I did that when the variables were already visible to the sub proc from the outer proc.  On one hand it is a waste of effort to pass in variables that are already visible.  On the other hand, by passing parameters and using local variables in the sub procs, I made them behave like "regular' procedures that did not rely on global variables (which were considered somewhat evil back when I was first learning to program back in the StoneAge).

What is your opinion?

Thanks,
Alan

alanrosenthal
Автор

Any chance to get the actual procedure in full?

shungabubus