Using ChatGPT to Audit and Migrate Drupal Modules
This was fun! I just inherited a new Drupal 9 site. Whenever I get a new site I do a code review of all the custom modules for security purposes. Additionally, since I’ll eventually need to upgrade the site to Drupal 10, I figured I’d assess the code for D10 readiness. There were 16 custom modules.
As an experiment I fired up ChatGPT and used the following prompt:
CharGPT found 90% of the issues I would’ve flagged. The items it didn’t find that I didn’t find were stylistic, not things that I’d consider crucial or security related. Then I entered this simple prompt:
CharGPT updated the code. I received the code, ran it in stage and will implement it over the weekend in my next release window.
I find using ChatGPT instead of Drupal Rector for removing deprecations interesting because I can ask it questions and do an automated code audit, This probably saved me 80% of the time and is less prone to error and typos.
The Future of Work in Tech: Reflections on Using ChatGPT for a Job Application
So, as part of a job application, I was asked to create a simple Drupal module, which would have taken me around 15 to 20 minutes to code, test, debug, and publish. I opened my code editor and then a thought occurred to me: 'I wonder..
I fired up my web browser and headed to ChatGPT. I wrote a prompt: 'Create a Drupal 9 module to create a block that will display the title, author name, and taxonomy terms associated with the current node.' In less than 5 minutes, I received YAML and PHP code, along with comprehensive instructions on how to input, install, enable, and utilize the module. I spent a few minutes reviewing and testing the code before submitting it.
I’m sitting here reflecting on this.
On one hand, it resembles the work of senior web architects. They write specifications and delegate the work to junior developers (often located overseas). I just replaced the junior developer with a simple AI. A large portion of my future work will involve gathering requirements and constructing prompts to generate code, with only a need to write code in special cases.
Still, a part of me feels guilty, as if I cheated on my homework by using a calculator for math problems. Some may argue that I haven't demonstrated my ability to code (but I can provide a link to my Bitbucket account as proof of my coding skills).
Yet, I did prove I could get you the correct answer in the most efficient way possible. After all my middle school teacher, Sister Mary Benedict. was correct. I will not carry a calculator with me for the rest of my life. Instead, I have a computing device that is more powerful than the one used to land a man on the moon. It will allow me to instantly connect with most of my contacts and access the sum of human knowledge.
I know I’m going to sound paranoid…
Sometime over the last few weeks, I did some reading on Japan’s Fu-Go balloon bombs from WW2 and it occurred to me that such a balloon with a nuke payload could be used to set off an EMP which made me think of that miniseries from the 80’s, Amerika. And this morning I’m watching the news of this Chinese spy balloon….
I’ll be over here stocking my bomb shelter and brushing up on my Mandarin.
This might not age well…
Since #CharGPT can generate code several people have speculated that AI will eventually replace programmers. I’ve made a good career building business apps in tools like Cobol, xBase (dBase, FoxPro, Clipper), Filemaker, Access, and web CMSes like Drupal, all tools that were built to eliminate the need for programmers, yet ironically created more developer jobs then they eliminated. So I’m betting on the potential of #ai #developer #people #jobs .
I think I finally hit the breaking point with the #AppleTV library for my personal library of ripped DVDs and Blu-rays. I’ve stored my ripped TV and movies in an iTunes / AppleTV library for over 20 years and stream my media to an AppleTV device hooked to the tv.
I rip them to preserve space. Living in a modest NYC co-op, you have to make choices. My DVDs can live in a storage locker while all my media is in my apartment on a small hard drive.
I have an old computer on the shelf collecting dust which can be repurposed as a #Plex server. Amu thoughts?