Quantcast
Viewing all articles
Browse latest Browse all 45

Overused Procedure? Is there such a thing?

Since I thought that this was more of an opinion question, I asked this question on SSC first, but didn't get many replies. So, I thought I'd get your advice too. I like the idea of using one procedure for lots of tasks rather than copying code around (and possibly having to go edit all of it later if there's a change). But I've got a few procedures, and one in particular, that may be overly used. This procedure is almost 1,000 lines long and has 17 parameters. Sometimes only half the parameters are used. It has large blocks contained in IFs too. Anyway, this is sort-of common sense, but I just wanted to know if anyone has rules when they draw the line and say to themselves "OK, that's it, this poor procedure's getting too patched up and hard to work with! Enough!" What signs do you look for or guides do you use? I can think of a few off the top of my head: - It's too complicated for mere humans to work with. - It has 50 parameters - It has 2,000 lines of code - There are 20 big IF blocks in the thing All of these fall under the category, by the way, of "may be necessary, but probably not". So there's no hard and fast rules here. Also, in this particular case, performance is not the most important factor since it runs on a warehouse that isn't always busy anyway. Thank you!

Viewing all articles
Browse latest Browse all 45

Trending Articles