• Ralph (unregistered)

    The moral of this story: Never overestimate the CEO's nephew.

  • (cs) in reply to boog
    boog:
    Jaime:
    boog:
    Jaime:
    Jack:
    I'd like to see code from a compiled language in an SQL query. That would be enterprisey.
    DECLARE @assembly_bits varbinary(max) SET @assembly_bits = 0x4D5A90000300000004000000FFFF0000 ...

    CREATE ASSEMBLY CLRinDB AUTHORIZATION dbo FROM @assembly_bits WITH PERMISSION_SET = EXTERNAL_ACCESS

    Yeah, but I'd like to see your query generate dynamic assembly using values queried from the database, like the article does with HTML/Javascript.
    No problem. Simply generate a C# function as a varchar in SQL, use CodeDom to compile it into a binary and then create an assembly from the resulting bits. Here is an example.
    Wait, you're saying generate the code with table values as a varchar in SQL, then compile it? No no no, that's not what I was saying at all.

    Why would you do that when you can generate the dynamic binary with the table values (converted to hex, of course) already embedded? Compiling just seems like an extra step to me.

    I was under the impression we were trying to make this into a bigger WTF. That seems one level less insane, and therefore unacceptable.

  • coyo (unregistered)

    Just wait till the developer discovers LIMIT offset,count

  • (cs) in reply to coyo
    coyo:
    Pray the developer doesn't discover LIMIT offset,count

    FTFY

  • (cs) in reply to Jaime
    Jaime:
    boog:
    Jaime:
    ...generate a C# function as a varchar in SQL, use CodeDom to compile it into a binary and then create an assembly from the resulting bits. Here is an example.
    Wait, you're saying generate the code with table values as a varchar in SQL, then compile it? No no no, that's not what I was saying at all.

    Why would you do that when you can generate the dynamic binary with the table values (converted to hex, of course) already embedded? Compiling just seems like an extra step to me.

    I was under the impression we were trying to make this into a bigger WTF. That seems one level less insane, and therefore unacceptable.
    I suppose it depends on if you measure WTF-iness by "number of components/levels" or "number of brain cells killed by facepalms/brickwalls while trying to fix/maintain". Personally, I feel the latter is a better standard for measuring WTF-iness, so I stand by my bloodcurdling recommendation.

    Keep in mind that what made today's article such a WTF was that it combined everything into one disgusting SQL query.

  • (cs) in reply to Which is it?
    Which is it?:
    Coyne:
    Boy, at our site, that would be a PAGE!!! We're currently at 1.2 million requests.
    For one product? Then it's either a steaming pile or a gigantic success. Statistically, the former is more probable.

    We don't handle just software. All software fixes for any of several hundred products, as well as hardware installs, are handled through the same request system.

    But even showing a list of those on one page makes me shudder. What would that be? A 240 MB page maybe?

  • Denis (unregistered)

    Tsss... It's a shame he actually used ASP... Using blogql (1) and psqlsh (2), he could have served the pages straight from the database...

    (1) https://github.com/f0rk/blogql (2) https://github.com/umitanuki/psqlsh/blob/master/test/sample.sql

  • ih8u (unregistered) in reply to @Deprecated
    @Deprecated:
    I can just imagine the developer thinking,

    "I can't believe this is the only way to build a dynamic HTML page!"

    Sadly, I think I've encountered more instances like this in which the author thought (and sometimes said), "OMG! This is such a clever solution!"

  • ih8u (unregistered) in reply to Ralph
    Ralph:
    The moral of this story: Never overestimate the CEO's nephew.

    This hints at the fact that he can NOT be underestimated. There really is no level or standard which he can fail to achieve.

  • Raptor85 (unregistered)
    "someone decided that it'd be best that we write our own bug/issue tracking system instead of using one of the plethora of fully-functional systems available on the market."
    They were probably just afraid the management would buy BCM software's "Remedy" system. No matter what this guy wrote it's better than THAT wtf....

    (if you haven't used it, it's widely used in many large companies, and if you haven't seen it's back-end....they implemented a full flat file database system to dynamically generate tables for it's forms, then stored that in an oracle database....)

  • anonymous coward (unregistered) in reply to phleabo

    It's cold comfort that I'm not the only one who has dealt with that problem.

  • Tim Cooper (unregistered)

    I'm not really familiar with ASP or even SQL stored procedures, but it looks like there's an attempt to provide a bunch of filters on the issues. Don't these filters work?

  • Grey (unregistered)

    We'll see Java gods soon, I swear.

  • Chris (unregistered)

    On a side note - I remember back in the day going to a new company where they wrote their code like this - with the SQL producing the HTML. It actually turned out that this was significantly quicker (factor of 100 or so) than getting the ASP code to recurse round recordsets to build the HTML

    Not sure there is much excuse for it nowadays though

  • (cs) in reply to sam
    sam:
    του code è die merde.

    Este codigo es una mierda.

    Dieser Code ist scheiße.

  • Chris (unregistered) in reply to XXXXX
    XXXXX:
    It's Genius. When the system malfunctions, no one will ever need to search for the failure point as the whole developer is a single line of fail.
    FT
  • (cs) in reply to Raptor85
    Raptor85:
    They were probably just afraid the management would buy BCM software's "Remedy" system. No matter what this guy wrote it's better than THAT wtf....

    (if you haven't used it, it's widely used in many large companies, and if you haven't seen it's back-end....they implemented a full flat file database system to dynamically generate tables for it's forms, then stored that in an oracle database....)

    We have Remedy deployed. It's exactly as bad as described. It's not the worst large inappropriate product we have either.

  • Anonymous Cow-Herd (unregistered)

    Ah, the good old Jurassic Park model - letting "can" get in the way of "should".

  • (cs) in reply to Jack
    Jack:
    I'd like to see code from a compiled language in an SQL query. That would be enterprisey.
    There used to be a time that I could look at a (Z80) hex dump and kinda figure out what the assembly code was doing. It's an interesting concept: debugging assembly code from your database.
  • Faded (unregistered)

    WOW, I will say it backwards WOW.

  • Geek (unregistered) in reply to Jaime
    Jaime:
    Jack:
    I'd like to see code from a compiled language in an SQL query. That would be enterprisey.
    DECLARE @assembly_bits varbinary(max) SET @assembly_bits = 0x4D5A90000300000004000000FFFF0000 ...

    CREATE ASSEMBLY CLRinDB AUTHORIZATION dbo FROM @assembly_bits WITH PERMISSION_SET = EXTERNAL_ACCESS

    The creepy bit is that I saw straight away that those aren't quite assembly bits yet- just the header of an exe file. Encoding an .exe file in source rather than just calling the .exe in the first place is definitely wtf-worthy though!

  • yes but (unregistered) in reply to kwolter
    kwolter:
    Tragically, I've written code like that in my early days directed by my mentor to do so. What a fool I was to listen.

    Tragically schmagically. It's probably only down to that fact, that you can even appreciate how WTF this code is.

  • yes but (unregistered) in reply to C-Octothorpe
    C-Octothorpe:
    Ed:
    And yet still not as much of a WTF as FogBugz. Classic ASP? Nah, let's WRITE OUR OWN LANGUAGE BWAHAHAHAHAHA

    Meh, as much as it pains me to say, this kind of makes sense that they did it this way... Rather than trying to maintain two or more seperate code bases in two different languages which have to look and behave identically, they just created their own red-headed step child of a language (which nobody loves of course) to be interpreted into different languages depending on the env (Unix or windows).

    Or they could have just written it in Java. Prob sol.

    Inb4r "the real WTF is Java"

  • (cs)

    première! ¡primera! erste!

  • Jay (unregistered) in reply to java.lang.Chris;
    java.lang.Chris;:
    Power Troll:
    OK, the 'php god' one was obviously fake. But this... this one might actually be legitimate. I can't tell.

    The PHP God article seemed perfectly plausible to me. I once worked with a self proclaimed Perl God who wrote similar monstrosities. All of them were packaged up in a single, many thousand line Perl module named after the developer in question. This at least made it easy to replace the bulk of his idiocy with sane code by either searching and replacing the truly bogus function calls (the guy loved reinventing the wheel), then replacing the rest by replacing "use BobLib" with a bunch of more modular (ahem) modules.

    The "PHP god" story was obviously fake based on the following simple logical analysis:

    1. The code as given was stupid and irrational.

    2. There is no such thing as stupid or irrational people in the world.

    3. Therefore, there is no one in the world who would have written such code.

    Well, I guess that's the reasoning anyway.

    I will next prove that news stories about wars are obviously lies, because only mean, nasty people would start wars, and I refuse to believe that there are mean, nasty people in the world.

  • Jay (unregistered) in reply to ih8u
    ih8u:
    @Deprecated:
    I can just imagine the developer thinking,

    "I can't believe this is the only way to build a dynamic HTML page!"

    Sadly, I think I've encountered more instances like this in which the author thought (and sometimes said), "OMG! This is such a clever solution!"

    I've had plenty of conversations with other developers that went something like this:

    "You know, Bob, this code is very complex and difficult to understand. It looks like you used the absolute hardest way to solve the problem that you could find."

    "Yes, isn't it great! This just proves how smart I must be to be able to write such a complicated program!"

  • (cs) in reply to Jay
    Jay:
    ih8u:
    Sadly, I think I've encountered more instances like this in which the author thought (and sometimes said), "OMG! This is such a clever solution!"
    I've had plenty of conversations with other developers that went something like this:

    "You know, Bob, this code is very complex and difficult to understand. It looks like you used the absolute hardest way to solve the problem that you could find."

    "Yes, isn't it great! This just proves how smart I must be to be able to write such a complicated program!"

    A large blunt object applied with extreme prejudice may rectify the situation. At the very least it would be therapeutic for you.

  • Meep (unregistered)

    Nope, this is at least quadralingual.

    Stored procedures aren't written in SQL as SQL has no commands for setting variables. They're written in a procedural language, P/SQL, that performs non-SQL commands, but can also pass SQL commands and queries to the interpreter. P/SQL has a completely different model than SQL proper, and is usually run in a separate engine within the DBMS.

    (You could even argue that the LIKE expression is using a domain-specific globbing language that's basically a stripped down regular expression.)

  • Anon (unregistered) in reply to boog
    boog:
    Jay:
    ih8u:
    Sadly, I think I've encountered more instances like this in which the author thought (and sometimes said), "OMG! This is such a clever solution!"
    I've had plenty of conversations with other developers that went something like this:

    "You know, Bob, this code is very complex and difficult to understand. It looks like you used the absolute hardest way to solve the problem that you could find."

    "Yes, isn't it great! This just proves how smart I must be to be able to write such a complicated program!"

    A large blunt object applied with extreme prejudice may rectify the situation. At the very least it would be therapeutic for you.

    Especially if it's applied rectally.

  • (cs) in reply to Anon
    Anon:
    boog:
    Jay:
    ih8u:
    Sadly, I think I've encountered more instances like this in which the author thought (and sometimes said), "OMG! This is such a clever solution!"
    I've had plenty of conversations with other developers that went something like this:

    "You know, Bob, this code is very complex and difficult to understand. It looks like you used the absolute hardest way to solve the problem that you could find."

    "Yes, isn't it great! This just proves how smart I must be to be able to write such a complicated program!"

    A large blunt object applied with extreme prejudice may rectify the situation. At the very least it would be therapeutic for you.

    Especially if it's applied rectally.

    Okay, 3 things:

    1. I meant to say "to the back of Bob's head", a crucial detail apparently.

    2. Really, why does your mind immediately go to such a dark place (literally)?

    3. Still, thanks for pointing it out. I almost LOL'd myself out of employment.

  • Intrepid1 (unregistered)

    To be truly Enterprisey requires .Net - and every single page is really just 1 *.aspx page which requires XML/XHTML to be generated by stored procs in SQL Server. The resulting XML/XHTML markup must be churned through XLST to produce anything that can be delivered to the browser.

    Encapsulation? Classes? Separation of Concerns? Bah! We've been doing it this way since Clinton was in office!

    Why change now?

  • Bill C. (unregistered) in reply to Meep
    Meep:
    Stored procedures aren't written in SQL as SQL has no commands for setting variables. They're written in a procedural language, P/SQL, that performs non-SQL commands, but can also pass SQL commands and queries to the interpreter. P/SQL has a completely different model than SQL proper, and is usually run in a separate engine within the DBMS.
    That's true for Oracle, where you're working with SQL, PL/SQL and quite likely SQL*Plus all at the same time. Transact-SQL (MS and Sybase) really does behave like one integrated language, though.
  • Puh-leeze (unregistered) in reply to ObiWayneKenobi

    We have our own tracking system because we wanted to be able to tie into our own help desk, facilities, and internal applications development infrastructure without having to put hooks into the "free" apps available. Just because you write crappy, unpolished code, doesn't mean that the rest of us can't have a solution that fits our needs. Besides, it's not that hard to write a tracking system, if you are any good at what you do. As far as that goes, your "ignorance and perceived [need]" statement makes me wonder if you are one of these developers and/or managers that this entire web site revolves around. You dickhead. You are the reason why there is "on the shelf ware". Buy COTS because it is already written. Saves you developer costs. But it is a square peg going into a round hole for your end users. Oh, and by the way, I architect for the firm that invented CMMI, and pushes COTS, but they also understand that COTS is not the answer to everything.

  • Luiz Felipe (unregistered) in reply to Ed

    Cool, Write some compiler in TSQL.

  • Anonymous Cow-Herd (unregistered) in reply to Puh-leeze
    Puh-leeze:
    Oh, and by the way, I architect for the firm that invented CMMI, and pushes COTS, but they also understand that COTS is not the answer to everything.

    We believe you, honest.

Leave a comment on “Trilingual Query Language”

Log In or post as a guest

Replying to comment #:

« Return to Article