Published: October 22, 2025
25
17
1.1k

I be using Codex, as you can tell.

Image in tweet by Lucas Atkins

@LucasAtkins7 This code is extremely dangerous. Here, I improved it.

Image in tweet by Lucas Atkins

@karpathy That was a close one, thanks.

@karpathy @LucasAtkins7 I love how everyone is totally missing the joke.

@karpathy @LucasAtkins7 the "funniest" part is that this way of checking the file exists is a race condition

@karpathy @LucasAtkins7 Are you the guy who taught every person at Google to review code? Looks like the end result of every changelist I worked on there, except you missed adding tests to ensure that the exception handling you added logs correctly. And also, now that you've touched the test suite, you

@karpathy @LucasAtkins7 Apologies sir Don’t understand why it’s dangerous. (Likely won’t help to explain into my ignorance either) Just fix it. Nothing should be on any run time term root cause *danger*

@karpathy @LucasAtkins7 you forgot the pass print(' failed to load, defaulting to env variables') which then gets teh env variables with a try pass to a hardcoded default

@karpathy @LucasAtkins7 if your py 3.8 or higher for the package: from __future__ import annotations from typing import Final #: no exposed to __doc__ but works MOO: Final[dict[str, list[int | str]]] = { 'builtins': ['for_common_vs_classes_from_typing', "prefer pathlib over os", "if you logging as

@karpathy @LucasAtkins7 If you give it some examples and counter examples it improves dramatically. In a reasonably sized codebase those examples are 'built in' but in the small codebases you work on you are more likely to get this slop. Personally when I talk to an assistant I customize it with

@karpathy @LucasAtkins7 karpathy-in-the-loop

@karpathy @LucasAtkins7 Hahaha this was a good meme it took me a second to realise satire

@karpathy @LucasAtkins7 Think you missed some cases in the try catch. Ain’t getting past review buddy.

@karpathy @LucasAtkins7 You make me calm 😌🙏 (i’m not sure why 🤷‍♀️)

@karpathy @LucasAtkins7 English may be the new coding language, but clean code is still the language of production.

@karpathy @LucasAtkins7 Live with a little danger andrej

@karpathy @LucasAtkins7 Hope you get around to applying these software best practices to professionally harden your repos.

@karpathy @LucasAtkins7 And they say python uses less lines!

@karpathy @LucasAtkins7 I can finally read python 🙂

@karpathy @LucasAtkins7 Trained on too much big tech code

@karpathy @LucasAtkins7 AI is a cowardly programmer

@karpathy @LucasAtkins7 As if the try catch isn’t bad enough, the lazy imports are added.

@karpathy @LucasAtkins7 did you do this with codex as well? :-)

@karpathy @LucasAtkins7 خطير ود كرباثي

@karpathy @LucasAtkins7 the code was a disaster as soon as you named the file .py

@karpathy @LucasAtkins7 You didn’t add a unit test for each code path. Shame on you and Claude

@karpathy @LucasAtkins7 wait but the op is a cto, surely he knows what he's doi....

@karpathy @LucasAtkins7 Truth is @karpathy is the AI behind @AlmanaxAI

@karpathy @LucasAtkins7 Did you generate the improvement with anthropic? :)

@karpathy @LucasAtkins7 Love the inlined import but could have done with a few more exception handles.

@karpathy @LucasAtkins7 Next it'll report you to FBI 🤣

@karpathy @LucasAtkins7 You forgot the fallback where it just loads a random json so you never know what actually failed

@karpathy @LucasAtkins7 Retries three times as if the file might heal itself. It checks everything except your horoscope. new file name : _load_json_enterprise_safe_v12_final_FINAL_production_ready.py

Image in tweet by Lucas Atkins

@karpathy @LucasAtkins7 Yes, there’s more English than Code in that snippet. LLMs love to chat.

@karpathy @LucasAtkins7 I love how I understood the reference right away

@karpathy @LucasAtkins7 Karpathy I love you

@karpathy @LucasAtkins7 Funny how an engineer I work with made the suggestion to use try catch with context manager in code review.

@karpathy @LucasAtkins7 I am glad we still write and communicate math with single letter names. Probably why math people carved out computer science to keep the crazies in one place.

Image in tweet by Lucas Atkins

Share this thread

Read on Twitter

View original thread

Navigate thread

1/38