A few days ago I stumbled upon the new Google "Let's make the web faster"-page. I found some useful tips on there. Some of them are public knowledge, for example the fact that using echo in php is faster than print, single quotes are faster than double quotes and echo supports endless arguments, which is faster than string concatenating (so you write echo 'this', $is, 'faster than', $concatenating, 'the string' instead of echo 'this' . $is . 'slower').
However, there's a nice article about ommitting html tags, which had some tips I did not know. For example, if you're using HTML, instead of XHTML, you're allowed to ommit more tags than most people know. For example, you don't need to close a paragraph, you can just start a new one. For the complete list, have a look at the articles section of the site.
Tag Archives: php
Reply
Magic c-style comments
A friend/collegea of mine had a really cool idea about c-style comments. C-style comments are multi-line comments that start with /* and end with */. They can be used in C, C++, C#, PHP, Java and a other languages. When this friend debugged some code, he found himself switching some blocks of code on and off all the time. He came up with a solution to switch between two blocks of code by just removing or adding one character!
See for yourself at: http://blog.mycroes.nl/2009/04/magic-comments.html