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:
vote on the current "best" simile; and
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 10: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
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
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
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
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
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
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.
Debugging JavaScript is like going outside during a thunderstorm and attempting to dodge rain.
Originally Posted by NogDog
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.
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
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
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
Bookmarks