Live data from Hacker News

Rick Santorum's Fake Donation Meter

ricksantorum.com

71–80 of 100 posts

Re: Rick Santorum's Fake Donation Meter

#71
post #53
post #6

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.

But when writing code, how do you know that it's always going to be "single page bound"? YAGNI is frequently useful poison and nothing more. When it's so easy to do it right the first time, why not?

Re: Rick Santorum's Fake Donation Meter

#72

What? 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…

Seems a like a bit of an exaggeration to peg the OP as "outraged". They simply provided a link to an untruth.

Re: Rick Santorum's Fake Donation Meter

#73
post #6

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?

Was just looking at namespace best practices today for a utility library I was implementing. Is there a defacto standard?

The defacto standard is to put nothing in an enclosing namespace unless it's needed there. The purpose of functions (especially in a language like JS) is to wrap up everything that's needed to accomplish a given task and leave no mess behind.

Re: Rick Santorum's Fake Donation Meter

#74

What? 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…

Actually this raises some interesting questions when you think about how the average person is going to think when they see something like this. First impressions to normal people are that they would be real-time given the instantaneous nature of the internet.

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

#75
post #27

I 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…

In this [your] case, it should be just a matter of personal taste.

We choose to go to the moon!

Re: Rick Santorum's Fake Donation Meter

#76
post #70
post #53

Earlier 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.

>> It's a telltale sign of a bad developer

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.

Re: Rick Santorum's Fake Donation Meter

#78
post #50

Earlier quoted context omitted.

That was a fast response. Does someone on HN work for Santorum?

I tweeted it: https://twitter.com/espeed/status/206150118083280897

you have 211 followers .. I don't think you have wider reach than HN.
Post reply on HN