Strategic patenting is widely believed to raise the costs of innovating, especially in industries characterised by cumulative innovation. This paper studies the effects of strategic patenting on R&D, patenting and market value in the computer software industry. We focus on two key aspects: patent portfolio size, which affects bargaining power in patent disputes, and the fragmentation of patent rights ('patent thickets') which increases the transaction costs of enforcement. We develop a model that incorporates both effects, as well as knowledge spillovers. Using panel data for 121 firms covering the period 1980-99, we show that strategic patenting and spillovers affect innovation and market value of software firms, that there is a patent premium accounting for 20 per cent of the returns to R&D, and that software firms do not appear to be trapped in a prisoners' dilemma of 'excessive patenting.