Web Service WTF


  • mod

    I contemplated putting this in CodeSOD, but I don't trust myself to be able to sufficiently anonymize the code I have access to, and I don't have access to enough code to fully illustrate the extent of the WTF.

    My company is starting a partnership with another company to heavily integrate our software. This is in the hopes of making both products potentially marketable, and is the beginning of a long term partnership. Both pieces of software are browser based, so my team and the other team have been building web services for each other. The web services built by my team allow for both SOAP and RESTful calls. The RESTful calls permit XML or JSON, as the caller desires, automatically returning data in the same format as the request was received. And, perhaps most importantly, we have been building the interface for each web service method to suit the purpose of that particular method, to help make it clear what the job of that method is.

    The team from the other company, however - did I mention they are outsourced from India? - they have made a complete mess of their web service. Yes, singular. All methods, whether related to the same or not, are crammed into a single web service. Then there's the endpoint: SOAP only. They supposedly have plans to add RESTful later, but I'm not holding my breath. To make matters worse, they change the web service's URL every three or four days, without informing us. Since we have 12.5 hour time difference, any requests for information we send them typically don't get answered until the following business day, so there goes a day's worth of work.

    And then there is the structure of their web service methods. Part of our specification involved sending 3 pieces of information with every web service call (to identify client company, individual user, and the location they are working from that day). This allows us to filter the returned data to what they need at that time. Because of this specification, the other team decided that they would build all of their web service methods off of common requests and replies, aptly named "genericRequest" and "genericResponse". The basic structure for a request is something like this:

    <genericRequest>
        <customerid>SOME GUID</customerid>
        <userid>SOME GUID</userid>
        <locationid>SOME GUID</locationid>
        <attributes>
            <attributeDetail>
                <attributeName>SOME NAME1</attributeName>
                <attributeValue>SOME VALUE1</attributeValue>
            <attributeDetail>
            <attributeDetail>
                <attributeName>SOME NAME2</attributeName>
                <attributeValue>SOME VALUE2</attributeValue>
            <attributeDetail>
        </attributes>
    </genericRequest>
    

    Where the attributes are used to include parameters necessary for the specific method being called. The genericResponse structure is similarly structured, except attributes is renamed attributeRowDetails.

    Does it really take that much effort to design and implement a unique interface for each web service method? One that isn't a pain in the ass to use? Or am I TRWTF?



  • They forgot the <attributeText> tags around the text.



  • @abarker said:

    they change the web service's URL every three or four days, and won't tell us because they like the WTFery and they're afraid their days are numbered.

    FTFY

    Competence tends to inspire fear in the inept.



  • @abarker said:

    decided that they would build all of their web service methods off of common requests and replies, aptly named "genericRequest" and "genericResponse". The basic structure for a request is

    nowhere near generic enough. They need to get properly into the spirit of the thing:

    <genericRequest>
        <guids>
            <guidDetail>
                <guidName>customerid</guidName>
                <guidValue>SOME GUID</guidValue>
            </guidDetail>
            <guidDetail>
                <guidName>userid</guidName>
                <guidValue>SOME GUID</guidValue>
            </guidDetail>
            <guidDetail>
                <guidName>locationid</guidName>
                <guidValue>SOME GUID</guidValue>
            </guidDetail>
        </guids>
        <attributes>
            <attributeDetail>
                <attributeName>SOME NAME1</attributeName>
                <attributeValue>SOME VALUE1</attributeValue>
            </attributeDetail>
            <attributeDetail>
                <attributeName>SOME NAME2</attributeName>
                <attributeValue>SOME VALUE2</attributeValue>
            </attributeDetail>
        </attributes>
    </genericRequest>



  • I have never experienced problems with outsourced team to that extent so far (/me knocks on wood), but I once landed a job where development was sourced back in-house from India for quality reasons.

    And it usually boils down to that single word: quality. You deliver quality software because you know you are going to work with it day-in, day-out. You know that good quality software is an investment, that will pay off eventually.

    For outsourced teams this is simply not the case. They get a spec, they produce something that will pass any user acceptance tests, and that is the proverbial it. They don't care about the quality because a) they don't get paid for that and b) won't be around long enough. A Chinese offshore team I once worked with had an average roll-over time of one year, meaning that after that time, none of the original team members was still on the team. You train them, you get perhaps three months out of them, they leave.

    This is why I'm vehemently against off-shoring: it devalues software development. No-one would operate a garage with the cheapest tools the local DIY has on offer, but for software development, people do exactly that.

    And it doesn't pay off. Neither in the short run (current project budget is met) nor in the long run. Put the hours of additional work caused by having to work with an offshore team down, add the cost of the off-shore and you might as well hire locally.



  • Better still:

    <data>
        <tag>genericRequest</tag>
        <data>
            <tag>guids</tag>
            <data>
                <tag>guidDetail</tag>
                <data>
                    <data>
                        <tag>guidName</tag>
                        <data>customerid</data>
                    </data>
                    <data>
                        <tag>guidValue</tag>
                        <data>SOME GUID</data>
                    </data>
                </data>
            </data>
            <data>
                <tag>guidDetail</tag>
                <data>
                    <data>
                        <tag>guidName</tag>
                        <data>locationid</data>
                    </data>
                    <data>
                        <tag>guidValue</tag>
                        <data>SOME GUID</data>
                    </data>
                </data>
            </data>
            <data>
                <tag>guidDetail</tag>
                <data>
                    <data>
                        <tag>guidName</tag>
                        <data>userid</data>
                    </data>
                    <data>
                        <tag>guidValue</tag>
                        <data>SOME GUID</data>
                    </data>
                </data>
            </data>
        </data>
        <data>
            <tag>attributes</tag>
            <data>
                <tag>attributeDetail</tag>
                <data>
                    <data>
                        <tag>attributeName</tag>
                        <data>SOME NAME1</data>
                    </data>
                    <data>
                        <tag>attributeValue</tag>
                        <data>SOME VALUE1</data>
                    </data>
                </data>
            </data>
            <data>
                <tag>attributeDetail</tag>
                <data>
                    <data>
                        <tag>attributeName</tag>
                        <data>SOME NAME2</data>
                    </data>
                    <data>
                        <tag>attributeValue</tag>
                        <data>SOME VALUE2</data>
                    </data>
                </data>
            </data>
        </data>
    </data>

    Now we can change the request format any way we like without needing any changes to the DTD. It's generic!


  • Grade A Premium Asshole

    @faoileag said:

    I have never experienced problems with outsourced team to that extent so far

    You are freaking lucky. The offshored code that I have had the displeasure of seeing usually looks like it has been decompiled to a different language.



  • @faoileag said:

    For outsourced teams this is simply not the case. They get a spec, they produce something that will pass any user acceptance tests, and that is the proverbial it. They don't care about the quality

    A friend of mine worked for a company that programmed the chips in the phones they made back in the late 90's. He sent me 2 pages of code generated by the offshore team that was used for the sole purpose of checking if any of the flags were set in a variable used to track flags and asked how I might write it. I don't remember the code, but I do remember the concept they employed, which was along the lines of this:

    Bit 1 check to see if it's set
    Bit 2 check to see if it's set
    Bit 3 check to see if it's set
    ...
    Bit 16 check to see if it's set.

    Each check function was 5 lines of code using some XOR monstrosity to isolate the bit!

    I replaced it with a 16-count ROL loop and checked the flag bit each time, 4 lines total. (He somehow did it in 3 lines, the show-off.)

    Now, mind you, his boss was happy they were only paying $10k a head to do all this cheap programming. He, on the other hand, ends up rewriting all their stuff because with code that bloated, you run out of space fast on the 32KB chip in the phone! To my friend's credit, he found a better paying job elsewhere soon after (not that they were cheap with him, he just couldn't stand the overall situation anymore.)

    TRWTF: They were professionals, getting paid [albeit peanuts] to do this. I had ONE class of C in college, the total extent of my C programming experience. sigh


  • Grade A Premium Asshole

    @redwizard said:

    TRWTF: They were professionals, getting paid [albeit peanuts] to do this.

    We live in a world of highly educated idiots. We frequently are called in as HPCs to clean up someone else's mess. The worst of those clusterfucks are usually perpetrated by those with the most initialisms after their names.



  • @redwizard said:

    He sent me 2 pages of code generated by the offshore team that was used for the sole purpose of checking if any of the flags were set in a variable used to track flags and asked how I might write it.

    int AnyFlagSet(int flags, int mask) {
        return (flags & mask) != 0;
    }
    
    int AllFlagsSet(int flags, int mask) {
        return (flags & mask) == mask;
    }
    

    Have I misunderestimated the spec?



  • All I remember of their code was something like:

    If 128-bit (eval stuff)
    (5 lines of do stuff)
    If 64-bit (eval stuff)
    (5 lines of do stuff)
    If 32-bit (eval stuff)
    (5 lines of do stuff)
    ...

    Somewhere in the middle of the code. Now I wish I kept a copy.


  • Discourse touched me in a no-no place

    So now <data> has a mixed content model? I hate it already.



  • @dkf said:

    I hate it already.

    My work is finished here.



  • @dkf said:

    So now <data> has a mixed content model? I hate it already.

    BUG #278621: Client unhappy with generic request's mixed content model for <data>
    RESOLVED FIXED

    <begin>data</begin>
        <begin>tag</begin>
            genericRequest
        <end>tag</end>
        <begin>data</begin>
            <begin>tag</begin>
                guids
            <end>tag</end>
            <begin>data</begin>
                <begin>tag</begin>
                    guidDetail
                <end>tag</end>
                <begin>data</begin>
                    <begin>data</begin>
                        <begin>tag</begin>
                            guidName
                        <end>tag</end>
                        <begin>data</begin>
                            customerid
                        <end>data</end>
                    <end>data</end>
                    <begin>data</begin>
                        <begin>tag</begin>
                            guidValue
                        <end>tag</end>
                        <begin>data</begin>
                            SOME GUID
                        <end>data</end>
                    <end>data</end>
                <end>data</end>
            <end>data</end>
            <begin>data</begin>
                <begin>tag</begin>
                    guidDetail
                <end>tag</end>
                <begin>data</begin>
                    <begin>data</begin>
                        <begin>tag</begin>
                            guidName
                        <end>tag</end>
                        <begin>data</begin>
                            locationid
                        <end>data</end>
                    <end>data</end>
                    <begin>data</begin>
                        <begin>tag</begin>
                            guidValue
                        <end>tag</end>
                        <begin>data</begin>
                            SOME GUID
                        <end>data</end>
                    <end>data</end>
                <end>data</end>
            <end>data</end>
            <begin>data</begin>
                <begin>tag</begin>
                    guidDetail
                <end>tag</end>
                <begin>data</begin>
                    <begin>data</begin>
                        <begin>tag</begin>
                            guidName
                        <end>tag</end>
                        <begin>data</begin>
                            userid
                        <end>data</end>
                    <end>data</end>
                    <begin>data</begin>
                        <begin>tag</begin>
                            guidValue
                        <end>tag</end>
                        <begin>data</begin>
                            SOME GUID
                        <end>data</end>
                    <end>data</end>
                <end>data</end>
            <end>data</end>
        <end>data</end>
        <begin>data</begin>
            <begin>tag</begin>
                attributes
            <end>tag</end>
            <begin>data</begin>
                <begin>tag</begin>
                    attributeDetail
                <end>tag</end>
                <begin>data</begin>
                    <begin>data</begin>
                        <begin>tag</begin>
                            attributeName
                        <end>tag</end>
                        <begin>data</begin>
                            SOME NAME1
                        <end>data</end>
                    <end>data</end>
                    <begin>data</begin>
                        <begin>tag</begin>
                            attributeValue
                        <end>tag</end>
                        <begin>data</begin>
                            SOME VALUE1
                        <end>data</end>
                    <end>data</end>
                <end>data</end>
            <end>data</end>
            <begin>data</begin>
                <begin>tag</begin>
                    attributeDetail
                <end>tag</end>
                <begin>data</begin>
                    <begin>data</begin>
                        <begin>tag</begin>
                            attributeName
                        <end>tag</end>
                        <begin>data</begin>
                            SOME NAME2
                        <end>data</end>
                    <end>data</end>
                    <begin>data</begin>
                        <begin>tag</begin>
                            attributeValue
                        <end>tag</end>
                        <begin>data</begin>
                            SOME VALUE2
                        <end>data</end>
                    <end>data</end>
                <end>data</end>
            <end>data</end>
        <end>data</end>
    <end>data</end>


  • SockDev

    I hope you didn't write that by hand.



  • Nah, coded up a parser in xslt



  • Can you take it to the next level?



  • <bracket>begin</bracket>
        data
    </bracket>/begin</bracket>
        <bracket>begin</bracket>
            tag
        <bracket>/begin</bracket>
                genericRequest
        <bracket>end</bracket>
            tag
        <bracket>/end</bracket>
        <bracket>begin</bracket>
            data
        <bracket>/begin</bracket>
            <bracket>begin</bracket>
                tag
            <bracket>/begin</bracket>
                    guids
            <bracket>end</bracket>
                tag
            <bracket>/end</bracket>
            <bracket>begin</bracket>
                data
            <bracket>/begin</bracket>
                <bracket>begin</bracket>
                    tag
                <bracket>/begin</bracket>
                        guidDetail
                <bracket>end</bracket>
                    tag
                <bracket>/end</bracket>
                <bracket>begin</bracket>
                    data
                <bracket>/begin</bracket>
                    <bracket>begin</bracket>
                        data
                    <bracket>/begin</bracket>
                        <bracket>begin</bracket>
                            tag
                        <bracket>/begin</bracket>
                                guidName
                        <bracket>end</bracket>
                            tag
                        <bracket>/end</bracket>
                        <bracket>begin</bracket>
                            data
                        <bracket>/begin</bracket>
                                customerid
                        <bracket>end</bracket>
                            data
                        <bracket>/end</bracket>
                    <bracket>end</bracket>
                        data
                    <bracket>/end</bracket>
                    <bracket>begin</bracket>
                        data
                    <bracket>/begin</bracket>
                        <bracket>begin</bracket>
                            tag
                        <bracket>/begin</bracket>
                                guidValue
                        <bracket>end</bracket>
                            tag
                        <bracket>/end</bracket>
                        <bracket>begin</bracket>
                            data
                        <bracket>/begin</bracket>
                                SOME GUID
                        <bracket>end</bracket>
                            data
                        <bracket>/end</bracket>
                    <bracket>end</bracket>
                        data
                    <bracket>/end</bracket>
                <bracket>end</bracket>
                    data
                <bracket>/end</bracket>
            <bracket>end</bracket>
                data
            <bracket>/end</bracket>
            <bracket>begin</bracket>
                data
            <bracket>/begin</bracket>
                <bracket>begin</bracket>
                    tag
                <bracket>/begin</bracket>
                        guidDetail
                <bracket>end</bracket>
                    tag
                <bracket>/end</bracket>
                <bracket>begin</bracket>
                    data
                <bracket>/begin</bracket>
                    <bracket>begin</bracket>
                        data
                    <bracket>/begin</bracket>
                        <bracket>begin</bracket>
                            tag
                        <bracket>/begin</bracket>
                                guidName
                        <bracket>end</bracket>
                            tag
                        <bracket>/end</bracket>
                        <bracket>begin</bracket>
                            data
                        <bracket>/begin</bracket>
                                locationid
                        <bracket>end</bracket>
                            data
                        <bracket>/end</bracket>
                    <bracket>end</bracket>
                        data
                    <bracket>/end</bracket>
                    <bracket>begin</bracket>
                        data
                    <bracket>/begin</bracket>
                        <bracket>begin</bracket>
                            tag
                        <bracket>/begin</bracket>
                                guidValue
                        <bracket>end</bracket>
                            tag
                        <bracket>/end</bracket>
                        <bracket>begin</bracket>
                            data
                        <bracket>/begin</bracket>
                                SOME GUID
                        <bracket>end</bracket>
                            data
                        <bracket>/end</bracket>
                    <bracket>end</bracket>
                        data
                    <bracket>/end</bracket>
                <bracket>end</bracket>
                    data
                <bracket>/end</bracket>
            <bracket>end</bracket>
                data
            <bracket>/end</bracket>
            <bracket>begin</bracket>
                data
            <bracket>/begin</bracket>
                <bracket>begin</bracket>
                    tag
                <bracket>/begin</bracket>
                        guidDetail
                <bracket>end</bracket>
                    tag
                <bracket>/end</bracket>
                <bracket>begin</bracket>
                    data
                <bracket>/begin</bracket>
                    <bracket>begin</bracket>
                        data
                    <bracket>/begin</bracket>
                        <bracket>begin</bracket>
                            tag
                        <bracket>/begin</bracket>
                                guidName
                        <bracket>end</bracket>
                            tag
                        <bracket>/end</bracket>
                        <bracket>begin</bracket>
                            data
                        <bracket>/begin</bracket>
                                userid
                        <bracket>end</bracket>
                            data
                        <bracket>/end</bracket>
                    <bracket>end</bracket>
                        data
                    <bracket>/end</bracket>
                    <bracket>begin</bracket>
                        data
                    <bracket>/begin</bracket>
                        <bracket>begin</bracket>
                            tag
                        <bracket>/begin</bracket>
                                guidValue
                        <bracket>end</bracket>
                            tag
                        <bracket>/end</bracket>
                        <bracket>begin</bracket>
                            data
                        <bracket>/begin</bracket>
                                SOME GUID
                        <bracket>end</bracket>
                            data
                        <bracket>/end</bracket>
                    <bracket>end</bracket>
                        data
                    <bracket>/end</bracket>
                <bracket>end</bracket>
                    data
                <bracket>/end</bracket>
            <bracket>end</bracket>
                data
            <bracket>/end</bracket>
        <bracket>end</bracket>
            data
        <bracket>/end</bracket>
        <bracket>begin</bracket>
            data
        <bracket>/begin</bracket>
            <bracket>begin</bracket>
                tag
            <bracket>/begin</bracket>
                    attributes
            <bracket>end</bracket>
                tag
            <bracket>/end</bracket>
            <bracket>begin</bracket>
                data
            <bracket>/begin</bracket>
                <bracket>begin</bracket>
                    tag
                <bracket>/begin</bracket>
                        attributeDetail
                <bracket>end</bracket>
                    tag
                <bracket>/end</bracket>
                <bracket>begin</bracket>
                    data
                <bracket>/begin</bracket>
                    <bracket>begin</bracket>
                        data
                    <bracket>/begin</bracket>
                        <bracket>begin</bracket>
                            tag
                        <bracket>/begin</bracket>
                                attributeName
                        <bracket>end</bracket>
                            tag
                        <bracket>/end</bracket>
                        <bracket>begin</bracket>
                            data
                        <bracket>/begin</bracket>
                                SOME NAME1
                        <bracket>end</bracket>
                            data
                        <bracket>/end</bracket>
                    <bracket>end</bracket>
                        data
                    <bracket>/end</bracket>
                    <bracket>begin</bracket>
                        data
                    <bracket>/begin</bracket>
                        <bracket>begin</bracket>
                            tag
                        <bracket>/begin</bracket>
                                attributeValue
                        <bracket>end</bracket>
                            tag
                        <bracket>/end</bracket>
                        <bracket>begin</bracket>
                            data
                        <bracket>/begin</bracket>
                                SOME VALUE1
                        <bracket>end</bracket>
                            data
                        <bracket>/end</bracket>
                    <bracket>end</bracket>
                        data
                    <bracket>/end</bracket>
                <bracket>end</bracket>
                    data
                <bracket>/end</bracket>
            <bracket>end</bracket>
                data
            <bracket>/end</bracket>
            <bracket>begin</bracket>
                data
            <bracket>/begin</bracket>
                <bracket>begin</bracket>
                    tag
                <bracket>/begin</bracket>
                        attributeDetail
                <bracket>end</bracket>
                    tag
                <bracket>/end</bracket>
                <bracket>begin</bracket>
                    data
                <bracket>/begin</bracket>
                    <bracket>begin</bracket>
                        data
                    <bracket>/begin</bracket>
                        <bracket>begin</bracket>
                            tag
                        <bracket>/begin</bracket>
                                attributeName
                        <bracket>end</bracket>
                            tag
                        <bracket>/end</bracket>
                        <bracket>begin</bracket>
                            data
                        <bracket>/begin</bracket>
                                SOME NAME2
                        <bracket>end</bracket>
                            data
                        <bracket>/end</bracket>
                    <bracket>end</bracket>
                        data
                    <bracket>/end</bracket>
                    <bracket>begin</bracket>
                        data
                    <bracket>/begin</bracket>
                        <bracket>begin</bracket>
                            tag
                        <bracket>/begin</bracket>
                                attributeValue
                        <bracket>end</bracket>
                            tag
                        <bracket>/end</bracket>
                        <bracket>begin</bracket>
                            data
                        <bracket>/begin</bracket>
                                SOME VALUE2
                        <bracket>end</bracket>
                            data
                        <bracket>/end</bracket>
                    <bracket>end</bracket>
                        data
                    <bracket>/end</bracket>
                <bracket>end</bracket>
                    data
                <bracket>/end</bracket>
            <bracket>end</bracket>
                data
            <bracket>/end</bracket>
        <bracket>end</bracket>
            data
        <bracket>/end</bracket>
    <bracket>end</bracket>
        data
    </bracket>/end</bracket>



  • That's close enough to generic that it can inner-platform itself:

    <bracket>bracket</bracket>
        begin
    </bracket>/bracket</bracket>
            data
    <bracket>/bracket</bracket>
        /begin
    </bracket>/bracket</bracket>
        <bracket>bracket</bracket>
            begin
        <bracket>/bracket</bracket>
                tag
        <bracket>bracket</bracket>
            /begin
        <bracket>/bracket</bracket>
                    genericRequest
        <bracket>bracket</bracket>
            end
        <bracket>/bracket</bracket>
                tag
        <bracket>bracket</bracket>
            /end
        <bracket>/bracket</bracket>
        <bracket>bracket</bracket>
            begin
        <bracket>/bracket</bracket>
                data
        <bracket>bracket</bracket>
            /begin
        <bracket>/bracket</bracket>
            <bracket>bracket</bracket>
                begin
            <bracket>/bracket</bracket>
                    tag
            <bracket>bracket</bracket>
                /begin
            <bracket>/bracket</bracket>
                        guids
            <bracket>bracket</bracket>
                end
            <bracket>/bracket</bracket>
                    tag
            <bracket>bracket</bracket>
                /end
            <bracket>/bracket</bracket>
            <bracket>bracket</bracket>
                begin
            <bracket>/bracket</bracket>
                    data
            <bracket>bracket</bracket>
                /begin
            <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    begin
                <bracket>/bracket</bracket>
                        tag
                <bracket>bracket</bracket>
                    /begin
                <bracket>/bracket</bracket>
                            guidDetail
                <bracket>bracket</bracket>
                    end
                <bracket>/bracket</bracket>
                        tag
                <bracket>bracket</bracket>
                    /end
                <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    begin
                <bracket>/bracket</bracket>
                        data
                <bracket>bracket</bracket>
                    /begin
                <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        begin
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /begin
                    <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    guidName
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    customerid
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        end
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /end
                    <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        begin
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /begin
                    <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    guidValue
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    SOME GUID
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        end
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /end
                    <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    end
                <bracket>/bracket</bracket>
                        data
                <bracket>bracket</bracket>
                    /end
                <bracket>/bracket</bracket>
            <bracket>bracket</bracket>
                end
            <bracket>/bracket</bracket>
                    data
            <bracket>bracket</bracket>
                /end
            <bracket>/bracket</bracket>
            <bracket>bracket</bracket>
                begin
            <bracket>/bracket</bracket>
                    data
            <bracket>bracket</bracket>
                /begin
            <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    begin
                <bracket>/bracket</bracket>
                        tag
                <bracket>bracket</bracket>
                    /begin
                <bracket>/bracket</bracket>
                            guidDetail
                <bracket>bracket</bracket>
                    end
                <bracket>/bracket</bracket>
                        tag
                <bracket>bracket</bracket>
                    /end
                <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    begin
                <bracket>/bracket</bracket>
                        data
                <bracket>bracket</bracket>
                    /begin
                <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        begin
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /begin
                    <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    guidName
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    locationid
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        end
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /end
                    <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        begin
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /begin
                    <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    guidValue
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    SOME GUID
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        end
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /end
                    <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    end
                <bracket>/bracket</bracket>
                        data
                <bracket>bracket</bracket>
                    /end
                <bracket>/bracket</bracket>
            <bracket>bracket</bracket>
                end
            <bracket>/bracket</bracket>
                    data
            <bracket>bracket</bracket>
                /end
            <bracket>/bracket</bracket>
            <bracket>bracket</bracket>
                begin
            <bracket>/bracket</bracket>
                    data
            <bracket>bracket</bracket>
                /begin
            <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    begin
                <bracket>/bracket</bracket>
                        tag
                <bracket>bracket</bracket>
                    /begin
                <bracket>/bracket</bracket>
                            guidDetail
                <bracket>bracket</bracket>
                    end
                <bracket>/bracket</bracket>
                        tag
                <bracket>bracket</bracket>
                    /end
                <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    begin
                <bracket>/bracket</bracket>
                        data
                <bracket>bracket</bracket>
                    /begin
                <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        begin
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /begin
                    <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    guidName
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    userid
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        end
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /end
                    <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        begin
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /begin
                    <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    guidValue
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    SOME GUID
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        end
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /end
                    <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    end
                <bracket>/bracket</bracket>
                        data
                <bracket>bracket</bracket>
                    /end
                <bracket>/bracket</bracket>
            <bracket>bracket</bracket>
                end
            <bracket>/bracket</bracket>
                    data
            <bracket>bracket</bracket>
                /end
            <bracket>/bracket</bracket>
        <bracket>bracket</bracket>
            end
        <bracket>/bracket</bracket>
                data
        <bracket>bracket</bracket>
            /end
        <bracket>/bracket</bracket>
        <bracket>bracket</bracket>
            begin
        <bracket>/bracket</bracket>
                data
        <bracket>bracket</bracket>
            /begin
        <bracket>/bracket</bracket>
            <bracket>bracket</bracket>
                begin
            <bracket>/bracket</bracket>
                    tag
            <bracket>bracket</bracket>
                /begin
            <bracket>/bracket</bracket>
                        attributes
            <bracket>bracket</bracket>
                end
            <bracket>/bracket</bracket>
                    tag
            <bracket>bracket</bracket>
                /end
            <bracket>/bracket</bracket>
            <bracket>bracket</bracket>
                begin
            <bracket>/bracket</bracket>
                    data
            <bracket>bracket</bracket>
                /begin
            <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    begin
                <bracket>/bracket</bracket>
                        tag
                <bracket>bracket</bracket>
                    /begin
                <bracket>/bracket</bracket>
                            attributeDetail
                <bracket>bracket</bracket>
                    end
                <bracket>/bracket</bracket>
                        tag
                <bracket>bracket</bracket>
                    /end
                <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    begin
                <bracket>/bracket</bracket>
                        data
                <bracket>bracket</bracket>
                    /begin
                <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        begin
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /begin
                    <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    attributeName
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    SOME NAME1
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        end
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /end
                    <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        begin
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /begin
                    <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    attributeValue
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    SOME VALUE1
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        end
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /end
                    <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    end
                <bracket>/bracket</bracket>
                        data
                <bracket>bracket</bracket>
                    /end
                <bracket>/bracket</bracket>
            <bracket>bracket</bracket>
                end
            <bracket>/bracket</bracket>
                    data
            <bracket>bracket</bracket>
                /end
            <bracket>/bracket</bracket>
            <bracket>bracket</bracket>
                begin
            <bracket>/bracket</bracket>
                    data
            <bracket>bracket</bracket>
                /begin
            <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    begin
                <bracket>/bracket</bracket>
                        tag
                <bracket>bracket</bracket>
                    /begin
                <bracket>/bracket</bracket>
                            attributeDetail
                <bracket>bracket</bracket>
                    end
                <bracket>/bracket</bracket>
                        tag
                <bracket>bracket</bracket>
                    /end
                <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    begin
                <bracket>/bracket</bracket>
                        data
                <bracket>bracket</bracket>
                    /begin
                <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        begin
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /begin
                    <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    attributeName
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    SOME NAME2
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        end
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /end
                    <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        begin
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /begin
                    <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    attributeValue
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                tag
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                        <bracket>bracket</bracket>
                            begin
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /begin
                        <bracket>/bracket</bracket>
                                    SOME VALUE2
                        <bracket>bracket</bracket>
                            end
                        <bracket>/bracket</bracket>
                                data
                        <bracket>bracket</bracket>
                            /end
                        <bracket>/bracket</bracket>
                    <bracket>bracket</bracket>
                        end
                    <bracket>/bracket</bracket>
                            data
                    <bracket>bracket</bracket>
                        /end
                    <bracket>/bracket</bracket>
                <bracket>bracket</bracket>
                    end
                <bracket>/bracket</bracket>
                        data
                <bracket>bracket</bracket>
                    /end
                <bracket>/bracket</bracket>
            <bracket>bracket</bracket>
                end
            <bracket>/bracket</bracket>
                    data
            <bracket>bracket</bracket>
                /end
            <bracket>/bracket</bracket>
        <bracket>bracket</bracket>
            end
        <bracket>/bracket</bracket>
                data
        <bracket>bracket</bracket>
            /end
        <bracket>/bracket</bracket>
    <bracket>bracket</bracket>
        end
    </bracket>/bracket</bracket>
            data
    <bracket>/bracket</bracket>
        /end
    </bracket>/bracket</bracket>

    Had to make this a separate post because Disgoose apparently can't cope with >32K in one hit.



  • Now submit that to the front page for some Gernification.



  • All yours. I want nothing to do with it.



  • I lied about the xslt.

    sed 's/\&lt;/</g;s/^[^<]*$/    &/;s/\( *\)\(<[^>]*>\)\([^<]*\)/\1\2\n\1    \3\n\1/;s/</[bracket]/g;s/>/[\/bracket]/g;s/\[/</g;s/]/>/g;s/</\&lt;/g'

  • SockDev

    I dread to think what Erik might do with it.

    Inner Platform ftw.



  • @redwizard said:

    If 128-bit (eval stuff) (5 lines of do stuff)If 64-bit (eval stuff) (5 lines of do stuff)If 32-bit (eval stuff) (5 lines of do stuff)...

    Were the 5 lines of "do stuff" the same in each case?



  • @flabdablet said:

    Were the 5 lines of "do stuff" the same in each case?

    Correct. That was what made me gape at it, and why a ROL loop worked.
    Perhaps those guys were paid by line of code? Don't think so, my friend indicated a flat rate. But maybe the coders don't know that...



  • So the desired behavior one round of "do stuff" for each bit that was set? If so, were all 8 bits tested or were some left out?



  • It was 16 bits, and all 16 were tested. I have no idea what the purpose of that code was, I only know that it returned the same thing if any of the 16 bits were tested and found to be set. Since the return was identical, I didn't see the point in testing them all individually - and neither did my friend.



  • Wait wait wait - the "do stuff" included a return? So in fact it would "do stuff" only once, for the first of the 16 bits that was detected as set?



  • To be honest, I don't remember. All I know is the code was supposed to do the same thing if any of the bits were found to be set.



  • Scrolling past this at speed magically transforms it from aneurism-inducing bracket soup into a gently rolling ocean.

    Pity the same can't be said about all WTFs.



  • The ultimate troll would be to take this and make a blog post detailing why this is a great format. 12 months from now some "people" will actually being using it.



  • @faoileag said:

    This is why I'm vehemently against off-shoring: it devalues software development.

    Perhaps a better reason to be against off-shoring is because it threatens your job?

    Our experience with off-shoring to India has been very positive. But we don't simply send a spec to India and use whatever comes back. We work closely together; they're in fact part of the same multi-national company,

    We were the ones who chose which guys would be working for us, and their source code is checked over here, and recommendations for improvements sent back. Some of our people went over to India, and some of them came over here for a couple of weeks to learn about our way of working.

    We had trouble finding qualified Java developers here, not in the least because the government had made a deal with Microsoft, so that you get mostly C# taught at university. The Indian team, on the other hand, gives us a lot of flexibility.

    So sure, outsourcing or off-shoring can go very wrong, but if it does, it's probably your own fault.



  • Also, the other side of outsourcing.

    You work hard. You produce the same or better quality work than the western colleagues (in case of a joined workforce company, like @Severity_One's) . Yet, you get all the shit jobs (legacy maintenance instead of greenfield), you receive shit pay and are generally treated as shit by the other side, because they see you as a threat to their job.



  • @Severity_One said:

    Perhaps a better reason to be against off-shoring is because it threatens your job?

    Our experience with off-shoring to India has been very positive. But we don't simply send a spec to India and use whatever comes back. We work closely together; they're in fact part of the same multi-national company,

    We were the ones who chose which guys would be working for us, and their source code is checked over here, and recommendations for improvements sent back. Some of our people went over to India, and some of them came over here for a couple of weeks to learn about our way of working.


    No, I am not against off-shoring because it threatens my job. It's rather the other way round: it guarantess job security as long as I'm good enough in the language of choice (and happy with it) to do quality audits on the source code delivered from the off-shore team.

    So you get good results from you off-shore team. But at what price? You have to check their code, you have to sent your people over to India, you have to get their people over to you. If seen that in operation with China, and I can do the math. You don't really save very much with that model. But it comes from a different budget, so it looks as if.


  • Discourse touched me in a no-no place

    @faoileag said:

    You don't really save very much with that model.

    Shhh! Stop introducing common sense into this discussion.


  • Grade A Premium Asshole

    It is kind of mesmerizing if you scroll down through it. Like a boring hula dancer.


  • Discourse touched me in a no-no place

    @Severity_One said:

    We had trouble finding qualified Java developers here, not in the least because the government had made a deal with Microsoft, so that you get mostly C# taught at university.

    Wouldn't a competent C# programmer be able to learn Java relatively quickly?


  • mod

    Depends on how adaptable the programmer is. Some developers are great at what they know, but teaching them something new is next to impossible.



  • @antiquarian said:

    Wouldn't a competent C# programmer be able to learn Java relatively quickly?

    For me it was a toss of a coin whether to go Java or Microsoft route. On the basic level, they are almost identical. But then you start digging deeper and most of what you're doing are proprietary platform-specific frameworks, like WPF, WCF, ASP.NET, EF etc. Those things aren't the same.

    Occasionally I glance back at JAVA and make plans to do some catch up, so I don't close that door completely. However, the amount of buzzwords I'd have to learn is enormous. Back in the day, all I knew was basic java and desktop apps in Swing (and the other one, forgot its name). But now it's all spring and JWT and beans and struts and servlets and a thousand different things. I know JAVA the language, but to catch up with all that crap would probably take more effort than it's worth.


  • I survived the hour long Uno hand

    Spring seems okay. JWT, beans, servlets, and basically 99% of the crap out there is enterprisy WTF-ridden nonsense and can be safely discarded. Tomcat and JSP is fucking awful.



  • Ugh, that was the worst December in history.





  • @faoileag said:

    I have never experienced problems with outsourced team to that extent so far (/me knocks on wood), but I once landed a job where development was sourced back in-house from India for quality reasons.

    And it usually boils down to that single word: quality. You deliver quality software because you know you are going to work with it day-in, day-out. You know that good quality software is an investment, that will pay off eventually.

    For outsourced teams this is simply not the case. They get a spec, they produce something that will pass any user acceptance tests, and that is the proverbial it. They don't care about the quality because a) they don't get paid for that and b) won't be around long enough. A Chinese offshore team I once worked with had an average roll-over time of one year, meaning that after that time, none of the original team members was still on the team. You train them, you get perhaps three months out of them, they leave.

    This is why I'm vehemently against off-shoring: it devalues software development. No-one would operate a garage with the cheapest tools the local DIY has on offer, but for software development, people do exactly that.

    And it doesn't pay off. Neither in the short run (current project budget is met) nor in the long run. Put the hours of additional work caused by having to work with an offshore team down, add the cost of the off-shore and you might as well hire locally.

    I recently got in trouble for criticizing my company's code, calling it "consultant" code. A lot of it is done as quickly as possible, isn't reviewed, and has no planning for maintaining and supporting the code, and the workflow that it goes through. Nothing is named the way it should be, the exception reporting is barely there, and the usability is telling the user "it didn't work." Hence why I've fired up Word recently...



  • @Arantor said:

    I dread to think what Erik might do with it.

    Inner Platform ftw.

    Are you saying that this belongs in a database?


  • SockDev

    No, thank $deity.



  • brb, going to go write up some paperwork on the phrase "Inner Inner Platform"



  • Sounds like you're sitting on some front-page material.



  • @blakeyrat said:

    Ugh, that was the worst December in history.

    A lot of java apologists back then. Wonder where they are now?



  • @abarker said:

    ... they change the web service's URL every three or four days, without informing us.

    Not sure if TRWTF, but certainly my favourite WTF.


  • Fake News

    @cartman82 said:

    A lot of java apologists back then. Wonder where they are now?

    Meh, don't care enough.

    Those tools can work together just fine if you know them, but they can also quickly fail under abuse. So I for one can fully understand Blakey's ranting and I would have cut him some slack, contrary to the bashers coming out of the woodwork back then.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.