ChatGPT, Tableau, HTML, CSS, and JavaScript
Over the past few days, I was updating my portfolio because I wanted to try embedding a Tableau dashboard into my webpage. In order to do this, I needed to change my slider toggle to be toggle tabs. I chose not to do it with ChatGPT because I wanted to gain a better understanding of the languages (HTML, JavaScript, and CSS). It’s not that I’m opposed to using generative AI for coding, but it’s simply because I wanted to understand the parts of the language and code organically.
I see generative AI as a calculator. I can’t immediately say what 73x19 is and would probably choose to use a calculator for speed and efficiency. If I needed to perform that calculation without assistance, I could because I learned the concepts of multiplication.
Changing from a Slider to Tabs
Once I finished getting the page to look how I wanted it to, I asked ChatGPT to “Help me change a slider bar on my webpage to tabs.”
But
The two points above effectively meant I needed to have a “sandbox” to build the code and test it with. I would need to go back and forth with ChatGPT until it provides me with all the code I need to build the working parts. This meant I would have to understand the process of how to build what I envisioned and I couldn’t “window shop.” It didn’t give me various options of tabs (e.g., animated tab bars, closable CSS tabs, tabs that were aligned vertically rather than horizontally). If I didn’t know the vocabulary of what type of tab I wanted, or if I didn’t know that it was a design I preferred but wasn’t thinking of, I wouldn’t know to ask ChatGPT for that. All I needed to do was type in “html toggle tabs” into my search engine and I’d get results with example images, a variety of tab displays, and code templates to copy and paste. I’d argue it would be faster and to copy and paste these code templates because I knew how they were supposed to look when displayed and I didn’t have to wait for ChatGPT to finish loading the results. I didn’t have to engineer multiple prompts, just open multiple tabs and synthesize the information together. Instead of synthesizing the code and text ChatGPT returns, the traditional method of learning would involve synthesizing the code from a variety of websites.
Recommended by LinkedIn
Embedding the Tableau Dashboard
I then asked ChatGPT “How do I embed a Tableau dashboard in my webpage?”
But
The biggest problem was debugging. The Tableau view just wouldn’t display. My website is just my portfolio. It only contains text, some CSS to alter the style of the website looks like, and JavaScript to make the toggles work. It was too simple of a website so I knew that if I could get the Tableau view to display on a blank HTML document, I should be able to figure out what was wrong. I figured out that the reason my dashboard wasn’t displaying was because it needed to be the first tab that was displayed. There wasn’t a typo in the code, a permission issue, or an API issue. I couldn’t find out why this problem existed even after searching the internet. When asking ChatGPT, it also didn’t contain the answer likely because its training data didn’t contain my specific problem. But because it didn’t know my problem, it couldn’t give me the solution.
The workaround in my head was easy: make sure that the dashboard was on the first tab, use JavaScript to automatically click on the tab I wanted to be displayed once the user entered the website. I then figured out if this was done too quickly, it still wouldn’t display, so I’d need additional JavaScript to make it wait a second before clicking on the other screen.
In the end, I reverted my website back to a slider display. I added the dashboard as a project and had it direct to the Tableau page.
This might sound like it was a futile 4-days of effort but I ultimately learned so much more about HTML, CSS, JavaScript, Tableau, and the peculiarities that arise when integrating all of them. ChatGPT wouldn’t have taught me all of this, and because I struggled learning the difficult way, I had more options available to me and gained a deeper understanding of every single letter of code I typed. It’s like sending a multiplication worksheet home for an elementary school students and being told not to use a calculator. When the student understands the concepts, whether they use a calculator or not to solve the problem will become irrelevant.
the journey of manual coding, while time-intensive, builds invaluable foundational knowledge. have you considered how this deeper understanding might enhance your future ai interactions?