Skip to content

AI Programming: Helpful Assistant or Pitfall Master? Reflections on My AdminLTE Backend Transformation

A Few Words to Start

Recently, claims like "AI is about to disrupt software development" and "90% of programmers will lose their jobs" have been circulating, and various AI programming tools and IDE plugins have indeed shown impressive capabilities. Honestly, as a developer, I'm both curious and a little excited, wondering if I can use AI to "rocket" my development efficiency.

Recently, I took on a job: upgrading an old CRM backend system (PHP 5 + CodeIgniter 3.1.10) to PHP 7, applying the new AdminLTE 3.x, and adding some new features. Throughout the process, I was almost glued to AI (mainly Gemini), letting it help me write code.

To be honest, although AdminLTE is used by many, I hadn't touched it before. Official documentation? Well... I was a little lazy to read it, thinking this was a good time for AI to show its skills! Just let it generate the code.

This "human-machine collaboration" experience gave me some heartfelt insights into the true level and limitations of AI in programming.

AI's "Highlights": Efficiency is Indeed Amazing

Admittedly, in many scenarios, AI is simply a perfect "co-pilot":

  1. Writing "Routine Tasks": Creating the basic structure of controllers and models, writing standard CRUD operations, generating configuration files, or creating common front-end components (such as dropdown menus, form validation rules), AI can do it almost "swish, swish" with high accuracy, which saves a lot of copy-pasting work.
  2. Quickly Handle Common Functions: Want to automatically generate a set of AdminLTE-style forms based on database fields? Or quickly build a data table with pagination? AI can often quickly give you a piece of code that can run.
  3. Transform into a "Walking Documentation Library": When encountering unfamiliar PHP functions, library usages, or specific "rules" of a framework, asking AI is usually faster than struggling to read the documentation yourself, and it also provides examples directly.
  4. Code Snippet "Generator" and "Translator": Need a small code block for a specific function (such as date formatting, string processing), or want to understand a piece of someone else's "heavenly script" code, AI's explanation and generation capabilities are reliable most of the time.
  5. Front-end Style "Magic Brush": Want to give the interface a "tech blue" or "modern minimalist style"? As long as the requirements are clear, the CSS schemes and layout suggestions given by AI are really good, and sometimes they can be used directly, just with minor modifications.

Especially at the beginning of the project, when dealing with these "standardized, highly general, and somewhat mechanical" tasks, AI's efficiency is simply explosive, giving a feeling that "the future has arrived."

AI's "Failure Scenarios": Weak in the Face of Complexity, Details, and "New Things"

However, the good times didn't last long. When the project goes into deeper waters, the logic becomes more and more complex, or the requirements are more and more detailed, AI's shortcomings begin to be exposed, and sometimes it can make people laugh:

  1. Complex Processes and State Management? It's Confused: When dealing with complex logic that requires interaction across several pages and remembers the user's previous operation status (such as the AdminLTE IFrame mode Hash navigation problem, sending messages across IFrame windows, dynamically adding and deleting tab pages while maintaining the state), AI starts to feel a little weak. It may understand how to do each step individually, but it's too difficult for it to perfectly connect these steps, the dependencies between different components, and how the state flows.
  2. Context: Not Enough Input is Not Understood, Too Much Input... It Forgets! This is definitely AI's biggest pain point, without exception.
    • Insufficient "Feeding": If you only give it a small piece of code or vague requirements, the code it generates will mostly not be able to be directly used in your system, or even misunderstand your meaning.
    • Too Much "Feeding": When you painstakingly stuff the entire file, related module code, and the ins and outs of the situation to it, hoping it can "see the big picture," it's easy to get "mentally confused" instead. It may confirm the key points with you just a moment ago, but forget them completely the next moment; or when modifying A, quietly break the previously adjusted B. The result is "robbing Peter to pay Paul", you have to keep checking and repairing behind it, which is exhausting.
  3. Focusing on Details, Precise Control? It Only Does "Almost": For some fine UI tweaks, specific interaction animations, or business rules that need to be strictly followed, the solutions given by AI are often "more or less", but there is always a slight gap from "meeting the requirements perfectly". For example, asking it to fix a layout misalignment of a specific element under a certain mobile phone resolution, or implementing an unconventional chart interaction, it may give you a general solution, but it is helpless for those corner case scenarios.
  4. Can't Handle "New" or "Niche" Technologies: No matter how large AI's knowledge base is, it can't withstand the rapid iteration of new technologies or some less common usages. For relatively new technologies, incomplete documentation, and few community discussions (such as various tricky operations in AdminLTE IFrame 3.2 mode), AI's "hallucinations" are even more serious. It may fabricate non-existent APIs in a serious manner, recommend you to use outdated methods, or give completely wrong understanding of the internal mechanisms of the library. In my development, letting AI handle AdminLTE IFrame's postMessage cross-window communication, pushState/popstate implemented no-refresh navigation (especially ensuring that each page has a fixed URL, which is convenient for sharing with others to open directly, instead of only being able to click in from the backend homepage), and how to precisely trigger the creation and switching of tab pages through code, is simply a disaster area, and almost none of the solutions given by AI can be used directly.
  5. Debugging? Nightmare Difficulty! Once there are problems with the code generated by AI, especially those involving complex logic or library interaction, debugging may be more difficult than writing it yourself from scratch. Because you not only have to understand the business logic, but also have to guess how AI is "thinking" and where exactly the code logic that sometimes does not conform to human intuition is wrong. It really confirms the joke: "AI coding for 5 minutes, human debugging for several hours."

