News for hackers. Stuff that matters.
Re:Dirty Coding Tricks by netcraft on Thursday January 08, 2015 @02:53PM (#8858516)
I came across code in a legacy web application one day, on a page that was probably the most used part of the application that was really nothing more than sleep(1000); I went through the version control history and found that is was a previous employee that would go in periodically and lower it any time he wanted to act like he had been working - he had started around 3.5 seconds.

Which reminds me of being a kid and mom telling me to turn down the tv - I would "accidentally" hit the wrong button and turn it way up for a few minutes, then just turn it back down to where it was.

Re:Dirty Coding Tricks by anotherevan on Thursday January 08, 2015 @04:25PM (#8859112)
I just recently heard a story that went the other way.

An engineer of elevator systems would spend hours doing all his calculations by hand, vowing it was too complicated and important to trust to a computer. (Yeah.)

The programmers in the company assured him they could write a program to do the calculations for him, which they did. He never trusted the results though, insisting that the program was not producing correct results.

One of the programmers realised that he didn't trust it because the program spat out the results almost instantly. It was too fast, it had to be wrong.

So he stuck a twenty second sleep in before the output, told the engineer he found the problem and fixed it. The engineer now felt the results were correct.

(Aside: I don't think I would want to get in a lift designed by an engineer who intuits the correctness rather than verifying the math, but I thought it was an interesting little parable on user interface design.)

Re:Dirty Coding Tricks by murbard2 on Thursday January 08, 2015 @06:33PM (#8859759)
Kayak does this when looking for flights. The results are instant, but by taking more time, it's giving the impression that it's trying really hard.
Re:Dirty Coding Tricks by jumanji on Thursday January 08, 2015 @09:41PM (#8860444)
Relevant discussion on the UX Stack Exchange: http://ux.stackexchange.com/questions/41682/pros-cons-of-spl... (which also links back to a story on HN about a locksmith.)
Re:Dirty Coding Tricks by cafard on Friday January 09, 2015 @11:52AM (#8863011)
That sounds a bit like the cake mix people who discovered that they got better sales if the mix required an egg to be broken and beaten into the mix. The taste was no different, but the cooks felt better. Or the antiseptic spray that added a component to give the sting consumers expected.
Re:Dirty Coding Tricks by 3pt14159 on Thursday January 08, 2015 @03:59PM (#8858985)
If I ever found out someone did this not only would I fire them, I wouldn't keep it a secret. I'd make sure everyone on the team knew exactly why he was fired. That is acting is gross bad faith. Think of the time it had cost all those people around the world just because he wanted a day off here and there. Blows my mind that someone would do that.
Re:Dirty Coding Tricks by netcraft on Thursday January 08, 2015 @04:03PM (#8859001)
With my example I agree with you - the example in the article is different though - putting artificial constraints into a project to encourage innovation and making sure you have the necessary resources - and then removing the constraint before you go live - isn't a bad idea IMO, especially when you are dependent on multiple teams. Think of it as resistance training :)
Re:Dirty Coding Tricks by samspot on Thursday January 08, 2015 @04:19PM (#8859084)
Not to defend this practice, but I heard a story about a whole team who put in a sleep that would automatically shrink over the first 6 months it was in production.
Re:Dirty Coding Tricks by pc86 on Thursday January 08, 2015 @05:13PM (#8859355)
I understand where you're coming from, and I agree with you, but we can't pretend that 1 second from 10,000 people is the even close to the same at 10,000 seconds from 1 person (or really anywhere in between).

The entire concept of "we saved 10 million hours of productivity by shaving 1.8 seconds off this process" is bunk. You saved 1.8 seconds of productivity n million times, which adds up to not a whole lot of extra productivity.

Put another way: Whether $APP takes 0.1 seconds or 1.9 seconds to do something does not at all change what time I'm leaving at the end of the day.

Re:Dirty Coding Tricks by sunfish on Thursday January 08, 2015 @06:12PM (#8859666)
User behavior when interacting with a program that responds in 0.1 seconds is drastically different than with a program that responds in 1.9 seconds; see [0] [1] etc. I agree it's not very meaningful to just compute the total number of seconds saved, but on the other hand, the productivity gain could easily be far greater than what that number suggests too.

[0] http://googleresearch.blogspot.com/2009/06/speed-matters.htm... [1] http://www.webperformancematters.com/journal/2007/7/10/accep...

Re:Dirty Coding Tricks by Swizec on Thursday January 08, 2015 @06:09PM (#8859655)
> Put another way: Whether $APP takes 0.1 seconds or 1.9 seconds to do something does not at all change what time I'm leaving at the end of the day.

But it does greatly change how annoyed you leave at the end of day.

Not to mention any noticeable delay in load times will quickly get people to start multitasking, which can easily change a 2s delay into a 2min delay. This can easily ... well it does make a difference.

I noticed this mostly while testing code. After clicking through the interface many times it can easily add up to an hour less actual work getting done that day.

Re:Dirty Coding Tricks by eloisant on Friday January 09, 2015 @11:42AM (#8862967)
Sometimes 2 or 3 more second is all it takes for the user to switch to procrastination "while it's loading" and waste much more time.
Re:Dirty Coding Tricks by Gravityloss on Thursday January 08, 2015 @05:31PM (#8859472)
Companies do this on a much bigger scale though. The logic of planned obsolescence is very much the same. You get more benefits doing worse than what you could do.
Re:Dirty Coding Tricks by nostrademons on Thursday January 08, 2015 @03:55PM (#8858953)
This is a pretty common sales & negotiation technique. Anchor high, with a much higher profit margin than you actually need. Do your best to get the customer to buy at the high price. Periodically, when you want to seem benevolent, offer a "sale" or "concession" that gets you down to what you were willing & able to do in the first place.

Every time you buy stuff on sale at the grocery store, you're seeing it in action, but you probably don't think much about it.

Re:Dirty Coding Tricks by rqebmm on Thursday January 08, 2015 @02:56PM (#8858537)
I first heard of "The Speed Up Loop" here: http://thedailywtf.com/articles/The-Speedup-Loop