Developing with AI: Building a Foundation, Not Just Copying Code

As large language models (LLMs) like ChatGPT become more proficient at generating code, there’s a temptation to lean on them for every aspect of the development process. While these tools are incredible assets, especially in terms of saving time, there's a risk that they may unintentionally encourage some developers to become mere "frameworkers"—those who rely heavily on frameworks and libraries without fully understanding the underlying fundamentals.

Instead of becoming an "AI-frameworker"—someone who blindly copies and pastes code from AI tools—it's essential to use AI effectively while still mastering the basics of programming.

Let me illustrate this with an example.

A Bad Prompt: Skipping the Fundamentals

Consider the following prompt:

"Create for me a Spring Boot API endpoint that accepts a POST request with order ID and returns order information."

This is an example of a bad prompt. Why? It shows that the prompter lacks an understanding of core concepts like HTTP methods, data validation, and error handling. The prompt is vague and leaves many critical aspects up to the AI to figure out.

  1. What should happen if the order ID is invalid?
  2. What status codes should be returned in different situations?
  3. How do you handle common errors such as missing parameters or internal server issues?

The prompt asks for functionality without considering these crucial details.

A Good Prompt: Focusing on Fundamentals

Now, let’s look at an improved prompt that reflects an understanding of key programming principles:

"Create a Spring Boot API endpoint that extracts order_id from URL parameters. Validate that the order_id is a valid integer by checking if it can be parsed and is non-negative. If invalid, return a 400 Bad Request with a JSON response detailing the error. If valid, fetch the corresponding order details and return the information serialized as a JSON response. Handle and return appropriate JSON responses for cases such as 404 Not Found (if the order doesn’t exist) and 500 Internal Server Error. Additionally, handle any other exceptions, including invalid HTTP methods, and respond with appropriate error messages and status codes."

This prompt is good because it demonstrates a solid grasp of key programming principles such as:

  1. Input validation: It checks whether the order_id is a valid integer.
  2. Error handling: It provides proper responses for various cases like bad requests, missing resources, and server errors.
  3. HTTP methods: It specifies the correct handling of invalid HTTP methods.
  4. Serialized JSON responses: It requires responses to be in a well-structured format, ensuring the API adheres to best practices.

By focusing on these fundamentals, you set the stage for a reliable, maintainable, and scalable system. This is the difference between an AI-frameworker and a true engineer.

From Frameworkers to Engineers

A "frameworker"—someone who relies on frameworks without caring about the internals—wouldn't bother understanding how the JVM works or why reflection could pose performance and security risks in Java. Concepts like downcasting, which can lead to ClassCastException if done recklessly, would be ignored. Similarly, a frameworker in Python might overlook the significance of memory management or the Global Interpreter Lock (GIL), focusing only on what works "out of the box."

On the other hand, an engineer values knowledge of foundational concepts:

In Java, reflection is useful but also risky if misused. It allows runtime behavior modification, but developers must understand when it introduces security vulnerabilities or runtime overhead.

In Python, type hinting and decorators are often ignored by those who focus only on high-level functionality, but an engineer knows these tools ensure clean, maintainable, and robust code.

Let’s Build With AI, Not From AI

In the same way that frameworks should assist developers but not replace their understanding of core principles, AI should be an augmentation of your skills, not a crutch. The key is to use AI strategically—to supplement your engineering mindset, not replace it.

Remember, AI tools are great, but they're just tools. A true engineer thinks critically about why code works, not just what code works. By building with AI rather than from AI, you remain in control of the process and continue to grow as a problem solver.

Let’s build with AI, not from AI.


Yassin Musa

Junior Backend Developer ????| Developing robust-enterprise applications | Using ASP.NET MVC, ASP.NET Core & Django | ??InfoSec & Networking Technologies

2 周

Bold take. Heavy on mastery. Very insightful

回复

要查看或添加评论,请登录

社区洞察

其他会员也浏览了