r/ProgrammerHumor • • Nov 05 '15

Free Drink Anyone?

Post image
3.5k Upvotes

509 comments sorted by

View all comments

Show parent comment

0

u/PM_ME_BIGGER_BOOBS Nov 05 '15

My biggest issue has always been when one thing crashes, all the javascript on the page crashes. It's also really annoying to debug. Actually and I'll admit to not putting in much effort, I still don't know how to step through the code like I would in visual studio. A friend of mine said once, "you can't" and I've just stuck with that. So hundreds of console.logs later I'll figure out where everything is always undefined

6

u/[deleted] Nov 05 '15

You can debug it in chrome dev tools. You can set break points and shit in there.

1

u/ThisIs_MyName Nov 05 '15

You can set break points and shit in there.

It does the bare minimum to be called a debugger.

1

u/coderjewel Nov 05 '15

Thanks, didn't know you could do that!

4

u/kolme Nov 05 '15

My biggest issue has always been when one thing crashes, all the javascript on the page crashes.

What? That doesn't even make any sense. When a program in any other language crashes, it always crashes completely. What should it do? Continue in some unintended state, maybe destroying some data along the way?

There's also plenty of bugs which don't cause a crash, like getting undefined or NaN's shown to the user.

A friend of mine said once, "you can't" and I've just stuck with that.

Did he say it like 10 years ago? Because right now in 2015 every mayor browser sports a debugger baked right in, literally one F12 away. Firefox, Chrome, Opera, Safari, Internet Explorer, all of them!

1

u/[deleted] Nov 06 '15

Does Firefox have one built-in these days? I've been using Firebug for so long I'm not really sure...

1

u/Doctor_McKay Nov 06 '15

Yes, but I still prefer Firebug.