• Tim (unregistered)

    At this point just vibe code ts - can't even get worse...

  • AzureDiamond (unregistered)

    another reason kotlin is better than java. optional parameters are just fun foo(arg0: String, arg1: Int = 0) not 3 lines of boilerplate for every optional so theres no reason to avoid them

  • (nodebb)

    Wait, they're worried about having to modify the parameter list because of database changes, but not about having to modify the code processing the parameters? You moron, you have to modify code anyway, why not have compile-time checked parameters? :FACEPALM:

  • Hans (unregistered)

    "No, all of our arguments are required. We'll just default the ones that the caller doesn't supply."

    I can't quite get my head around this: required arguments, but the user doesn't need to supply them? And then just take a default value?

  • (nodebb)

    It's universal code, no matter what the universe wants, this code can handle it! Right up until it crashes the universe.

  • (nodebb) in reply to AzureDiamond

    This is C#, not Java. And it also has optional parameters.

  • (nodebb)

    I've personally witnessed this happen like eleventy-billion times. The worst was a contractor that created a general-purpose method to be used by any code that calls a stored procedure. The method inspected the proc and dynamically created local parameters for any parameter define on the procedure, then did something very similar to today's WTF.

    It was just as bad as today's submission, with one bonus. We couldn't ever add any parameters to a stored procedure without simultaneously rolling out code updates. Sure, SQL Server supports default parameter values for parameters not supplied by the client, but the genius that wrote this code inspected the proc at run time, so all parameters were always supplied, even those added to the procedure later.

    Another variant of this is "Let's put the code in a stored procedure so we can change it without the hassle of change-control approval!!". Wait, what?

  • (nodebb)

    "Let's put the code in a stored procedure so we can change it without the hassle of change-control approval!!"

    Hmmmm....

    I do that a fair bit on the two web applications I'm maintaining, but not to avoid the code-review process --- that still happens. I do it to simply run an ALTER PROCEDURE script and avoid deploying the application. Am I guilty of non-optimal practices?

  • (nodebb)

    Makes me flash back to the glory days of C (especially real mode!) where you passed a pointer to a blob of memory and assumed the receiver knew what it meant.

  • TrueWill (unregistered)
    Comment held for moderation.

Leave a comment on “An Array of Parameters”

Log In or post as a guest

Replying to comment #:

« Return to Article