Practical Experience with Baidu AI Cloud's AI Coding Assistant

    This article presents a hands-on evaluation of an AI coding assistant built on a cloud platform, using the task of generating a full e-commerce website with 10 pages as the test case. It covers how well the generated project runs out of the box, which types of defects appear and how efficiently they can be fixed, and how the resulting code is structured for long-term maintainability. It also discusses complete business flows such as cart, checkout, payment results, and order management, then summarizes practical guidelines for working with AI coding tools: defining project conventions upfront, iterating in small steps, building verification into the workflow, and assigning trust based on task type rather than on model benchmark scores. Development teams can use these findings to treat AI coding assistants as capable collaborators that need clear context, explicit acceptance criteria, and controlled change scope.

    Practical Experience with an AI Coding Assistant: Generating a Full E-Commerce Website

    1. Background: From “Can Generate Code” to “Can Be Trusted With Code”

    Over the past two years, AI-assisted programming has moved quickly from “autocompleting a few lines of code” to “generating an entire application.” For developers who use AI coding workflows in depth, the key question is no longer “Can it write this?” It comes down to three more practical concerns:

    1. What is the first-pass success rate? Is the generated result runnable and maintainable enough to work with?
    2. Can it fix complex issues on its own — especially around type systems, boundary conditions, and permission logic?
    3. Is the generated code well organized, and can it support later iteration?

    Recently, a third-party evaluation showed a newly released model trailing the industry-leading model by just one point. That signal is worth paying attention to: once model capability reaches the same tier, the real differences show up in engineering details — context understanding, instruction following, stability across long, multi-step tasks, and the maintainability of generated code.

    To test these capabilities, we designed a fairly complete task: generate an e-commerce website with 10 pages and a full purchase flow. The scope covered the home page, product list, product details, shopping cart, checkout and order placement, payment result, order list, order details, user center, and login/registration, with an explicit requirement for permission separation and type constraints.

    The test ran in the “builder mode” of an AI programming tool offered by a cloud provider. This mode gives the model a higher degree of autonomy: the developer states the goal and constraints, and the model plans the steps, creates files, writes code, and iterates on fixes by itself. This is closer to how real teams “hand an AI a module,” which also makes it more likely to surface weaknesses.

    One caveat: call latency was on the high side during the test, and page generation and fixes required patience. That is a service-side load and scheduling issue rather than a model capability issue, but it does affect how smoothly the development experience feels.


    2. First-Pass Output: Usable, but Not Production-Ready

    The first generated version of the site had a complete skeleton: all routes in place, pages accessible, and the main flow clickable from start to finish. From a “zero to one” standpoint, the result was acceptable — the developer receives a project that can be started immediately and refined step by step, not a pile of drafts that needs to be rewritten.

    At the detail level, though, several typical problems appeared.

    2.1 Missing Visual Details

    The most visible issue was the missing footer styling. The footer component was present in the generated code, but its style rules were not fully written out, so the bottom of each page rendered as unstyled stacked text. This kind of issue is very common in AI-generated output, because styling is low-semantic-density information: the model easily remembers that “there should be a footer,” but tends to overlook “what the footer should look like.”

    2.2 Language and Type Convention Drift

    A more concerning problem was inconsistent tech stack conventions. The initial code used JavaScript. When we asked mid-conversation to switch to TypeScript, newly generated code followed the type requirements, but the existing code was not migrated in sync, and type errors piled up (25 type errors appeared during the test).

    The root cause here is context consistency: in a long conversation, earlier technology choices get diluted by later instructions. The engineering fix is clear — write the tech stack, directory structure, naming conventions, and type strategy into a “project conventions” section at the start of the task, and carry it as mandatory context in every turn of the conversation.

    2.3 Attribution: Not All on the Model

    To be fair, roughly half of these issues came from orchestration logic on the tool side (such as file-writing strategy and context trimming), and the other half came from instruction-following precision on the model side. This reinforces an important point: when evaluating AI coding capability, you have to separate the “tool” from the “model.” The same model can perform very differently in different tools, because the tool determines what the model can see, what it can write, and what it can execute.


    3. Defect Fixing: Where the Real Gap Shows

    If first-pass output determines “how fast you get started,” then defect fixing determines “delivery quality.”

    In the test, we fed the issues back one by one — missing footer styling, type errors, inconsistent component references, and so on. The overall fixing process went smoothly: most issues were resolved within one round of feedback, with no need to re-describe the context repeatedly.

    The most impressive part was the batch fix of TypeScript type errors. All 25 type errors were handled automatically except for a single interruption during the process, with no need to fix them line by line by hand.

    This experience is a meaningful signal. Looking back at how AI coding tools have evolved, the developer mindset has gone through three stages:

    • Stage 1: Afraid to use it. The model occasionally wrote correct code, but developers had to review it line by line, and the cost outweighed the benefit.
    • Stage 2: Half-believing it. They used it for boilerplate, tests, and scripts, but still wrote the core logic themselves.
    • Stage 3: Willing to trust it. They handed over entire tasks with clear boundaries and verifiable outcomes — like “fix a class of errors.”

    The dividing line between “nervous” and “fully confident” is whether the AI can independently complete an entire class of engineering work. Type fixing fits this pattern well: the problem is clearly defined, error messages are verifiable, and the change scope is controllable. It is also one of the highest-ROI scenarios in AI-assisted programming today.

    Best Practices for Fix-Oriented Tasks

    Based on this test, here are a few reusable methods:

    1. Fix one class of problem at a time. Mixing “broken styles + type errors + logic bugs” in a single feedback message makes it easy for the model to fix one thing and break another.
    2. Include verifiable information. Pasting the full error output, reproduction steps, and expected behavior significantly improves fix accuracy.
    3. Ask for minimal changes. Explicitly constrain the scope — “do not refactor unrelated code” — so that fixing one bug doesn’t introduce three new ones.
    4. Verify immediately after each fix. Have the model run its own checks (type checking, build, tests) to close the loop.

    4. Code Structure: The Key to Long-Term Cost

    More important than how the UI looks is how the generated code is organized. In this test, the project structure was clearly better than what comparable tools had produced before, in four specific ways.

    4.1 Route Layer Separates Permission Boundaries

    The page directories distinguished between User pages that require login and public pages, which means route guards and authentication logic have a clear place to attach. This matters a lot for e-commerce projects — cart, orders, and the personal center are all sensitive areas.

    4.2 Component Layer Separates Layout from Business Logic

    The components directory kept Layout (header, footer, sidebar, containers) separate from business components. Layout components are reused often and change rarely; business components are tightly coupled to specific pages. Keeping them apart avoids the connected risk of “change one footer and break five pages.”

    4.3 Type Definitions as Their Own Layer

    TypeScript type definitions lived in a separate folder instead of being scattered inside individual components. The benefits: types can be reused across modules, interface contracts are visible in one place, and there is a single source of truth during frontend/backend integration.

    4.4 Mock Data Managed Separately

    Mock data was stored on its own, leaving a clear boundary for later replacement with real APIs. When the backend is ready, you only swap the data access layer — no component logic needs to change.

    A Typical Directory Layout

    1. src/
    2. ├── pages/
    3. │ ├── public/ # No login required: home, list, details
    4. │ └── user/ # Login required: cart, orders, profile
    5. ├── components/
    6. │ ├── Layout/ # Header, footer, containers
    7. │ └── Business/ # Product cards, order items, and other business components
    8. ├── types/ # Global types and interface definitions
    9. ├── mock/ # Mock data and data access wrappers
    10. └── services/ # API call layer (replaces mock later)

    The value of this structure is that it can go into iteration without needing a rewrite. Developers can locate problems by directory, swap implementations by layer, and collaborate under type constraints. By contrast, a generated result that dumps a dozen components into one folder, scatters type definitions everywhere, and hard-codes mock data inside components may run fine at first, but it will degrade quickly when the second requirement arrives.


    5. Complete Business Flow: From “Stacked Pages” to a Closed Loop

    Another observation point was whether the business flow was complete. The technical difficulty of an e-commerce site is not the number of pages — it is passing state between pages and keeping it consistent:

    • Product details → add to cart: handle option selection, stock validation, and quantity limits.
    • Cart → checkout: aggregate totals, apply coupons, and validate the shipping address.
    • Checkout → order creation: generate an order number, lock inventory, and ensure idempotency.
    • Order creation → payment result: handle success, failure, and timeout branches.
    • Order list / details: drive display and button visibility with a state machine.

    The generated result covered this flow at a basic level. The order flow worked end to end, and the information shown in the user center (order status, shipping information, account profile) was fairly clear. This suggests the model has a good grasp of the general business model of e-commerce and does not need the developer to explain “what an order state machine is” step by step.

    To reach production readiness, however, you still need to add: inventory concurrency control, payment callback signature verification, automatic closing of timed-out orders, coupon stacking rules, and rollback on exceptions. These are business-depth issues that no AI can infer out of thin air — the rules are specific to each company and must be defined explicitly by the developer.


    6. Practical Guidelines for Adopting AI-Assisted Programming

    Drawing from this test, here are a few working principles:

    6.1 Define Conventions Up Front, Don’t Fix Them Later

    At the start of the task, make clear: the tech stack and language, directory structure, naming conventions, type strategy, styling approach, and error-handling conventions. Changing conventions midway is very costly, because the model then has to keep both the old code and the new conventions consistent at the same time.

    6.2 Iterate in Small Steps Instead of Generating the Whole Site at Once

    Generating ten pages in one shot inevitably raises the defect density. A steadier approach is to generate the skeleton and routes first, then fill in modules one at a time and verify after each step. This keeps the scope of problem localization small and the cost of fixes low.

    6.3 Build Verifiability Into the Workflow

    AI-generated code must be quick to verify: type checking, static analysis, unit tests, build artifacts. Without a way to verify, AI generation simply defers all quality risk to later.

    6.4 Assign Trust Based on Task Type

    Different task types carry different levels of trustworthiness:

    Task Type Recommended Trust Level Reason
    Type error fixing High Well-defined and verifiable
    Boilerplate / CRUD High Fixed patterns, highly repetitive
    Component and page generation Medium-high Visual and interaction details need manual adjustment
    Permission and security logic Medium The cost of vulnerabilities is severe; needs careful review
    Business rule implementation Low Depends on company-specific knowledge

    6.5 Look at Tool Orchestration, Not Just Model Scores

    The performance of the same model varies across tools, often because of differences in context management, file manipulation capability, and execution-feedback loops. When choosing a tool, include the tool itself in the evaluation and run end-to-end tests with real tasks, rather than relying only on leaderboard scores.


    7. Conclusion

    The core takeaways from this full test around a “multi-page e-commerce website” can be summarized in three points:

    1. Model capability has crossed the usability threshold. Full-site generation, structure planning, and closed-loop flows all reach a level that a developer can pick up and refine directly.
    2. Type and error fixing is the strongest scenario right now. The degree of automation in batch fixes marks the point at which AI-assisted programming enters the “willing to trust” stage.
    3. Engineering discipline is still the deciding variable. Conventions up front, small-step iteration, and verification loops — these three determine the final quality of AI-generated code.

    For teams, the more pragmatic path is to treat AI as a capable collaborator that needs clear boundaries. Give it clear context, verifiable acceptance criteria, and a controlled change scope, and it will reliably produce maintainable code. Treat it as a black box that turns “one sentence into everything,” and the result is often fast generation followed by even slower rework.

    In Baidu AI Cloud’s practice, AI-assisted programming follows the same logic: model capability is the foundation, but toolchain orchestration and engineering standards are what turn that capability into delivery efficiency. What developers really need to build is not blind trust in a particular model, but a reusable methodology for working with AI.