By shifting the balance between conformational entropy and internal energy, polymers modify their shape under external stimuli, such as changes in temperature. Prominent among such transformations is the coil-globule transition, whereby a polymer can switch from an entropy-dominated coil conformation to a globular one, governed by energy. The nature of the coil-globule transition has remained elusive, with evidence for both continuous and discontinuous transitions, with the two-state behaviour of proteins as an instance of the latter. Theoretical models mostly predict second-order transitions. Here we introduce a model that takes into consideration hitherto neglected features common to any polymer. We show that a first-order phase transition smoothly appears as a function of the model parameters. Our results can relieve part of the conflicts between theory and experiments in the field of protein folding, in the wake of recent studies tracing back the remarkable properties of proteins to basic polymer physics.