It is becoming more common now a days that we develop an application just for fun or maybe for a more serious use case which we often struggle to find an app for, or if our favorite app doesn't have the feature we need.
Or may be you just wanted to Vibe coded an app, just because everyone is doing it and it is becoming more and more easy and useful.
In reality vibe coding comes with a cost, and the debt of that more precisely mentioned as AI slop.
AI slop is when the app only does one thing, like an audio player app only play audio in a specific format, and it breaks when an another popular format is thrown in its way. Because, a digital audio is not limited to a single format, we use .ogg for recording and .midi for ringtones (At least this is how it used to be).
The audio player analogy here is just for illustrative purpose, and it can expand further in all types of applications.
So If you build an audio player and that couldn't handle the variety of formats available, what value does the app gives for you or the users?
And this is the question you need to ask yourself before starting a new project with your Agentic IDE. Is there an app already available for that? If yes, what good is my app going to do, if not, how can I make my app not an AI slop.
If you have an answer for the second part of the question, then start a project, because the application world is already polluted with lots of repetitive and less valuable application.
Alright, maybe with a bit of back and forth conversation with your favorite AI assistant, you may have come up with the next billion dollar app idea and how can you ensure that it is of quality, not feature wise but code wise.
Before you put an argument saying, English is the new programming language, this about it for a second, if that English itself is broken, how good is that new programming language is going to be of any use.
And that is why you need to have the unforgotten yet less preferred skill of Code review.
What is Code Review?
Code Review, as the term suggest, it is simply reviewing the code. In professional software development, it is one of the valuable skill if you are aiming for a higher position, because this only comes with experience, and a complete understanding of the code base.
I know most of the new grads may have frustrated when they see a job description that requires at least 3-5 years of experience, and here is your answer, with that much experience you get the basics of code review.
Pro Tip: If you are new-grad or some one new to tech trying to get into software development, put code review in your resume, and actually practice it obviously
And a code review doesn't stop at just going through the code that was just written. It includes making sure the written code satisfy the given requirement and doesn't accidentally breaks the existing implementation.
How Code Review gives advantage in Software Development:
As mentioned, earlier, it is not about going over the written code and making sure you added write amount of spacing and indention, because we have tools for that, and this is something we prefer to say as nit-picking (I really hate this one).
It is about validating the implementation, well, you can say the compiler already validates the code by successfully compiling, and there is unit test to make sure the app functions the way it is supposed to do.
However, think about it in a funny way, you just added a function to calculate the mean average of ratings and in your test you just cheated by giving it the answer (this are often called flaky test, and these are the worst), so it is like the foundation itself is not strong, and we mention the unit test as foundation is because of Test Driven Development, now you can understand how it can help your app make better.
Well, conditions like these are rare, but it can happen. And one of the other areas where a code review can shine is architectural adherence, like a logging standard, as we know already LLMs are token prediction black boxes with a defined context window, and they are trained on the general code base practice, so it is possible for them to add logs the way it is was added wide across the internet than following the projects standard, this is where the code review to the rescue, you can easily identify this kinds of mis alignment and fix them, which ensures code quality.
And the other commonly found item during code review is, actually functionality breaks. It is common in software development, that you break an existing feature by introducing a new one, and this happens because of poor architecture of none at all, and mostly because of missing test cases. But the unacceptable reason is because often we forgot the existing implementation, but Agentic IDEs are good, only if prompted, when finding existing implementation, however they are useless if the blindly implement the new feature.
And code review gives you an advantage understanding what really happening behind the scenes, because, if you review every piece of code that goes it, you get the confident this is not going to break, and this is how it should and it is working.
Code Review For Vibe Coding:
Well, I'm going to be honest at this point, until now, I have written about the benefits you get about of a code review, however in reality, it is a difficult task then you would have anticipated.
Because, when it comes to Code Review, nobody really going to read through every single line of code, and that is acceptable, because you only need to look at the areas it might break or verify the integrity of the diff just skimming through.
But that changes entirely in vibe coding, because I remember exactly it took Android studio's Gemini, about ~35-45mins to build a working prototype of an application (that I'm currently working on, will see more about that in upcoming articles).
A working prototype covering the end-to-end user flow, that is a lot of code to review, I mean, it is almost 10 classes and over 1000's of lines of code. It would basically take me couple of days to go through the entire diff.
So here the mindset changes, I didn't go through the entire diff, instead, looked at the places only where I think the code will break. And the rest is verification by running through the app, so you basically became a quality analyst.
Now I will say something that every vibe coder is going to oppose, if you have a counter argument you are a vibe coder, and that is you need to learn the basics of the programming knowledge and the tech stack you are working on.
If you are developing an native android application, you need to learn the basics of Kotlin and the Android stack, mostly compose and android lifecycle and device level constraints, because the common mistake LLMs can make during the first run of the implementation is they guess blindly and implement a functionality generically. The common one in Kotlin is the usage !! (not-null assertion operator), practically you won't need that operator, but there are exceptions where it might seem necessary.
And this is where the Code Review helps. The Human-in-the-loop, the judgement only humans can make because of what we call the Cognitive skill, even though we have Large Language Models which excels at cognitive prediction, but those are only prediction based on math and data, though the math is strong the data is not.
How To Improve Code Review When Vibe Coding:
As a human in the loop, you can take advantage of these tools and implement a better pipeline to improve the code review.
One of the earlier prompt hacks I have learned was the argument hack, instead of asking LLMs, what is this and how it works, prompt it as:
Can you give your strongest argument on the code implemented this way will work
Sorry for poor prompting, I'm sure you get the idea.
Now the LLMs behave human like, I mean who here doesn't love a good argument and we like to answer when we are challenged, and AI behave like that, and it will "assess" the implementation with its prediction and mostly self correct its mistake.
And the second option you can try is to ask it to summarize the changes with key points and line numbers. Again this also forces the LLM to relook its predictions, even though it may not self correct the mistakes, it will easily find some and point out the pain points, and as a added bonus you get a better context of the codebase.
But these are not enough, as that is what we already been seen, there are couple of other ways we can improve the code quality and enforce standards, see the previous articles if you missed.
- Formatting or Linting - Helps a lot in AI Assisted development - Vibe Coding
- How Scripting can enforce and improve code quality when vibe coding
- Templates gives a guidance to AI Assisted Development tools when generating code - Vibe Coding
- Unit Tests can help AI Assisted Development from code breaks
- Test Driven Development - An agentic way to develop software
Comments
Post a Comment
Don't be a stranger! Speak your mind.