Comparing Software Developers with ChatGPT: An Empirical Investigation