23
msdsk
5y

Today I have spent 2 hours trying o figure out why my code wasn't executing at all.
It was a typo.
"assFields" instead of "addFields".
I need sleep.

Comments
  • 5
    And that's why we don't use dynamic languages
  • 2
    @12bitfloat

    technically it was perfectly fine even with proper type checking; just an optional parameter passed as an object property. I'm afraid nothing could really save me from my hubris.
  • 1
    @msdsk TypeScript actually supports that which is quite cool.

    function foobar(param1: string, opts?: {yes?: bool, addtional?: string})

    which is then used normally

    foobar("param", {yes: true})
  • 0
    @12bitfloat

    True, though for this project it would need to be a bit smarter than that - it's a back end project glued from files with `module.exports={(...)}` with a custom inheritance mechanism.
  • 2
    @msdsk Oh... Oh no
Add Comment