Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You didn't like debugging with window.alert()?


For anyone still/stuck with console debugging, “pro” tip:

JS ignores the value of every statement in a comma-separated expression except the last one. So you can do trash like this:

    const foo = (bar) => (
        console.log(bar),
        someComputationOf(bar)
    );
And log-debug without restructuring your otherwise pure function.


I remember running in a frame set just so I could document.write instead of a million window.alert. Fun times.


This is a brilliant idea. Where were you back then? I would've benefitted immensely from a Xanga or LiveJournal post about this.


It’s really funny how isolated the Webdev world was back then. (Or at least I was).

I take stackoverflow and blogs for granted.

I did have a hand-rolled blog back then (The Hole Report) but was busy writing about magic tournaments and didn’t think anyone else cared about javascript hacks.


this gave me a vivid image of young me flailing around in the dark trying to understand why undefined is not a function


The worst was when I discovered all console.log() crashed because IE6 left “console” as undefined until the developer tools were open.

Fortunately another bad feature of IE was to alert() the errors, so customers were aware of each of them and could easily send us the bug back...

This bank employee used PrintScreen to print the screenshot on paper. He the successfully faxed it to his email, zipped it and uploaded it to our bugtracker. I had the zip of a .tiff of a scan of a printed screen. I still wonder whether he did it because he was upset, or whether it was a usual workflow.


probably a temporary ad hoc process that is now permanently etched into their brain


[object Object]


I remember filling js files with alert messages back in 2004. Imagine the joy debugging a 15k line js codebase back then.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: