Patterns for Short Code

I had Claude Code create a PR to update my Unicoder tool. As part of that, I prompted it to repeatedly: Shorten the code by exploring opportunities to rewrite more elegantly. Finally, I asked it: You applied several changes to refactor the code for elegance and brevity. What were the principles you applied? List them all with examples. The objective is to teach me how to shorten and simplify code elegantly. Its response was a good tutorial on refactoring to shorten and simplify code. ...

Thanks Pratap Vardhan – this was my best birthday gift this year! LinkedIn

Nano Banano Pro has excellent text generation (though it doesn’t always give you what you want in the first try). I couldn’t spot any errors in the generated text. Can you? I used this prompt (with the workshop details and my photo): Create a professional poster for the below, including all relevant information. Use my photo (attached) professionally. The NPTEL workshop is real, BTW. First 100 seats, I think. You can register here: https://elearn.nptel.ac.in/shop/iit-workshops/ongoing/computer-science/applied-vibe-coding-workshop/ ...

While meditating, I realized 75% of “LULL” is the letter “L”. (This sort of thing happens a lot when I meditate.) MUMMY (60% M) and DADDY (60% D) have lower percentage, but are longer, so maybe get a bonus? I asked Claude Code what would top such a list. It picked a dictionary, generated the 333 words with 4+ letters and >50% concentration. What did I like best? “ASSESSES”. 5/8 letters are “S”. That’s nearly two-thirds. ...

When I realized Aishwarya Rai begins and ends with AI, I had to find out if there were more like her. It took a coding agent (Claude Code in this case) 10 minutes to find the 10 celebrities who share that distinction, at least across the 24,086 names on Wikipedia: Ai Nagai - Japanese playwright Aiguo Dai - Chinese-American atmospheric scientist Ai (poet) - American poet Aisea Nawai - Fijian rugby player Ai (singer) - Japanese-American singer Aisha Chughtai - Pakistani actress Aiyappan Pillai - Indian social reformer Aizawa Seishisai - Japanese Confucian scholar Ainmuire mac Sétnai - Irish high king Aisha Yousef al-Mannai - Qatari artist Glory be to these AI bookends! ...

Habits of a code addict

AI can be held to account

“Humans can be held to account. Not AI.” I hear this often. But it’s not true. Corporations are non-human, but they can enter into contracts and face criminal charges. Ships can be sued directly. Courts can arrest the vessel itself. Deities and temples in India can own property. Forests and rivers in New Zealand, Colombia, Spain, have been granted legal personhood. Medieval Europe has held animal trials (e.g. for “guilty” pigs). ...

I always wondered why old movies are rated so high on IMDb. For example, 12 Angry Men (1954) with just ~900K votes ranks about as high as Inception (2010) with ~2M votes. Few people I know have seen 12 Angry Men. So where does this high rating come from? My theories were: Old movies really are that good. IMDb’s algorithm is biased towards old movies. People remember older movies fondly. Actually, it’s none of these. It’s selection bias. ...

If a bot passes your exam, what are you teaching?

It’s incredible how far coding agents have come. They can now solve complete exams. That changes what we should measure. My Tools in Data Science course has a Remote Online Exam. It was so difficult that, in 2023, it sparked threads titled “What is the purpose of an impossible ROE?” Today, despite making the test harder, students solve it easily with Claude, ChatGPT, etc. Here’s today’s score distribution: ...

Is all AI content slop?

Is all AI content slop? I asked Claude to: Analyze this thread. Then explain it like a Malcolm Gladwell New Yorker article. https://news.ycombinator.com/item?id=45820872 It gave me a beautiful, engaging and insightful essay about a 300+ message debate about AI vs humans on routine tasks. https://claude.ai/share/60c5810f-5c81-4970-8026-a24bf89c3392 Is this slop? One phrase stood out: There’s an irony here that the commenter doesn’t quite state but implies beautifully: we’ve spent so long celebrating automation because humans are imperfect that we’ve forgotten we also value humans because they’re imperfect. ...

OpenAI TTS cost

The OpenAI text-to-speech cost documentation is confusing. As of 2 Nov 2025: GPT-4o mini TTS costs $0.60 / MTok input and $12.00 / MTok audio output according to the model page and the pricing page. They also estimate this to be ~1.5c per minute - both for input and output. It supports up to 2,000 tokens input. TTS-1 costs $15 / MTok speech generated according to the model page but the pricing page says it's $15 / MChars. No estimate per minute is provided. Is supports up to 4,096 characters input. TTS-1 HD is twice as expensive as TTS-1 I wanted to find the approximate total cost for a typical text input measured per character and token. ...

