Do you log JavaScript errors on your live website?
I mean the actual JavaScript errors that usere experience?
If you do, what tool do you use and how is it working out?
If you don’t, why not?
Do you log JavaScript errors on your live website?
I mean the actual JavaScript errors that usere experience?
If you do, what tool do you use and how is it working out?
If you don’t, why not?
I only ever log errors for development purposes as using tools to log errors on a live site using JavaScript will use extra processing power that really doesn’t need to be used, if you feel you need to log errors on a live website more then likely the code isn’t scripted right as there should be no reason for errors to occur unless redundant or faulty code exists.
I know it sounds blunt but to be a good coder you need to ensure the code works before it goes live on the web and not rely on log functions to determine why it’s not working when it should have been tested before hand.
Hi SgtLegend
Thanks for your answer, I completely agree, a serious coder does everything he/she can to make sure their JavaScript it error free, and much can be done with testing and unit-tests of JavaScript etc.
But let me ask you this:
Are you 100% sure that you have no JavaScript errors on your site? On all possible browsers, on all possible OS’es and on all possible devices? Also on future browsers that are released all the time? As far as I’ve heard to only codebase completely without errors, is the software for the NASA space shuttle. Everyone else has between 0.1 and 50 errors per 1000 lines of code.
Do you log errors on your backend if there are server errors in you asp.net/php/jsp etc. ? Or do you just ignore any errors there because you are sure that there are no errors?
I mean, a JavaScript error can be just as bad as a server that is down.
Kind Regards,
Allan Ebdrup
Yep I’m 100% sure my website contains no JavaScript errors because i use a local development version of my website that i test with and ensure works in browsers including IE7+, Firefox 6+, Chrome 14+ etc. Modern browsers aren’t the issue of my focus when it comes to spotting errors but instead IE is since it uses an older revision of the ECMA scripting language.
My main goal as a developer is never to overflow the site with just JavaScript, i try to maintain a balance between HTML, CSS and JavaScript that way when they all come together they work in sync with one another which is always a challenge but achieves the goal i set myself before hand.
I’m not saying i don’t ever get errors but i always have my local development to fall back on before i launch the changes live, if i do however get any errors that are not JavaScript related i will let PHP use its built in log management to write the errors which i check regularly and since launching my site have had none but apart from that i don’t rely on any production level logging because i expect the code i use to work like it should from development to production and so far it’s done just that.
Some coders do get errors and some don’t so everyone is unique but having a development and production side of a website will help to ensure that no errors do occur and users stay happy while visiting your website.
Hi SgtLEgend
You write:
“Yep I’m 100% sure my website contains no JavaScript errors”
That’s a bold statement. Could you share what your website is? If it contains anything but extremely trivial JavaScript, I’m willing to bet you $1000 that if you install a JavaScript error-logger it will log JavaScript errors. I mean if you are truely 100% sure, that’s money in the bank for you.
You write:
“I’m not saying i don’t ever get errors but i always have my local development to fall back on before i launch the changes live, if i do however get any errors that are not JavaScript related i will let PHP use its built in log management to write the errors which i check regularly and since launching my site have had none but apart from that i don’t rely on any production level logging because i expect the code i use to work like it should from development to production and so far it’s done just that.”
How do you know it works in production if you get absolutely no notificatin if there is an error?
You write:
“Some coders do get errors and some don’t”
I disagree, all JavaScript-coders and I do mean every single one, get errors. Scientific research has shown just that, try googleing it a bit, see http://amartester.blogspot.com/2007/04/bugs-per-lines-of-code.html for example.
I guess you can confidently say that when your portfolio page is a Wordpress theme built by somebody else and would have therefore been extensively tested by them prior to releasing it for sale
That’s a perfect example of when you really need to log JavaScript errors. When relying on 3rd party JavaScript
That’s a bold statement. Could you share what your website is? If it contains anything but extremely trivial JavaScript, I’m willing to bet you $1000 that if you install a JavaScript error-logger it will log JavaScript errors. I mean if you are truely 100% sure, that’s money in the bank for you.
I visit my website everyday and i have had no JavaScript thus far because i tested it before i uploaded it, I’m not trying to sound perfect but i simply take the steps to ensure that when someone visits my website that they share the same experience to someone else.
How do you know it works in production if you get absolutely no notificatin if there is an error?
Same as my above statement, if it doesn’t work locally then i know it won’t work live. Nothing changes between my development and production servers because there’s nothing that can change between them, i wouldn’t be a very good developer if something changed while updating the files and such.
I disagree, all JavaScript-coders and I do mean every single one, get errors. Scientific research has shown just that, try googleing it a bit, see http://amartester.blogspot.com/2007/…s-of-code.html for example.
The problem with studies like these is they generalize it to a perfection condition in which the developer is coding in, a lot of developers use software that has built in error tracking so if a JavaScript error is found the developer can fix it way before they load it in the browser.
Sure this isn’t very effective for DOM manipulation but for the general range of JavaScript that is released is helps substantially overall.
I guess you can confidently say that when your portfolio page is a Wordpress theme built by somebody else and would have therefore been extensively tested by them prior to releasing it for sale
I bought the theme and tested it locally before my site went live, just because i bought it doesn’t mean i trust it doesn’t have errors but i like to do my own testing. I have full confidence in the designer who released and always will because he uses what i assume is his own base template which allows for quick and easy releases without painful JavaScript debugging.
Why would you bother with the overhead associated with logging any errors found in the JavaScript after it goes live? By the time you implement it you will have already put as much effort into testing it to minimise errors as the script is worth to you. If it were worth more then you’d get better value from running more tests before implementing than you ever would from logging errors on the server after implementation.
For example - suppose an error would cost you a visitor and suppose that the overhead of logging the errors on the server slows the loading of the site so that you lose a visitor a week. That means that you need to find and fix at least one error a week from the logging just to break even. Of course the overhead is far more likely to cost you visitors than the error is so its probably more like needing the log to locate a dozen or more errors a week to break even. Assuming you tested properly in the first place the chances of logging even finding one error a month is probably remote (unless they are errors that you know are there and know are completely invisible and harmless in which case they are just cluttering the log and making it harder to find errors that actually need fixing).
If you think logging JavaScript errors on the server is worth it then I have some cheese that you will want to buy to make your car fly faster.