Hacker News new | ask | show | jobs
by jbyers 6816 days ago
These range from sensible to utterly useless [1,2,3].

I'd say forget all of this and focus on being a productive developer, building something people want, and ruthlessly avoiding premature optimization. When your application is slow, measure it to find out why, then fix it, and repeat.

1. Let's take #2, "echo is faster than print" - Seriously, is this what we should be worrying about? I can't detect a difference in PHP 5.2.4 across 100,000 echos/prints, so it must not be very big.

2. ++i vs i++ to squeeze out 1 fewer opcode?

3. Using isset($foo{5}) vs a strlen check? I pity the next programmer who has to read and understand the purpose of this code.