Minecraft wiki entry for Time-saving_tips, associated text: A quick way to clear or collect cactus or sugar cane is to destroy the bottom cactus/sugar cane block, at which point the entire plant will collapse into retrievable items. Digging out the block below it works the same way.
When farming, leaving the bottom-most cactus or sugarcane block behind will save you the time needed to re-plant it. However, this is a little risky for cactus, as the remaining block may destroy the dropped items.
For sugar cane only, temporarily blocking off the plants' water supply and then harvesting one plant can cause an entire row to collapse. Note that the exact behavior may depend on how the plants are arranged.
For cactus, placing a block (dirt or sand will do fine) next to the plant will make it drop. If they are arranged in a checkerboard pattern, you can harvest two or three plants at once this way. The block can also be placed higher, to harvest just the segments from the block's level upward.
By lining sugar cane 'up' in a straight line and running while aiming slightly up at the second sugar cane block, you may harvest sugar cane quickly and efficiently. Aiming up ensures you do not destroy the base so that it may regrow.
For cactus you can displace the sand underneath it with pistons. This way all cacti will drop down so you can farm entire sections of your cactus farm without breaking blocks.