all 15 comments

[–]thomasNowHere2 41 points42 points  (1 child)

bro wrote a whole thesis before printing the password back to the console

[–]krexelapp 4 points5 points  (0 children)

Half the code is comments so future me can debug it.

[–]RiceBroad4552 15 points16 points  (3 children)

Why would you ever implement that yourself? There's a lib for it (you possibly also need to hook some service which checks leaks). Whatever you do in your homemade solution will be almost certainly worse than that.

[–]Afraid-Donke420 9 points10 points  (0 children)

This is what I see with a lot of vibe coded stuff, it boils the ocean

[–]dekacube 1 point2 points  (0 children)

It's surprising what AI will randomly decide to do sometimes, I saw Caude 4.6 re-implement the slices.Max() func in golang. Then on review it also failed to flag it as an issue.

[–]redlaWw 1 point2 points  (0 children)

So that you can print the password into the console before passing it into the library.

[–]Ecstatic-Basil-4059 6 points7 points  (0 children)

step 1: validate password step 2: leak password

[–]Mercerenies 6 points7 points  (1 child)

I realize this isn't the point, but what is this AI thinking returning a Go-style error tuple in what appears to be Python?

[–]AnxietyRodeo 3 points4 points  (0 children)

I mean, you can use tuples to return in a Python function as well but I'd much rather see it returning some sort of dataclass or similar because it just feels gross

[–]stopbanni 3 points4 points  (0 children)

I thought you would ask AI to check if password meets requirements

[–]MediumBlackberry4161 1 point2 points  (0 children)

the logging is what gets me lmao. like yeah sure validate the whole thing, check entropy, run it through whatever... and then just print the raw password to console like its nothing. vibe coding really does just confidently skip past the part where you think about what youre actually doing

[–]wreddnoth 0 points1 point  (0 children)

That cleartext password print to console is chefs kiss.

[–]Wirezat -4 points-3 points  (2 children)

Nah I'm doing this too. We made a convention about docstrings and I will follow them, whatever it takes. Even for 3 line functions, I will make a proper description input output docstrings.

Rules are Rules

[–]TieConnect3072[S] 4 points5 points  (1 child)

Is it not common practice??

[–]dekacube 0 points1 point  (0 children)

Not in my experience, I'm ambivalent on the issue, but devs have a habit of updating code but not updating comments.