by lubujackson · 3mo ago · 0 comments
Code review can go much deeper now if you use AI to aggressively attack a PR combined with your human insight. Same for planning a feature:
Can I consolidate this logic to a shared function? Does the error surface to the user and are there any gaps? What preexisting functionality is affected by this PR? Can this query be made more efficient?
LLMs are great with focused questions, up and down abstraction layers and across all kinds of concerns. Stack up these focused concerns into a rich understanding of what you are doing or writing.
Understanding is the real output, code is the byproduct.
Like, sure, there are some wildly different paradigms that can be difficult to switch between, especially if you don't have any prior exposure to that paradigm. But there are way more programming languages than there are paradigms, so odds are high that using another language will primarily use a paradigm you're familiar with. So the main difficulties are in using a new standard library (where "using a new library" is a skill software engineers exercise every time they pull in a new library as a dependency), and some syntax quirks (of which tend to be extremely minor differences in the scope of languages used for industry).
It's hard for me to see "I'm not an X language engineer" as anything other than directly rejecting the task that using X language would enable. Especially now, when we can directly ask "what does this line / block of code do?" and get a detailed breakdown of exactly what's going on, on demand.
This is how you wind up with code riddled with vulnerabilities and anti-patterns, with extremely bad performance imo
It's so easy to say "I know Java and C# is basically the same" and then wind up using built ins that are deprecated, using libraries that contain vulnerabilities, or whatever other mistakes
Maybe that's "good enough" for your usecases, but I've never found that it's a good idea to just assume I can switch languages for anything reasonably complex without some growing pains. Sometimes very big ones
I agree. This is much better advice than what the article tries to do, which is to give best practices around how to use or not use AI to code.
You still have to check the work and shouldn't trust it blindly, but in my experience it's pretty damn good.
Happy to share the implementation or package it up if anyone is interested.
Do I understand when I just let AI regurgitate the function and behavior of the code?
> You code and you have the AI check your work. Treat it like a reviewer. That’s my advice in a sentence.
Bro you're giving the same advice as the article
Well, I can't ask it for an overview of a system it can't see.
also
> I don’t follow all these religiously.
So if you need an overview of a system, you can and should provide access to the entire codebase. Even the rule itself says "preferably", not "don't ever". If you have different needs, you can always just look at it as a useful guideline. It's just a blog post by some rando on the internet, not the epiphany of AI coding's Ten Commandments.
This only applies to bad code. A formal programmic language beats an informal language anytime. Why on earth would you translate an unambiguous formal language to English?
> Is there a risk of data leaking here?
> Are permissions enforced downstream of this function?
If you trust AI to give you that answer, you are going to run into serious issues.
Why on earth are all the books about programming, science and math written in English (and other natural languages) instead of a formal one then?
Why on earth did comments even got invented?
Luckily genius programmer who understands formal programmic language and does not need weak comments to clarify why the world is not perfect, fixes the stupid looking code to be beautiful, opening company up to some really super neat, seemingly random bugs in one browser that nobody will understand for several months.
tldr: one important reason comments exist is to clarify why code you might expect to look another way looks the way it does, of course if the only reason it looks the way it does is this is the way the AI wrote it I guess I agree the comment is unnecessary.
I wasn’t talking about code comments, but why this commenter who professed the superiority of formal languages could only get his argument across in an informal language.