Debugging Javascript is like ...

View Poll Results: Debugging Javascript is like ...

Voters
3. You may not vote on this poll
  • debugging assembler.

    0 0%
  • driving with a blindfold.

    1 33.33%
  • passing through hell.

    0 0%
  • being bitten by 1000 mosquitoes in a dark room w/o air conditioning in the summer in New Delhi.

    0 0%
  • (I like my suggestion better).

    3 100.00%
Multiple Choice Poll.
Results 1 to 14 of 14

Thread: Debugging Javascript is like ...

  1. #1
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,723

    Debugging Javascript is like ...

    I note a real dearth of similes for debugging Javascript on the 'Net. A Google Search for the specific term only yields a few results.

    I'll let you:
    1. vote on the current "best" simile; and
    2. propose a new one.


    I expect, if we're lucky, we can create a new meme.

    Good luck!
    Last edited by dalecosp; 09-14-2012 at 11:23 AM.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  2. #2
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,432
    I'm confused... do you use the Chrome web browser? I've found debugging Javascript to be quite easy, actually.

  3. #3
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,723
    It's much easier since FireBug was written, and Chrome's tool is nearly as good.

    Still, compared to, say, PHP, debugging Javascript is like herding cats.

    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  4. #4
    Senior Member traq's Avatar
    Join Date
    Jun 2011
    Location
    so.Cal
    Posts
    949
    yeah - before every browser came with a console, however, I'd completely agree.

  5. #5
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    13,974
    ...like debugging PHP, just a bit worse.
    Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

    "But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because he’s a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html


    eBookworm.us

  6. #6
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    1,787
    I find debugging Javascript to be like... walking without moving my arms.

    Its a simple task if you can stay focused on it, but one distraction and things start moving again!
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  7. #7
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    13,974
    All I know is, I do both of these things more than I probably should have to:
    PHP Code:
    die("<pre>".print_r($something,1)."</pre>"); 
    Code:
    alert(some_variable);


    PS: For the first one, I have a keyboard macro in Komodo edit -- actually 2: one that creates that die() statement with a generic variable name, and one which creates it using whatever is in the clipboard for the variable name.
    Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

    "But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because he’s a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html


    eBookworm.us

  8. #8
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,723
    Quote Originally Posted by NogDog View Post
    Code:
    alert(some_variable);
    That is totally what this morning's been like, and still no *real* progress.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  9. #9
    Pna lbh ernq guvf¿
    Join Date
    Jul 2004
    Location
    Kansas City area
    Posts
    19,432
    Yikes... I can see why you'd be doing it 10 years ago, but why mess with alert() nowadays? Fire up Chrome (perhaps FireBug does this as well?), set a breakpoint in the JS code, and start hovering over variables.

  10. #10
    Senior Member
    Join Date
    Mar 2009
    Posts
    812
    Debugging JavaScript is like going outside during a thunderstorm and attempting to dodge rain.


    Quote Originally Posted by NogDog View Post
    All I know is, I do both of these things more than I probably should have to:
    PS: For the first one, I have a keyboard macro in Komodo edit -- actually 2: one that creates that die() statement with a generic variable name, and one which creates it using whatever is in the clipboard for the variable name.
    I use a similar technique in Komodo Edit; I've created a code snippet with the abbreviation "print", with a tab stop for the variable name. I just type "print" and hit ctrl-t and my cursor is immediately placed to where I need to enter the variable.
    Declare variables, not war.

  11. #11
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,723
    Quote Originally Posted by Bonesnap View Post
    Debugging JavaScript is like going outside during a thunderstorm and attempting to dodge rain.
    Naked.

    I'm going to amend mine: "Debugging Javascript is like herding cats with Linux".

    Debugging PHP is like herding cats with FreeBSD, a fence, and an electric cattle prod.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  12. #12
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,723
    A new discovery (for me) ... debugging Javascript ... in PDF documents.

    That's kinda like stabbing yourself over and over with a pitchfork.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  13. #13
    Senior Member
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    753
    Quote Originally Posted by dalecosp View Post
    A new discovery (for me) ... debugging Javascript ... in PDF documents.
    Javascript shouldn't even be in those types of documents in the first place, I feel your pain :-/
    Ashley Sheridan
    www.ashleysheridan.co.uk

  14. #14
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    7,723
    Quote Originally Posted by Ashley Sheridan View Post
    Javascript shouldn't even be in those types of documents in the first place, I feel your pain :-/
    Hee hee, true; fortunately the marketing department is handling that. The only problem ... no programming experience. So, I spent a couple hours with a young lady over there trying to make some things work. For her, it's knowing how to program ... syntax, curly braces and conditionals and such. For me, it's the different (unique?) DOM for a PDF...

    At least it was a change from "normal", which is occasionally a Good Thing(tm). I've not heard much more about it this week. I think she's waiting 'til after the Thanksgiving holiday here.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •