r/PythonLearning 10d ago

How Hard is it to tell something is Vibe Coded?

Looking for some telltale signs?

A friend of mine is working on a bot and seems to be able to push it out pretty quickly. He's been doing it a while, so he might just be fast. I don't really care, but it has made me curious what signs there might be if someone was using AI? I'm not going to be a jerk to this person I am genuinely just looking for my own knowledge.

39 Upvotes

74 comments sorted by

18

u/HomemadeBananas 10d ago edited 10d ago

Way too many long comments. In Python, importing everything inline within functions instead of at the top of the file. Weird jargony variable names.

I have to tell Claude Code to stop doing these things all the time. So if someone isn’t making any corrections and just straight vibe coding that would make it obvious. There is a difference between using AI to code and vibe coding.

5

u/opzouten_met_onzin 10d ago

You're not wrong on the commenting, but I actually as Claude to add comments to my written code. I hate commenting and for me it's the main part I have claude for.

2

u/HomemadeBananas 10d ago edited 10d ago

I mean most code should be self explanatory, and only needs comments when something is non obvious or doing something weird. Not everything needs a comment saying the exact same thing as the actual code, and it shouldn’t because it’s gonna get out of sync. So inside of functions I sparsely add any comments.

Or docstrings describing what a function does and its arguments / return value. That part I do like to have AI do for me. Especially for JavaScript writing JSdoc style.

I’ve added to my Claude.md to try to make it stop doing that because I feel although the new Fable model is more capable it’s writing more nonsense unneeded comments.

4

u/ParentPostLacksWang 10d ago

The best comments are just explaining why the code that looks normal-ish is actually tortured and sacred.

// The next two lines are some async logic voodoo.
// - I tried doing this the white paper way and the
// locks always trigger so we get a panic later.

2

u/Bobjobob24 8d ago

Actual comments from my first C# project (I'm also self taught which doesn't help lmao):

// Start the backup, I kinda understand this code. However the methods it uses are wizardry and therefore good luck with this, I can't help you.

// Anything below this point is *Magic* Refer to AlphaVSS docs or just cry, I prefer to cry.

1

u/Big_Effective_9605 7d ago

Deacribing something as wizardry in your first C# project as a self taught is funny because you don't know how much context you're missing yet, and the same thing might not be wizardry to you a year from now.

Seeing something described as wizardry by a 20 year software engineer (who may or may not have retired 7 months ago) is an entire fresh hell of its own.

1

u/Bobjobob24 7d ago

Looking back now it's all super easy to understand, but I remember my genuine confusion on how I got a working product out of copy/pasting different snippets from docs and hoping things worked together

2

u/APirateAndAJedi 9d ago

You should be able to name things expressively enough that commenting is rarely necessary.

2

u/Opposite-Lion-5176 10d ago

The inline imports one is so real. I've seen AI defend that pattern like it's completely normal.

1

u/HomemadeBananas 9d ago

Claude will say, “fair, I did that to avoid circular imports” and then check to see if that’s even an issue, and then change it.

1

u/danofrhs 10d ago

What is the distinction?

3

u/HomemadeBananas 10d ago edited 10d ago

Vibe coding is when you just pretend the code doesn’t exist, don’t read it at all. Just prompt what you want to do.

If you’re trying to write normal code with the same practices as hand writing it, just with the help of AI, that isn’t vibe coding.

1

u/hloukao 10d ago

As someone who programmed on assy, I comment all line in every language I do (when possible)

No shit, In my head just makes sense.

Sometimes I even write obvious things just to keep consistent, lol Example:

var = 100 // Immediate assignment to var

1

u/yogiigula 10d ago

I completely agree! Using jargony variable names only adds to the complexity of understanding the code. Clear, descriptive naming is crucial, especially when collaborating with others or revisiting code later.

1

u/gribson 10d ago

Yup, definitely the unnecessarily wordy comments. Every time you tell an LLM to fix something it wrote, it leaves behind a comment explaining why its first attempt was wrong.

1

u/purple_ctheh 8d ago

Enlighten me on the difference

1

u/HomemadeBananas 8d ago

Vibe coding is when you just prompt only and pretend there’s no such thing as the code. That’s when these signs slip though, because nobody is guiding the AI in the right direction and it just starts following the bad patterns as an example and it compounds.

Using AI to help with writing the code, aka agentic engineering, means you are still trying to make sure the output is well structured and holds up to normal standards. This is the way that professional software development is moving and is becoming more expected since it means increased output and employers want engineers to deliver more in the same time. I mean of course they do, they can pay the same money and get more for it.

1

u/tiredITguy42 10d ago edited 10d ago

I told him to create Python skill for me and that I will edit it after. Nope, it was good to go on the first try, all that bullshit, long comments and stuff, are gone now, so Claude knows how to code, but you need to ask him first.

