- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Seen it, and even done it... What I am curious about is how much of the load reduction was specifically "pulling the code out of the DB...
In the systems I have done, there have been times where code in the DB [C# in SqlServer] worked very well. Of course I had multi-tiered aggregation of compiled sequences [aka dynamic assemblies] so that repeated chains of invocations simple resulted in proper calls inside a sing compiled "unit"....
Admin
america!
Admin
While I like the pattern in principle, I think it should not be used as much as some colleagues are using it. If the numbers of methods to call is small, I prefer a simple if / else construct - simply because reading and understanding now requires less levels of indirection. Also, if the parameters change, the table pattern is possibly not your friend - I have seen constructs like draw_line_between_two_points(point1, point2, point3) because somebody wanted to use the table pattern and needed to supprt a function draw_triangle. Depending on the language, you could parameter expansion (*args, **kwargs in python) but that'S less than readable.
Admin
I see way too many people and managers that want to have things "table driven" so they don't have to deploy code but can just modify a field or update a stored proc to make changes. In basically every single situation, this means their deployment process is nonexistent and/or broken, because a solid deployment process should work smoothly. But try tellingl them that while you are reconfiguring things to be database-driven.
Admin
The problem with the original implementation was that it didn't use enough XML. It limits the flexibility because you have a hardcoded upper limit in the number of parameters.
It would have been better to simply parse an XML document into the function that contains the method name and all the parameters. Bonus points for creating the XML by string-concatenation.
Admin
Also, you could put an attribute on the formal parameters to allow you to control what order they are in, just in case you're dealing with an XML processing system which doesn't preserve the order of nodes in the input document (i.e., exactly none of them). I so wish I'd never had an otherwise-sensible software engineer suggest this to me seriously as a good practice, and I'm proud that I didn't call him an idiot straight to his face.
Admin
Non-existent and/or broken? Care to explain how come something doesn't exist AND AT THE SAME TIME is broken?
Admin
"No exceptions" - How very Wirth
Admin
Wow, that is actually rather impressive, it's almost identical to nodebb's post from above but has some nonsensical thesaurus style substitutions swapped in. I wonder if it was done by a human or script?
Admin
That's the evilest thing I can imagine. Today. You had some practice, didn't you? ;-)
Admin
Classic inner platform effect https://en.wikipedia.org/wiki/Inner-platform_effect
Admin
Do I need to point out that this very site had an article about the Inner Platform Effect over a decade ago?
http://thedailywtf.com/articles/The_Inner-Platform_Effect
Admin
Yes, please do. Where can I find more information?
Admin
Admin
Tables are good. Load them from the database at startup, though!
Admin
I once worked for a company that had a WTF customer that had an IT group that would embargo all code changes while the customer group insisted on IMMEDIATE bug fixes. Rather than tell the customer to go woof themselves we were instructed to re-architect the code into something like Snoofle's monstrosity. Now bug fixes could be delivered the next day because database updates were applied as soon as delivered. It worked fine for a while until usage increased. Seems the guys responsible for putting the code into the DB couldn't figure out how to handle the locking we had written into the code and so rather than using the DB to synchronize things just commented out the lock calls.
Admin
Admin
<dba comment="" on=""> ~snip~ <dba comment="" off=""> </dba></dba>
ahahahha Gross
Admin
I'd like to say you're joking, but it almost seems like you're serious?
Admin
An article about it? TDWTF coined the term! The name didn't exist before that.
Admin
Ha. Getting a divorce settlement from her boyfriend? I didn't know that existed.
Admin
I gotta get me some boyfriends!
Admin
Is that what the discussion has gone down to - making fun of spam comments. I'm sure the payment Tami received was half the proceeds received when her boyfriend helped that Nigerian prince move his money.
Admin
It's kind of sad but I think you were lucky to get stack traces back out. I work with a few programs now where the front-ends do next to nothing besides build/parse XML to be passed into and out of database calls that cross between servers. That's a nightmare when something locks up in the middle because there's no way to trace it back.
Admin
I could write you an xml parser that randomizes childnode order, but it'd go on this site for being effing stupid.
Admin
99% speed-up! That's almost double the speed.
Admin
Oh man, I remember that on :D
Addendum 2017-02-15 08:00: ugh, that one.
Admin
I inherited and in the end refused to support a system that was so table driven, there was no html in the app. It was a .net webform, but the forms were blank. All the html was database stored, and even worse it wasn't a single html for the page, it was all broken down into hundreds of row and column entries for a single page. That fine project also had a single class that was over 44,000 lines, had something like 8000 methods in it. Biggest comedy of that class? they all had signatures roughly like
public string Website_Admin_UserAdmin_AddUser_btnSubmitClick(object sender, EventArgs e)
I almost wrote a small program to break them down into folders + namespaces based on that to make it easier to read, but I figured refusing to support it was easier :)
Admin
this reminded me of an old Scf-Fi story, "mssg fnd n lbrry" (the "library" left out all the vowels to save space) after struggling to find a good way to store knowledge (the library took up a whole continent and was miles high) they finally found a way to store information on quantum particles, which could overlap, so everything could fit in one drawer. BUT...then the catalogs took up more and more space, so they eventually had to put them in another drawer, then store the access codes...which eventually took another drawer... eventually they had so many drawers they were about to make a second Galaxy, when the disaster struck: an error occurred in the catalog system, causing all search results to go in a loop. nobody remembered how to fix this, so they needed to look it up-but they couldn't, partly because of that error, and partly because...they didn't know WHICH ONE OF THOSE BILLIONS OF DRAWERS WAS THE MASTER DRAWER (the one with "real" information and not just catalogs) this led to the total collapse of human civilization, and the story implies that it was written by an alien archaeologist. then the story ends with a catalog error... implying that the aliens are having the exact same problem...