Whether it's an AI assistant integrated in the IDE or directly throwing the code into the chat window, these hurdles are indispensable.

The Value of Human Programmers: More Than Just "Code Monkeys"

This "close cooperation" with AI has made me clearer about where our programmers' value lies, which is far more than just coding:

  • Building the Framework, Drawing the Blueprint (System Design and Architecture): Understanding what the whole business is about, and designing a system architecture that is scalable and easy to maintain, AI cannot do this work yet.
  • Dissecting the Ox (Complex Problem Decomposition): Decomposing a large and vague requirement into manageable and implementable small modules and tasks.
  • Getting to the Bottom (Deep Debugging and Root Cause Analysis): In the face of strange Bugs, using logic and tools to peel off the surface of the problem layer by layer and find the root cause hidden in the deepest part.
  • Master of Balancing (Trade-offs and Decisions): Finding the most appropriate balance between conflicting requirements, technical implementation limitations, and performance requirements.
  • The Strongest Brain (Learning and Adaptation): Quickly learning new technologies that have not been touched before, gnawing on difficult-to-understand documents, and solving problems that cannot be found on the Internet.
  • Communication Bridge (Communication and Collaboration): Understanding what product managers and customers really want (not what they say), and efficiently cooperating with other development partners.

Take the AdminLTE's IFrame navigation as an example. AI repeatedly gave wrong solutions. What to do in the end? Honestly rummage through the official documentation (although there is not much relevant information) and source code, bite the bullet and understand its temper, write the key DOM operation and state management logic by yourself, and then the problem is completely solved. AI can't really help with this.

Dancing with AI: The New Posture of Future Programming

So, how should we view AI as a new colleague?

  • Treat it as a super "intern" or "pattern recognition master": Let it handle repetitive labor, standardized tasks, and generate the "rough house" of code.
  • Treat it as a "walking documentation library" or "idea bank": Use it to quickly check syntax, API usage, or get ideas for solving common problems.
  • Treat it as a primary "code reviewer": Let it help check code style and find obvious low-level errors (but never completely trust its judgment).

But the final architectural design, complex logic tackling, detailed refinement, diagnosis and repair of difficult and complicated diseases, and the integration and implementation of the entire system still need to be decided and controlled by us human developers. We need to:

  1. Learn to "Feed" Accurately: Ask AI questions clearly, accurately, and with sufficient context.
  2. Learn to "Divide and Conquer": Break down complex tasks into smaller chunks that AI can better understand and handle.
  3. Maintain a "Skeptical" Attitude: Never directly copy and paste AI's code, be sure to understand it and test it yourself.
  4. Strengthening Oneself is Still Necessary: Solid programming foundation, data structure, algorithm knowledge, and a deep understanding of the framework/library you use are the foundation for mastering AI and handling the "pits" it digs.
  5. Treat it as a "Tool", Not a "Crutch": AI is a powerful tool to improve efficiency, but it cannot replace your thinking and creation.
  6. Let Go When You Should: If AI repeatedly makes mistakes on a problem, or simply cannot understand your complex requirements, don't hesitate, switch back to "manual mode", check the documentation, look at the source code, and do it yourself is the best way.

Final Thoughts

AI is indeed changing the rules of the programming game. It greatly improves our efficiency in some aspects and lowers the entry barrier for some technologies. But it's still far from replacing programmers. The current AI is more like a super-powered, knowledgeable, but sometimes "seriously nonsense," lacks global perspective and deep thinking ability intern or assistant.

Future developers need to constantly improve their system design capabilities, problem-solving capabilities, critical thinking, and continuous learning capabilities, learn to collaborate intelligently with AI, make good use of its strengths, and avoid its weaknesses.

AI programming is not the end, but a new chapter in the evolution of developers. What we have to do is learn to jump more steadily and go further in the new era of human-machine collaboration.