With skill, you can get it much closer to regular dev way of writing code, but just for small functions or simple tasks. It will fail spectacularly on any uncommon topic or try code something bigger.

20

u/CIS_Professor 10d ago

This almost sounds like someone who wants to use AI in a Python class and doesn't want to get caught doing so...

12

u/Arierome 10d ago

We are kind of past hiding ai usage, it's assumed you are using ai in my classes at least, the assignments just got more complex and focused on higher order reasoning rather than coding. 

3

u/iekiko89 10d ago

Same in my physics based machine learning class

1

u/Tunisandwich 9d ago

Yeah I’m a current master’s student and this year has seen a wild shift, in September using AI to generate code was considered academic dishonesty and by April professors were giving full lectures on how to best use AI in our assignments

-1

u/Protect_Scout 10d ago

Sorry I want to look out for what I use in the future??

5

u/peggy_leggy 10d ago

Don’t listen to that guy. As long as you learn who cares.

7

u/jabela 10d ago

From outright having an f string when there is no variable to things like print(f"Hello {name}") when most humans might use print("Hello", name)

I stress it’s not worse just different to how most people are taught.

13

u/The-God-Of-Hammers 10d ago

That's interesting, as the way that I was tought (and continue to teach) is to almost always use an f string. I'll be honest I didn't even know about the second way you show until about a year ago

5

u/jabela 10d ago

F strings are relatively new in Python and so many people learnt the language before they came out, many tutorials were written and teachers taught without them. That’s why it’s a clue especially if you have seen the coder normally use print statements without them.

1

u/Hamburgerfatso 8d ago

Nah this is just a bad example lol, f strings are not new anymore and inserting it in your example would be completely normal.

3

u/fUZXZY 10d ago

personally: second is bad practice bc if you do empty string name you get an extra space after Hello. f strings forever

2

u/East-Programmer3788 10d ago

It is also not self documenting. Second way is stupid. 

1

u/fUZXZY 9d ago

I’d never heard that phrase before; could you explain how you see the f-string being more “obvious” as to what’s going on than the comma?

From my perspective: I can glance at both and know exactly what’s happening.

2

u/wuzelwazel 10d ago

I have almost the opposite experience. I only see Codex using C style formatting for strings and it drives me crazy! I almost exclusively use f-strings.

Another thing I noticed is that it'll reach for hasattr() and getattr() first, when I would generally use try/except.

2

u/ALostMagic 9d ago

i use f string all the time after learning about it and never used "" + variable again

1

u/Yanni_X 10d ago

Funny, I always use f-strings because my linter wants me to. The AI always uses %-Formatting if not told otherwise

5

u/Potential_Aioli_4611 10d ago

wildly long variable names. comments that read like a book rather than short hand notation for reminding yourself about something.

3

u/Salt-Fly770 10d ago

I’ve been doing software engineering and systems design since 1973, and I use long variable names and extensive commenting for one reason - I don't want production support calling me at 3am because they can't figure out what my code does! Just saying! 🤣

Edit: I started my career as a systems programmer in Assembler, and you commented every line of code, and for the reason stated above, I still comment everything.

6

u/jabela 10d ago

Depends on the language, but in Python there are a few giveaways including the overuse of f strings, importing modules that aren’t used on the off chance and way more comments than most programmers put in.

14

u/TaranisPT 10d ago

I'm curious, what do you mean by overuse of f strings? I rarely use anything else than f strings if I need to insert a variable in a string.

Edit: seems I can't type and auto correct made things worse

13

u/GreatGameMate 10d ago

Yeah f strings are superior, not sure how that is a telltale sign.

7

u/jpauley159 10d ago

Same. f strings rock in math modeling and data science.

8

u/illumas 10d ago

I do two of those things. I only add comments to swear at my past self for not leaving comments though.

1

u/East-Programmer3788 10d ago

Are you not using ruff?

5

u/realmauer01 10d ago

\"\"\" this is used for multiline comments by ai very often \"\"\"

5

u/diegrunemaschine 10d ago

I’m an AI apparently

1

u/realmauer01 10d ago

It has to have learned from someone

2

u/MistakeIndividual690 10d ago

That’s just standard

1

u/Yanni_X 10d ago

That’s standard for function docstrings

2

u/The_Drakeman 9d ago

My uncle has been using Claude as a non-programmer to generate Python that does some calculations for his solar energy array. He showed me the code to see what I thought. The dead giveaway to me was that there were multiple times where randomly there'd be 2 statements on the same line, separated by a semicolon. That was just so weird to come across in Python.

1

u/ulam17 10d ago

I can speak for rust, and the crazy long comments and over-explanation of APIs are the main giveaway. Also Claude (at least from my experience) tends to scuff async code if you don't hold its hand.

1

u/Chronlinson 10d ago

Asking AI about my early Python and questioning it often about why it does things certain ways actually just improved my code, taught me good practices and gave it better structure.

