• Wilson (unregistered)

    This is all seeming very familiar.

  • Pjrz (unregistered)

    Usual story.

    High-ups only see the immediate cost: 1000 pounds for a pair of chimpanzees or 100000 pounds for a professional developer. Lets go with the chimps!

    Any attempt to explain how a badly written pile of junk that doesn't even do what they want is going to cost the business a hundred times more over a year due to maintenance, squeezing extra features into a pile of spaghetti code, bug fixes etc is never going to work, because these same people cannot see past the end of the day let alone the end of the next year (plus they get the immediate credit for getting something done cheaply; any problems after initial roll-out will be the fault of the in-house developers of course).

  • K. (unregistered)

    The code in this article makes me feel like I am reading a Franz Kafka novel...

  • Andy F (unregistered)

    Yep, you're bound to get shoddy outpout from lowest-bidder contractours.

  • djingis1 (unregistered)

    As always, you get what you pay for.

  • Ever heard about KISS (unregistered)

    Why worrying about different data types if you can use strings for everything? IMHO this practice only makes the code more manageable.

  • Ever heard about KISS (unregistered)

    On top of that the code is properly formatted and nicely documented. Like a pro. Pull request approved.

  • Zenith (unregistered) in reply to Ever heard about KISS

    Same kind of idiocy that I see reviewing code where everything's a string because reasons. Why return true/false or integers when you can return a dozen variants of "success" all checked for in full case sensitivity?

    Although...I have to ask what's wrong besides the conversion to string in GetIntegerValue(). I have a dozen such functions in a library, except the return and default are nullable, so that overloads that need a type to come out can just call GetValueOrDefault() on the result. Because 1) I got sick of Int32.TryParse() structures everywhere and 2) NULL and 0/blank are often functionally equivalent.

  • Zenith (unregistered)

    That company is just compounding its problems going with MVC and lowest bidder. Where I work, MVC is treated like a silver bullet - "if only all programs were MVC, any developer could do anything good and fast and cheap!" So they're always agitating to take programs that are well written with no/low maintenance costs and ruin them with an MVC rewrite. When you have a lousy contractor that writes a regular program, you can eventually fix it. When you get these MVC clowns doing 20 layers of JScript services over Entity with NuGet, it's all but impossible to untangle it without changing the underlying design and every place that I've been saddled with such a nightmare even suggesting such a change is a cardinal sin. When you can't spin straw into gold with one spinning wheel, they get another and another and another, because nobody wants to lose face by admitting a poor choice of design or tool is really to blame.

  • Colin (unregistered)

    Good - Fast - Cheap

    Choose two

  • MiserableOldGit (unregistered)

    I think they chose the third on it's own.

    It won't work out that way, Oh God no.

  • Somebody Somewhere (unregistered)

    From the looks of it, I'd guess that at some point their developers were shouted at for using floating point because it "wasn't accurate enough", so they decided to give themselves all the numerical accuracy they'd ever need by making all their numbers strings.

    It's all obviated, of course, by the final function which converts the string-number to the decimal type, a type that was specifically designed for high precision, but there's a reason these people were the lowest bidders.

  • Parametamolcil (unregistered) in reply to Colin

    I always state it as "choose two or less." It's quite possible to pick zero out of the three.

  • jeepwran (unregistered)

    That GetIntegerValue code is probably the most WTF'd up thing I have ever seen... and WTF is the special char that ClearSpecialChar is clearing?

  • ooOOooGa (unregistered)

    Well, the function GetDecimalPlaceValue does appear to do rounding correctly as long as you are rounding to the 5th decimal place. And since that is the case that is mentioned in the comments, then the comments are in fact accurate.

    I don't think that knowing those facts makes me feel better about this code though. Instead it just shows what test-driven development degrades to when done wrong.

  • Brian (unregistered)

    So they should have used highly-paid consultants instead? Surely that would have resulted in excellent code quality with no maintenance problems whatsoever.

  • (nodebb)

    Built-in libraries are hard.

    But then again, the contractors were being paid to write code, even if it means reinventing the wheel.

    I'd love to see what they do with dates.

  • siciac (unregistered) in reply to Brian

    Paying out the ass for consultants works so well for the government, after all.

  • Zenith (unregistered) in reply to siciac

    The public pushes for privatization because they think it's cheaper (it's not), the contractors perform terribly but slap state branding on the raging dumpster fire, and the public ignorantly blames public employees for a clusterfuck that they weren't even remotely responsible for.

  • dpm (unregistered) in reply to slavdude

    Ladies & Gentleman, I give you the winner of the "Masochist of the Year" award.

  • Peter Wolff (unregistered) in reply to Ever heard about KISS

    Strings as general type for everything - that's what it's like with DOS/WINDOWS batch variables.

    And (Apple's) HyperCard. Where we have autonymy for the [del]programmer's[/del][ins]code chimp's[/ins] convenience: if a variable name is undefined, it is replaced by the name as a string constant.

  • Peter Wolff (unregistered) in reply to Parametamolcil

    Yes, and it is quite possible to pick one, in particular 'cheap', get none of the three.

    Btw, I really miss the triangle with 'cheap' at the bottom in Wikipedia's article about the Project Management Triangle. I can only guess why they removed it - maybe because too many PHBs said, 'as you clearly can see: "cheap" is the base of all three!'

  • Peter Wolff (unregistered) in reply to Pjrz
    any problems after initial roll-out will be the fault of the in-house developers of course

    Not for long. Developers will leave for green(er) pastures soon, and what remains (and what the new hires will be) are just another bunch of chimps.

  • 🤷 (unregistered)

    Moderation held for comment.

  • MiserableOldGit (unregistered) in reply to siciac

    My experience of Gubbermint contracts is that they might go find some well known consultancy firm who promises that you get best-of-breed skills for thousands per day, but all they do is farm it out to subbies, grads and outsourced partners in India. Sometimes they get lucky (like, they get me :D), but usually it's practically the same as lowest bidder stuff.

    I've seen my own time getting billed out at 4 times my day rate, and I'm not exactly cheap. If they could get some poor sap with the appropriate clearances for half the price, they most certainly would, but they wouldn't reduce their rate if they did.

  • JTK (unregistered)

    I just spent a large part of a development cycle ripping out a crap-ton of very similar nonsense from some WPF code written by some former WinForms programmer. His problem seemed to be thinking that since XAML textboxes display strings, then all numeric values must be converted to strings from the get-go and then manipulated in string form. I wrote a simple subclass of the Textbox control that accepted decimals and was able to get rid of a boatload of scary stuff like this.

  • Dlareg (unregistered)

    In engineering we always say:

    You think I'm an expensive engineer? Try and hire a cheap one and see what it costs you?

  • Carra (unregistered)

    This reminds me of the time that one of our developers was writing his own Trim() code.

    You can do it but why not use the C# library...

  • CodeMonkey (unregistered) in reply to Carra

    My co-worker wrote a Trim function using Regex because the build-in Trim function couldn't remove a certain space character at the end of a string. I took a look at the string and found that it was not the usual space character (0x32h) but another space character (0xAOh).

  • CodeMonkey (unregistered)

    Sorry, it's 0x20h, not 0x32h. 32 is the decimal value of 20h.

Leave a comment on “Lowest-Bidder Conversion”

Log In or post as a guest

Replying to comment #:

« Return to Article