Is it possible to invent a science that sets the rules for an ethical, logical and effective debate? Shams al-Dīn al-Samarqandī (died in the first half of the 14th century), a logician and Ḥanafī jurist thought it possible. He undertook the task of developing a general theory of scientific discussion that had a tremendous success and impact on Muslim scholarship. Ādāb al-baḥth wa-al-munāẓara, as he called it, is a set of ethical and logical principles, taken from Aristotelian logic and Islamic law. His major treatise Risālat Ādāb al-baḥth, initiated a new discipline in which dozens of treatises, commentaries and glosses were written. In my contribution, I will shed light on this neglected science, describe its structure, expose its functions and highlight its significance for the development of debates and intellectual dialogues in the later medieval Islam.