I began this year with Oracle plsql. I like this language because I find it very efficient and quite easy to test and debug. However, it's a bit out of date compared to fashinable languages.
I had to debug a huge plsql package (1500 lines, believe me, it's huge for a piece of code!) made of 3 procedures :'(. My first action is to split it in more functions and procedures (remember that this is 2 distincts objects in plsql).
As I'm a huge fan of a book by Robert C. Martin[1], I put functions bellow the place it is called, to make code reading easier. Unfortunately, the code doesn't work unless I put declaration in spec package. So boring ! Moreover, the function then become public, what I want to avoid.
Then I discover something one day before leaving. Here is the example of code:
PACKAGE BODY FOOBAR IS
PROCEDURE MAIN IS
BEGIN
PROC_ONE;
PROC_TWO;
END MAIN;
PROCEDURE PROC_ONE IS
BEGIN
...
END;
PROCEDURE PROC_TWO IS
BEGIN
...
END;
END FOOBAR;
This does not work unless PROC_ONE and PROC_TWO are declared in spec package but
PACKAGE BODY FOOBAR IS
PROCEDURE PROC_ONE IS
BEGIN
...
END;
PROCEDURE PROC_TWO IS
BEGIN
...
END;
PROCEDURE MAIN IS
BEGIN
PROC_ONE;
PROC_TWO;
END MAIN;
END FOOBAR;
works !!!
I think I haven't searched enough in the documentation -_-'.
[1]: Clean Code: A Handbook of Agile Software Craftsmanship
# ISBN-10: 0132350882
# ISBN-13: 978-0132350884