/hash-router

A vanilla javascript hash router created with ChatGPT

Primary LanguageHTMLGNU General Public License v3.0GPL-3.0

hash-router

A vanilla javascript hash router created with ChatGPT

About

The goal of this project was to see if ChatGPT could help me arrive to a clean and simple solution for a client-side hash router.

My anecdotal experience

Completing this project was not as simple as I initially hoped it would be. I had to go back to first principles and keep the scope of the project as simple as possible. This meant solving the problem before working with ChatGPT in order to achieve the desired outcome. In other words, I had to genuinely understand the problem and solution in order to get to my goal.

The best way to achieve my goal was to start over from scratch to simplify the process. Introducing classes, styling, modules, and other levels of complexity seemed to deter, confuse, and misdirect any attempt ChatGPT made towards creating the hash router. It was easily distracted and would make erroneous comments frequently. Starting over was the best way to remove the complexity introduced by other concepts.

ChatGPT tends to have a bias towards favoring complex solutions over simple solutions and will frequently make inaccurate statements. Most of this is documented in the conversation I had with it which I have finally added to this repository for record keeping purposes.

I did learn a lot from this process and picked up some neat tricks along the way which can be seen in the commit history. Maybe I did something wrong, but I wouldn't recommend using this unless you really know what you're doing and are prepared to teach the chatbot instead of learning from it which requires a certain level of domain expertise to really gain any real benefit from it. I felt at times that it actually made solving this problem more difficult rather than actually simplifying it. It took many iterations, and conversations, to arrive at this current snapshot.

I am definitely looking forward to working with this technology in the future and am unsure of where it will take us. I'm sure it will be many things and that it will be anything but boring.