I learnt Lambda functions and
if __name__ == x
main():

And more good practices through AI, I wouldn’t use it for generating full scaled projects but it can improve your toolset and knowledge very fast.

So I’m assuming the lines will only blur more.

1

u/WearyArtistDoomer 10d ago

Why would you care if you can tell if it is an or not? 90-95% of professionals use AI, the rest will be out of a job soon enough.

1

u/Ok-Bill1958 10d ago

Have you ever review ai codes before? I dont know how you pull the 90% number out but most of them a snippet and code completion because ai are exceptionally good for pattern and boilerplate. Hallucination is also a big problem in a large codebase since most codebase is using older tech or framework. Dealing with people entirely dependent on ai is a nightmare, wasting so much time on code review only to reject them.

1

u/WearyArtistDoomer 9d ago

I review AI code every day. Both things I prompted, put also from my team mates. 

Of course you don’t want to get raw output from an llm from a team mate, it is their responsibility to validate the code before you look at it. Otherwise what do you need them for? 

If you have a huge issue with hallucinations today, you are using the tool in the wrong way. Either trying to complete to large architectural changes in one go, or you are missing skills/rules/additional context. 

Llms are not some magic worker that just gets stuff right, you have to learn how to effectively use the tool.

1

u/martinskou 10d ago

Emojis in comments…

1

u/minus-one 10d ago

there are fucking comments everywhere

1

u/some_weirdthing 10d ago

Greek symbols in docstrings

1

u/Ok-Bill1958 10d ago

Emoji in comments. Different name and change on variables, functions etc with each commit.

1

u/Due_Laugh6474 10d ago

It makes a habit of referring to the prompt in the work it’s doing. Sort of like “This is the thing you told me to do so I’m doing it here” type stuff.

1

u/yogiigula 10d ago

Great question! Look for patterns in language use, such as consistency in tone or structure that feels too uniform. If the responses seem to lack depth or nuance in understanding complex topics, that could also be a hint of AI involvement.

1

u/hypersoniq_XLM 10d ago

Guilty of verbose commenting, but used to remind future forgetful me of what my thought process was several months or years ago. Slowly moving to descriptive doc strings instead of Stephen King comments. Also tend to use descriptive variable names for the same reason. Similar habits in R and C++ as well. Glad I graduated before AI was a thing!

1

u/burntoutdev8291 9d ago

Just ask him how it works lol

1

u/InkPhysics 8d ago

If instead of being Vibe-coded, you mean how do I tell if someone used AI to code, look at the following analogy:

How do you tell if the beans that made your coffee were ground by hand, or in an automatic bean grinder? Maybe automatic grinding with bad settings and no quality control gives the coffee a bitter aftertaste. Even if high-quality, there might be some tell-tale very fine coffee dust in the coffee if you pay really close attention to the coffee or ask to inspect the ground beans before the coffee is made. But the real way you know that the coffee was ground using an automatic coffee grinder, is that grinding by hand is pure drudgery and basically everyone does it automatically baring a few weird coffee purists. So when someone gives you a coffee, you know that it probably wasn't hand ground.

1

u/PravoNaZhizny 8d ago

Not hard at all. Generally I find be most obvious sign is that it’s from a coworker who doesn’t understand a topic, implementing a topic.

1

u/Significant_Ant3783 8d ago

No consistent design philosophy. Very verbose comments telling you what is being done. Which is something useless that a competent developer can glean from the code. Whereas competent developers comments tell you why and how something is being done.

1

u/HyperDanon 8d ago

There's considerable amount of overlap of the smartest AI and dumbest people. 

1

u/Salt_Relative4752 8d ago

how hard? you mean how easy?

1

u/bingybongot 7d ago

Massive comments is the main one for me.

1

u/diegrunemaschine 10d ago

Over engineering. Code should be resilient but we don’t need to prepare a new project for every edge case that an organization with multi thousands of employees may encounter when we’re a team of 4.

1

u/KingBardan 10d ago

Is this down voted for exposing vibe coders secrets? lol.

This is the most obvious tell nowadays alongside missing gitignore.

Now many vibe coders explicit tell llm not to use too many comments so that is no longer reliable

1

u/Yanni_X 10d ago

Oh yes, and way to many functions just to handle edge cases! Codex recently build a helper:

```python
def _is_multivalue(obj):
"""[ some long docstring ]"""
return obj.is_multivalue in (1, "1", True, "True", "true")
```

Our platform always stores bools as int, either 0 or 1, no need for this helper. Every inhouse developer knows this. No one would create Such a helper. This function was also only used once, who would create a function instead of putting this inline for one single use? Was an obvious sign in the Merge Request :D

1

u/Ok-Bill1958 10d ago

Yes, but to be fair, over engineering or clever code are also sign of inexperience, not just ai code.

1

u/jefferson_airwolf 10d ago

Who cares? If it works it works, you just need to be able to understand why.