Mistake 1: Skipping the Docs (Spoiler: They’re Goated)
As a rookie starting in software development, especially in the age of AI, I could easily skip the learning phase and jump straight into building. But my experience during my undergraduate years taught me something: shaky foundations and an inadequate understanding of the tools you're working with will eventually come back to bite you — sometimes in ways you least expect. After setting up my…
In the world of software development, particularly in the age of AI, it is easy to overlook the importance of foundational knowledge. This was a lesson learned by a rookie developer who, after setting up their development environment and database design, decided to jump straight into building their project. However, this decision led to a series of issues that could have been easily avoided with a better understanding of the tools they were working with.
The developer initialized Prisma 8 in their DMS project, assuming that it would correctly generate the necessary folder structure. However, Prisma 8 initially generated the Prisma directory inside the src/ folder, which went against their intended setup. Instead of recognizing this discrepancy, the developer moved the Prisma directory to the project root, believing everything was fine and continuing to write their database models in contract.prisma.
This seemingly innocuous action had far-reaching consequences. Two major issues arose from this incorrect folder structure. Firstly, the NestJS compilation error occurred because a TypeScript file was placed outside the directory covered by the TypeScript compilation configuration. Secondly, Prisma was unable to locate the schema in the expected location, causing subsequent Prisma commands to fail.
These problems stemmed from the developer's failure to fully comprehend how Prisma's configuration and NestJS's compilation setup interacted. By changing the folder structure without a proper understanding of the underlying mechanisms, they inadvertently created these issues. The AI tool, ChatGPT, did suggest folder structures and database models, but without the necessary context about the project setup, its suggestions were misleading and unsuitable.
The developer recognized that AI is only as good as the person using it. They understood that blindly accepting AI's suggestions could lead to problems, especially when working with new versions of tools like Prisma. Reading through the Prisma 8 documentation proved invaluable in resolving these issues and tackling subsequent problems, including cases where AI suggested Prisma ORM queries based on outdated versions.
While documentation may not always be the most exciting read, it can often be the most essential. In this case, the developer's experience serves as a reminder that building a solid foundation in the tools and technologies one works with is crucial. It highlights the importance of not solely relying on AI suggestions but rather understanding the underlying principles and seeking guidance from reliable sources like documentation.
This lesson learned will undoubtedly help the developer navigate future projects with greater confidence and avoid similar pitfalls.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.