Coding conventions are a set of coding guidelines used by software developers to improve the readability of source code, increase software maintainability, and promote the reuse of coding patterns. In this paper, we introduce CCBase, a knowledge base of coding conventions, that was constructed from online resources. Specifically, CCBase was constructed as follows. We designed the ontology of the coding convention domain, crawled data related to coding conventions from a variety of online resources, and then extracted entities and relations using an NLP-enabled rule matching method. To uncover the latent relations, we further proposed a similarity metric to reveal the similar-to and relate-to relations, and developed a RCE algorithm to establish a unified type hierarchy of coding conventions. The resulting knowledge base contains 3139 coding conventions for Java and C++, with 3761 entities and 767 relations. Furthermore, we have extended the usability of CCBase by developing a question answering system on the base. We have conducted experiments to evaluate CCBase. The experimental results show that CCBase has a wide coverage on entities and relations in coding conventions domain, and the QA system achieves an F1 score of 84.5% on 214 questions raised in StackOverflow.