JavaScript delete needs to be called twice...!



  • Ok so, javascript delete construct apparently need to be called twice...

    delete Obj.currentObj;
    ... <no code that modifies Obj.currentObj>...
    if(Obj.currentObj){
        delete Obj.currentObj;
    }
    

    My only guess is that nobody wanted to touch any of this spaghetti code, caz they are scared of being blamed of fucking it up and being forced to maintain it.



  •  Your WTF is about as good as your spelling.



  • is that caz you love my spelling, and wish for such superior skills?



  • Do you even know what spaghetti code means? Because this isn't it.



  • @SlyEcho said:

    Do you even know what spaghetti code means? Because this isn't it.
    How about jumping though 10 files (bloated ones) with no clear separation of MVC in any shape or form, where a global variable is set somewhere and then referenced for some specific functionality which was used to forward a request to somewhere, and I need to find that somewhere. Its easier to just put write lines all over the code to see the execution path. O and there is no debugger so I can't inspect what the variable is at run time. This is server-side javascript baby!



  • I'm sorry I oversimplified, the global object is a dynamic object with functions being set at runtime from unknown locations. Also the code tabbing is horrific and tons of no-curly-brace if statements which together make for unreadable code. To be able to follow a function I need to reformat it, and no formatter is available because this is non-standard file structure.



    Did I mention that coincidentally the entry point is called pos.xml?



  • @astonerbum said:

    How about jumping though 10 files (bloated ones) with no clear separation of MVC in any shape or form,

    Because separating code into consistent layers must be MVC.

    @astonerbum said:

    To be able to follow a function I need to reformat it, and no formatter is available because this is non-standard file structure.

    You fail at reading code.



  • @Sunstorm said:

    @astonerbum said:

    To be able to follow a function I need to reformat it, and no formatter is available because this is non-standard file structure.

    You fail at reading code.

     

    And apparently copy/paste.



  • @astonerbum said:

    I'm sorry I oversimplified, the global object is a dynamic object with functions being set at runtime from unknown locations.
     

    Sounds like PHP.  Lovely.



  • @clively said:

    @astonerbum said:

    I'm sorry I oversimplified, the global object is a dynamic object with functions being set at runtime from unknown locations.
     

    Sounds like PHP.  Lovely.

    You do realize that this is possible in any dynamic language and that PHP does not encourage abuse of dynamic constructs more than any other language? 



  • @morbiuswilters said:

    You do realize that this is possible in any dynamic language and that PHP does not encourage abuse of dynamic constructs more than any other language? 

    Lies. Chapter 2 of the PHP manual is entitled "How to Write Terrible Code." Chapter 1, of course, is a series of images depicting how to install PHP without drooling on your keyboard too much.



  • @MasterPlanSoftware said:

    @astonerbum said:
    is that caz you love my spelling, and wish for such superior skills?

    Thanks for being a useless troll.
    Hmmmm, pot calling kettle black?


Log in to reply
 

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