IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Interesting plpgsql function.
73 Loops, 15 temporary tables, 4400 lines of plpgsql code in one function. Oh, my!
New plpgsql function same as a stored procedure?
sounds like it. Used to work with a guy who sent a few years as a contractor with AIG. he said that their programs were done almost entirely inside SQL Server stored procedures; line counts of over 10K were typical.




"Chicago to my mind was the only place to be. ... I above all liked the city because it was filled with people all a-bustle, and the clatter of hooves and carriages, and with delivery wagons and drays and peddlers and the boom and clank of freight trains. And when those black clouds came sailing in from the west, pouring thunderstorms upon us so that you couldn't hear the cries or curses of humankind, I liked that best of all. Chicago could stand up to the worst God had to offer. I understood why it was built--a place for trade, of course, with railroads and ships and so on, but mostly to give all of us a magnitude of defiance that is not provided by one house on the plains. And the plains is where those storms come from."

-- E.L. Doctorow
New DBAs aren't programmers and programmers aren't DBAs
Stored procedures are usually written by people who are neither.
New I'm a programmer
and have been writing stored procedures in SQL Server for the past 10 years or so.




"Chicago to my mind was the only place to be. ... I above all liked the city because it was filled with people all a-bustle, and the clatter of hooves and carriages, and with delivery wagons and drays and peddlers and the boom and clank of freight trains. And when those black clouds came sailing in from the west, pouring thunderstorms upon us so that you couldn't hear the cries or curses of humankind, I liked that best of all. Chicago could stand up to the worst God had to offer. I understood why it was built--a place for trade, of course, with railroads and ships and so on, but mostly to give all of us a magnitude of defiance that is not provided by one house on the plains. And the plains is where those storms come from."

-- E.L. Doctorow
New I said usually
What's the largest number of lines of code you've put in a single procedure?
New around 600
that was the number of lines needed to do what I wanted it to do.




"Chicago to my mind was the only place to be. ... I above all liked the city because it was filled with people all a-bustle, and the clatter of hooves and carriages, and with delivery wagons and drays and peddlers and the boom and clank of freight trains. And when those black clouds came sailing in from the west, pouring thunderstorms upon us so that you couldn't hear the cries or curses of humankind, I liked that best of all. Chicago could stand up to the worst God had to offer. I understood why it was built--a place for trade, of course, with railroads and ships and so on, but mostly to give all of us a magnitude of defiance that is not provided by one house on the plains. And the plains is where those storms come from."

-- E.L. Doctorow
New Painful but possibly required
Not for me to judge.

I want MAX 2 screens in a single function (a single printed page, easy to flip up and down in a single keypress).

50-80 lines depending on font size and screen size.

This is what I find easiest to achieve a quick state load. And a quick state load means I can jump in and out of the code with minimal brain prep, which in turn means interruptions cost less.

But sometime the damn declarations run a couple of pages.

So if I can externalize the structure definitions and factor out the logic to maintain 2 page boundaries on functions, my code is simply cleaner, easier to read, easier to debug.

In the old days, when I was a novice C programmer (about a year into it on Tandy 6000 Xenix), I had a large function that contained a case statement. This function was in charge of interpreting a command line editorial macro language, and it had a huge number of organically grown exceptions.

When the compiler told me to simplify my code, it was simply too complex for it to handle, I knew I had a problem.
New AIG? Heh. No wonder they needed to be bailed out. ;0)
New Amateurs.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Don't make me ask you...
for proof.

I don't want my head to explode!

You the one that did Object Oriented Classed programs in SED...

Get thee away from that reply button!
New Wasn't me that did the evil in question...
But I've seen stored procedures that were only broken up once they hit the maximum size.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Looking for your OO in any language page
Got it up somewhere?
New Let's see...
They were called "shapes" examples.

http://onestepback.o.../poly/oo-lpc.html is one.

That's the only one that jumps up in my quick search.

HTH a little.

Cheers,
Scott.
New Re: Looking for your OO in any language page
http://onestepback.org./articles/poly/index.html
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Re: Looking for your OO in any language page
Ah, a useful reminder that there's something wrong in your head, Anderson.
New Who needs a reminder...?
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New The boy spent a month in straight DP style perl
And then another month moving toward some OO aspects. He likes OO.
He also likes Lisp. Strange fucker, ain't he?
And then the job said: PERL MUST DIE - Rewrite EVERYTHING in C#.
So he spent the last month in C#.

I figure he's now ready for exposure to your code. It'll hurt his head, but then it will be worth it.
New Re: The boy spent a month in straight DP style perl
Heh... I am frightened that that stuff is considered training material by anyone...

Make sure you also tell him, "if you ever write something like this I will kill you."
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Specifically: Just because you *can* don't mean you *should*
--

Drew
New Ack!
[edit:] Wrong thread! Sorry!

Cheers,
Scott.
Expand Edited by Another Scott Jan. 6, 2012, 03:33:25 PM EST
     Interesting plpgsql function. - (mmoffitt) - (19)
         plpgsql function same as a stored procedure? - (lincoln) - (6)
             DBAs aren't programmers and programmers aren't DBAs - (crazy) - (4)
                 I'm a programmer - (lincoln) - (3)
                     I said usually - (crazy) - (2)
                         around 600 - (lincoln) - (1)
                             Painful but possibly required - (crazy)
             AIG? Heh. No wonder they needed to be bailed out. ;0) -NT - (mmoffitt)
         Amateurs. -NT - (malraux) - (11)
             Don't make me ask you... - (folkert) - (10)
                 Wasn't me that did the evil in question... - (malraux) - (9)
                     Looking for your OO in any language page - (crazy) - (8)
                         Let's see... - (Another Scott)
                         Re: Looking for your OO in any language page - (malraux) - (6)
                             Re: Looking for your OO in any language page - (pwhysall) - (1)
                                 Who needs a reminder...? -NT - (malraux)
                             The boy spent a month in straight DP style perl - (crazy) - (3)
                                 Re: The boy spent a month in straight DP style perl - (malraux) - (2)
                                     Specifically: Just because you *can* don't mean you *should* -NT - (drook) - (1)
                                         Ack! - (Another Scott)

That's because droids don't tear peoples arms off when they lose.
81 ms