Sometimes, technology creates truly memorable moments. Like when email connected me with my schoolmates in 1993. Or WhatsApp connected me with long-lost relatives in 2010. Today, Google Gemini took me back 55 years, converting the grainy black-and-white wedding photos of my parents into vivid high-resolution color images. So many people. Much younger. More alive. I look forward to when I can watch the video. Move around. Talk to them… Prompt: Convert this black and white photo to color. CAREFULLY ensure that the photo, especially faces, are EXACTLY the same. Use vivid colors and sharp photography, like in modern digital photos. Model: gemini-2.5-flash-image (nano-banana) Temperature: 0 ...

When to choose AI over humans

I charted the OpenAI GDPVal paper with industry compensation as the size and AI augmentation as color. Big green areas are we’re paying people where AI does better. Click here to see the interactive visualization. Clicking to see some actual tasks compared. I use this to check whom to ask advice: AI or professional. AI beats Personal Financial Advisors ~64% of the time. So I invested half my money using ChatGPT’s recommendation. (UTI Nifty 50, if you’re curious.) ...

I asked multiple coding agents and models to build the same app: Create a single-page web app at index.html that beautifully renders a GitHub user profile and activity comprehensively. Pick the ID in the URL ?id=…, default to ?id=torvalds. … and compared their quality, cost, and speed. My observations: Quality variance is the highest. Some models / agents produce great visuals, some average, some fail completely. Cost and time variance are lower among the successful models. About 2X variance in each. ...

Workshops That Teach Me More Than You

I don’t charge for workshops. Altruism? No: it’s self-interest. “If you’re not paying for it, you’re not the customer; you’re the product being sold.” Andrew Lewis, via Tim O’Reilly, 2010. My workshop process is designed to benefit me first. I pick topics I want to learn, not stuff useful to the audience. Example: I picked DuckDB for my PyCon India 2025 talk to learn it. ...

Tamil AI

I was testing LLMs’ sense of Tamil humor with this quote: Extend this post with more funny Tamil words that end with .ai - mentioning why they’re funny. Chenn.ai is the artificial intelligence capital of India. Kadal.ai Kad.ai Dos.ai Vad.ai Ad.ai Thal.ai Mallig.ai Aratt.ai And finally Podad.ai All spoken in namma bash.ai 😅 The Chinese models didn’t fare well. DeepSeek made up words. Mood.ai - An AI that perfectly captures your mood. Sokk.ai - The AI for when you’re bored. Thanni.ai - A hydration assistant. Qwen too. ...

How to create a data-driven exam strategy

Can ChatGPT give teachers data-driven heuristics on student grades? I uploaded last term’s scores from about 1,700 students in my Tools in Data Science course and asked ChatGPT: This sheet contains the scores of students … (and explained the columns). I want to find out what are the best predictors of the total plus bonus… (and explained how scores are calculated). I am looking for simple statements with 80%+ correctness along the lines of: ...

Vibe-Coding for Interesting Data Stories

Last weekend, I fed Codex my browser history and said “explore.” It found a pattern I call rabbit holes – three ways we browse: Linear spiral - one page > next page > next. E.g. filing income tax, clicking “next” on the PyCon schedule. Hub & spoke - hub > open tabs > back to hub. E.g. exploring DHH’s Ubuntu setup, checking Firebase config. Wide survey - source > many, many pages. E.g. clearing inbox, scanning news. Then Claude Code built this lovely data story. ...

The Non-Obvious Impact of Reasoning Defaults

Yesterday, I discovered how much reasoning improves model quality. My Tools in Data Science assignment asks students to draft an llms.txt file for ipify and auto-checks with GPT-5 Nano - a fast, cheap reasoning model. I set reasoning_effort to minimal and ran this checklist: 1. Starts with "# ipify" and explains ipify. 2. Markdown sections on API access, support (e.g. GitHub, libraries). 3. Covers API endpoints (IPv4, IPv6, universal) and formats (text, JSON, JSONP). 4. Mentions free, no-auth usage, availability, open-source, safeguards. 5. Has maintenance metadata (e.g. "Last updated: <Month YYYY>"). 6. Mentions robots.txt alignment. Stay concise (no filler, <= ~15 links). If even one checklist item is missing or wrong, fail it. Respond with EXACTLY one line: PASS - <brief justification> or FAIL - <brief explanation of the first failed item>. With a perfect llms.txt, it claimed “Metadata section is missing” and “JSONP not mentioned” – though both were present. ...

Tools in Data Science Sep 2025 edition is live: https://tds.s-anand.net/. Major update: a new AI-Coding section and fresh projects. I teach TDS at the Indian Institute of Technology, Madras as part of the BS in Data Science. Anyone can audit. The course is public. You can read the content and practice assessments. I fed the May 2025 term student feedback into The Sales Mind and asked: What are the top non-intuitive / surprising inferences? What are interesting observations? What are high impact actions? Full analysis: https://lnkd.in/gVWVqaxN: summary, outliers, and action ideas. ...