StackOverflow has been the de-facto place for developers to ask and resolve programming related questions for a long time. I’ve been using it, almost daily, since my junior dev days (circa 2012)
In the past few months I’ve noticed that my behaviour has changed to a hybrid mix of ChatGPT and StackOverflow. Increasingly using ChatGPT more and more.
The results are pretty mind blowing so far, so I thought it would be interesting to do a comparison B.C (Before ChatGPT) & A.C (After ChatGPT)
The Task
I have an (existing) kotlin project that uses slf4j for logging. In addition to that, I wanted to add logging to a file as well as control when the logging to file happens.
With StackOverflow
The typical workflow would be
Go through these results.
See if there’s an answer relevant to me. If not, try another query.
Then search for results on how to control the logging programmatically.
If i’m lucky, i will get some answers. If not, there’s always the slf4j manual (yikes).
Last but not least, i still need to piece this together and integrate it to my project.
This can take anything from a few minutes to a few days, depending on how popular the topic is.
With ChatGPT
With ChatGPT I can directly ask it what I want and get a tailored answer
I have a Kotlin project and i'm using slf4j for logging. I want to also save the logs to a file. I'd like to do it programmatically and not by using logback.xml file.
The response offers the following:
An example how to add the necessary dependencies into my project
A setup file in Kotlin because i asked to do it programmatically
An example how to init logging in my app
Perfect!
As we can see, ChatGPT offered a step by step tailored answer to my needs.
But wait there’s more
After installing all dependencies and code, my tests started failing when using Java 8 (only). So i asked a follow up question…
Added logback to my project but now when i try to run my tests i get "java.lang.NoClassDefFoundError". Note, it works fine with java 11 but not with Java 8.
🤯🤯🤯
It was correct. There was a version mismatch with other dependencies and once resolved it worked perfectly.
This would have taken me hours of research to figure out with Google and StackOverflow.
Final Thoughts
This is truly exciting.
While i don’t think knowledge sites like StackOverflow are going away, i do believe that we’ve found a more efficient way to access the worlds information.
In fact, this was not a comparison between ChatGPT and StackOverflow but a comparison between ChatGPT and Google.
PS you were mentioned in a newsletter called Emergent Mind.
Thanks Arthur. Super clear and I like the way you've written up the process.