I find it most disturbing that they are polluting the global namespace with all those variables and functions. Don't JavaScript developers these days understand how to properly scope their JavaScript?
As long as it's "single page bound" JS like this, I honestly don't think it matters one bit. Reusable components and utility libraries is something different, of course.
Rick Santorum's Fake Donation Meter
71–80 of 100 posts
Re: Rick Santorum's Fake Donation Meter
#72What? You mean a politician was using a simulation and presenting it as definitive? I'm shocked I tell you, shocked! (with apologies to Captain Renault :-) You could just read the quarterly reports he files with the FEC if you actually wanted to know how much he was bringing in. I suppose you could get him in hot water as an ethics violation for campaign reporting but outrage? A bit over the top I think. There are bi…
Re: Rick Santorum's Fake Donation Meter
#73I find it most disturbing that they are polluting the global namespace with all those variables and functions. Don't JavaScript developers these days understand how to properly scope their JavaScript?
Was just looking at namespace best practices today for a utility library I was implementing. Is there a defacto standard?
Re: Rick Santorum's Fake Donation Meter
#74What? You mean a politician was using a simulation and presenting it as definitive? I'm shocked I tell you, shocked! (with apologies to Captain Renault :-) You could just read the quarterly reports he files with the FEC if you actually wanted to know how much he was bringing in. I suppose you could get him in hot water as an ethics violation for campaign reporting but outrage? A bit over the top I think. There are bi…
Regardless, it's almost certainly false advertising which as you mentioned is ethically questionable especially since this is supposed to be a 'leader' of citizens.
Re: Rick Santorum's Fake Donation Meter
#75I don't think there's anything wrong, in principle, with this approach, so long as the simulated rate is calibrated frequently to the actual average donation rate. Having it all wired up properly would require a whole lot of infrastructure, particularly for donation mechanisms that aren't online and aren't all tied in to a single system.
This is how I do it on my personal website ( http://samryan.co.uk/ ). It makes no sense for me to put together a real automatically updating counter so every couple of days I check the real growth rate and adjust it manually. It obviously looks shady on a politicians website and I think doing it with something like donations where it's tied to a real world action is a bit... silly and they should have disclosed that…
We choose to go to the moon!
Re: Rick Santorum's Fake Donation Meter
#76Earlier quoted context omitted.
As long as it's "single page bound" JS like this, I honestly don't think it matters one bit. Reusable components and utility libraries is something different, of course.
It's still incredibly error prone and just bad practice. It's a telltale sign of a bad developer because a good dev would instinctively just use var without thinking about it. Good devs may make a mistake here or there but this is clearly well beyond a forgotten var keyword.
I'm just guessing, but the site was probably not developed by a technical team, probably some web shop that specializes more on the design/layout/content side and not on the JS side.
So it's likely it's the work of a non-developer than a bad developer. The net result is the same (bad code) but the distinction is that the code was possibly written by someone who wouldn't even be considered a developer.