• (cs) in reply to TeeSee
    TeeSee:

    [...]

    Sure, "1934|somestring|true|true|etc..." works fine in most cases, but what happens if one of the strings has a |?

    You could use "\|" to represent a "|" inside a string.  However, the whole thing is crap, so why bother with something so awkward.  Use a language with a better parameter passing technique.

     

  • Anonymous (unregistered) in reply to rycamor
    Anonymous:
    Next we will find that MySQL was responsible for 93% of the data for fresh vegetable packing plant inspections. The whole spinach scare is starting to make sense.

    Why is the IT industry constantly trying to use the wrong tool for the job?

    I know!  When will people learn?  Use Access for things this important!  Sheesh.

    <font size="-2">That, or one giant XML file.</font>

  • snow man (unregistered) in reply to triso
    triso:
    TeeSee:

    [...]

    Sure, "1934|somestring|true|true|etc..." works fine in most cases, but what happens if one of the strings has a |?

    You could use "\|" to represent a "|" inside a string.  However, the whole thing is crap, so why bother with something so awkward.  Use a language with a better parameter passing technique.

    We inherited this 'framework' which was a melange of CORBA, .NET, Java, SOAP/WSDL and "C" components written over the past two decades. One of the requirements was to create a function that (among other things) called one of the original "C" modules (that wrapped a DB query), via an SOA wrapper. The interface was designed to take one String argument, and return a single String. Originally, the routine needed just an alphanumeric transaction id.

    Over the years, folks decided that the argument list should be expanded in order to make the querying capabilities of the "C" routine more flexible. However, management (i.e.: the original authors) decided that we could change neither the footprint of the function nor the exposed SOAP interface.

    It turns out that each developer who needed to change/add to it decided that it wasn't worth figuring out how to change the existing parameter format, and so added their own string-format to the argument, and wound up putting a giant if-else statement in the "C" parsing routine to figure out which type of string-param it was, and how to subsequently parse it (!)

    After several iterations over the years, it wound up in my lap. After much begging and pleading on my part, they wouldn't let me change the published interface, so I just changed the single String "argument list" to XML format, and stored the DTD in the DB. Not ideal, but it allowed parsing the args to be a bit more sane, and at least the arg-string was human readable.

    *sighs*

  • Clever pants (unregistered)


    3 - The Raised Left-Eyebrow -- Very creative, as in, combining all function arguments into a single pipe-delimited string

    I've done that. The "protocol" it was part of worked perfectly too, until someone had a pipe character in their password and broke it. 

  • scc4fun (unregistered) in reply to Hubert Farnsworth
    Hubert Farnsworth:

    Anonymous:
    What? No XML?

    HTML is XML :-)

     HTML is SGML.

    XHTML is XML.

     :)

     
    captcha=enterprisey mmmmmmm
     

  • scc4fun (unregistered) in reply to smbell
    smbell:

    <snip>

    There are three general levels of competence as somebody progresses in the knowledge of a particular domain.

    1. The Beginner
      • <snip>
    2. The Intermediate(worst case)
          <li>&lt;snip&gt;</li>
        </ul>
        
      • The Intermediate(best case)
            <li>&lt;snip&gt;</li>
          </ul>
          
        • The Master
              <li>&lt;snip&gt;</li>
            </ul></li>
            

    <snip>

     I guess "The Intermediate" is only considered as one level with two cases.
     

  • Dazed (unregistered) in reply to Anonymous
    Anonymous:
    Anonymous:
    Why is the IT industry constantly trying to use the wrong tool for the job?

    I know!  When will people learn?  Use Access for things this important! 

    Actually MS-Access would in many cases be a major improvement. All too often what is actually used is a disorganised mess of Excel sheets.

  • Richard Head (unregistered) in reply to Bloodbob

    Anonymous:
    Alot of people seem to be suggesting using SQL to create HTML is a WTF. However big companies like Oracle do it look at Oracle application server. You would create all your HTML in PL/SQL.

     

    Oracle Application Express does this all the time.  Dynamically generating URL's is pretty common, and personally I dont see it as WTF'ish, or a horrible way to do things.  You can disagree with me as much as you want, but they dont become maintenance nightmares in my experience.  

  • Achille (unregistered) in reply to TeeSee
    TeeSee:
    achille:

    >>2 - The Nod -- Creative, as in, using a single 32-bit integer variable to store two 16-bit integers.
    >>3 - The Raised Left-Eyebrow -- Very creative, as in, combining all function arguments into a single pipe-delimited string

    >IMO 2 is by far more tricky than 3. 3 is almost normal in the age of HTTP and XML

     

    No it's not. I use bitmasks all the time. 3 is not normal and is generally not used except by clever programmers. Sure, "1934|somestring|true|true|etc..." works fine in most cases, but what happens if one of the strings has a |?

    It's also much worse than a string array. 

    I think you are replying to the wrong person, That was my first post really and I was trying to reply to the guy with the java code on how to pack and unpack two 16 bit positive integers into one 32 bit integer.

    Sign extension may get tricky

  • (cs) in reply to triso
    triso:
    TeeSee:

    [...]

    Sure, "1934|somestring|true|true|etc..." works fine in most cases, but what happens if one of the strings has a |?

    You could use "\|" to represent a "|" inside a string.  However, the whole thing is crap, so why bother with something so awkward.  Use a language with a better parameter passing technique.

     

    Like javascript?

    I don't see what's wrong with this post. I quite enjoy writing code like this, and would be happy were it mine.

    One of my proudest achievements was a servlet that wrote a shell script and executed it before redirecting to a dynamic page that had just been created by said shell script, including images, javascript, etc.

    The performance was lousy, but on slower modem connections this was more than compensated for be storing commonly used strings in arrays and unpacking them using javascript on the client.

    One was never 100% sure it would work, it was difficult to maintain, but it was such a joy to open that file and read the source code, contained entirely in one method of a servlet, with a deliberate avoidance of white space. Pure poetry.

    See, to the average joe six-pack developer, design patterns are considered good. More experienced and, dare I say it, discerning developers, however, appreciate the software development is not simply a science, or a trade. Software development is an art.

    Much like bullshit.

  • ExKesBert (unregistered)

    This place sounds so much like a company I (briefly) worked at in Western Australia called "Kestral" The owners had written the original system (which was medical in basis as well) their "star" developer had produced libraries to implement multitasking in DOS & a proprietory database engine.  They were still selling the DOS system in the early 2000s.

    They too valued "cool" ahead of "supportable" the code was riddled with compiler directives to include or exclude code for specific customers.

     They'd written their own source control system which was regularly being updated and must have cost them $$$$ in the continual development costs but it was "cheaper than buying licences" - not.  Clearly they hadn't heard of WinCVS or Subversion.

    I think you can figure out that this was one of the worst places I have ever had the misfortune of working at & I'm happy to have moved on...

  • (cs) in reply to Achille
    Anonymous:
    TeeSee:
    achille:

    >>2 - The Nod -- Creative, as in, using a single 32-bit integer variable to store two 16-bit integers.
    >>3 - The Raised Left-Eyebrow -- Very creative, as in, combining all function arguments into a single pipe-delimited string

    >IMO 2 is by far more tricky than 3. 3 is almost normal in the age of HTTP and XML

     

    No it's not. I use bitmasks all the time. 3 is not normal and is generally not used except by clever programmers. Sure, "1934|somestring|true|true|etc..." works fine in most cases, but what happens if one of the strings has a |?

    It's also much worse than a string array. 

    I think you are replying to the wrong person, That was my first post really and I was trying to reply to the guy with the java code on how to pack and unpack two 16 bit positive integers into one 32 bit integer.

    Sign extension may get tricky

    What both of you got wrong is that when i wrote "tricky", I did not mean "difficult". I meant "tricky" as in "brillant".

     

     

  • Olddog (unregistered) in reply to DaBookshah
    Anonymous:

    What's your point?

    Dude...........its TDWTF. That was way, way too logical.

    Okay. what was I thinking....

    Here's a fish-loaf recipe.

    Ingredients:
      Frozen fish fillets
      - same species ( Beginner )
      - mixed species ( Master )
      Breadcrumbs
      - plain ( Beginner )
      - flavored ( Master )
      Egg(s) to bind
      - chicken eggs ( Beginner )
      - reptile eggs ( Master )
      Diced Tomato
      - mild ( Beginner )
      - hot ( Master )  
     (1) Drain tomatoes totally
     (2) In a large vat of fresh water
      - soak frozen fish until thawed
      - drain and replace water often to draw off fish oil
      - soak until fillets begin to separate
     (3) Drain soaked fish totally
     (4) Combine in mixing bowl:
      - fish
      - eggs
      - tomato
      - breadcrumbs
      - pepper or other spices to taste
     (5) Like with meat-loaf, knead the ingredients.
     (6) Place ingredients in a greased bread bread ( ie meat-loaf ) pan
     (7) Cover ingredients with ketchup
      - grid pattern ( Beginner )
      - creative pattern ( Master )
     (8) Bake at 300 for 20 to 30 mins
      - until ketchup bakes hard brown
     (9) Remove loaf from oven and let oven cool.
     (10) Clean oven. Serve with a vegetable medley.

  • Irritated (unregistered)

    The "CTO" is a dumbass and should be whacked in the balls with a baseball bat, repeatedly and often...

  • Fear and Lothing in the Bit Mine (unregistered)

    Man I see#3 at my employer ALL the freakin' time in calls to Oracle stored procs. I always thought that was a WTF. Then there are db functions to parse the string into its components. Example dbParm = "sVar1=Value1|sVar2=Value2|etc=etc". Makes my head spin. I always thought it was lame and was afraid to ask WTF as I feared getting a 3 hour explanation by someone who is ESL challenged on why it has to be done this way.

  • [email protected] (unregistered) in reply to dave
    dave:
    "it turns out that there's some sort of relationship between clever code and incredibly painful maintenance" Someone, and it may have been Dennis Ritchie, but if it wasn't it was another one of those Unix guys, once observed that debugging is twice as hard as writing code in the first place, so if you write code that's as clever as you know how, by definition you're not going to be able to fix it.  

    That depends. The human brain is capable of constantly improving itself. Sometimes new ideas can quickly lead to even newer ideas. It just depends how well you can think/learn.

Leave a comment on “Now That's A Neat Trick”

Log In or post as a guest

Replying to comment #:

« Return to Article