# How to start a new page when a second section appears on the same page?

I have a chapter with many sections, but they are of varying lengths. I want a new section to appear right after the previous one finishes (which happens normally) -unless- two sections end up on the same page. Right now, I'm manually adding \newpage if two sections appear on the same page. Is there a global way to do this? I'm working in the book class.

\documentclass[12pt]{book}
\begin{document}
\chapter{thefirstchapter}
\section{long section}
\section{long section}
\section{short section}
\newpage
\section{long section}
\section{short section}
\newpage
\section{long section}
\end{document}


Based on this entry, I started to use \clearpage{} instruction instead of \newpage{}. Because the former not only starts a new page, but ensures (still floating) objects like tables, and figures of the old section to come up before entering a new section. (Otherwise it may be distracting the reader if for example an experimental section contains tables from the theoretical section because LaTeX's floating algorithm assumes «and now here is enough space for it».)
Or, you split your document -- each section its own file, eventually brought together into a main document with the \include{file} pattern.