  Context: IoT systems, networks of connected devices powered by software,
require studying software quality for maintenance. Despite extensive studies on
non-IoT software quality, research on IoT software quality is lacking. It is
uncertain if IoT and non-IoT systems software are comparable, hindering the
confident application of results and best practices gained on non-IoT systems.
  Objective: Therefore, we compare the code quality of two equivalent sets of
IoT and non-IoT systems to determine whether there are similarities and
differences. We also collect and revisit software-engineering best practices in
non-IoT contexts to apply them to IoT.
  Method: We design and apply a systematic method to select two sets of 94
non-IoT and IoT systems software from GitHub with comparable characteristics.
We compute quality metrics on the systems in these two sets and then analyse
and compare the metric values. We analyse in depth and provide specific
examples of IoT system's complexity and how it manifests in the codebases.
After the comparison, We systematically select and present a list of best
practices to address the observed difference between IoT and non-IoT code.
  Results: Through a comparison of metrics, we conclude that software for IoT
systems is more complex, coupled, larger, less maintainable, and cohesive than
non-IoT systems. Several factors, such as integrating multiple hardware and
software components and managing data communication between them, contribute to
these differences. Considering these differences, we present a revisited best
practices list with approaches, tools, or techniques for developing IoT
systems. As example, applying modularity, and refactoring are best practices
for lowering the complexity.
  Conclusion: Based on our work, researchers can now make an informed decision
using existing studies on the quality of non-IoT systems for IoT systems.
