The Internet of Things (IoT) and the number of deployed IoT devices are growing exponentially nowadays. These devices play pivotal roles in diverse domains, e.g., smart homes. Given their constrained processing and memory capacities, IoT devices communicate with one another through specialized protocols. The two main IoT communication protocols are the Constrained Application Protocol (CoAP) and Message Queuing Telemetry Transport (MQTT). By March 1, 2023, there were 35 public libraries of CoAP and 40 of MQTT. These libraries have different characteristics, including levels of completeness and runtime performances. Because of diverse requirements in different domains, the same protocol/library does not apply to any applications. Consequently, developers must select a library (e.g., Californium, java-coap, Paho MQTT, or HiveMQ MQTT Client) but they do not have access to comprehensive and clear comparisons of the API and performance of these protocols and their implementations, impeding their ability to make informed choices. In this thesis, we implement multiple IoT scenarios using the CoAP and MQTT protocols and several of their implementation libraries. We conduct a comprehensive comparative analysis based on API and performance metrics, including static metrics, packet sizes, and runtime performance. We thus provide developers with evidence to choose between CoAP and MQTT protocols and their libraries. In future work, we will expand this work to include other IoT protocols and libraries, more scenarios and metrics.