Explain C# code

Paste C#, LINQ queries and records included, and Vibe explains what each line returns and when the query actually runs.

Batches.cs

Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.

Vibe16 lines selected

Press Explain it for the sample, or paste your own code first.

What this C# sample shows

LINQ
Where keeps the batches whose minutes add up to at least minimum, and OrderBy sorts what is left by name. With beta (20 minutes), alpha (10 and 5) and tiny (2) and a minimum of 15, the result is alpha, beta: >= keeps alpha at exactly 15.
records
sealed record TaskBatch(string Name, List<int> Minutes) declares a class from its two values. C# writes the Name and Minutes properties, value equality and a ToString that lists each property, though for the list it prints only the type name, not the numbers.

Good to know

  • batch with { Name = name } returns a new record and leaves the old one alone: renaming alpha to copy gives a second batch, and the original is still named alpha.
  • with copies the reference to the list, not the list. Add 7 minutes to the copy's Minutes and the original changes too: both now total 22.
  • Record equality compares each property with that property's own Equals. Two batches named a that share one list are equal, but with a new list of the same numbers they are not, because a List<int> is only equal to itself.

Watch out: LongBatches returns a query, not a list, and the query runs again every time you loop over it. Add a delta batch of 30 minutes to the source list after calling it and the same result now gives alpha, beta, delta, while a ToList() taken before still holds alpha, beta.

Explain C# code beside your editor

Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).

Install on Mac

curl -fsSL https://unvibe.site/install.sh | bash

Paste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.

No install warning? Use Unvibe in your browser

Opening the .dmg the first time
  1. Open the .dmg and drag Unvibe to Applications.
  2. Open it once; macOS says it can't verify it. Click Done.
    macOS dialog: Unvibe Not Opened, with Done and Move to Trash
    Real screen, macOS 15
  3. System Settings › Privacy & Security › Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.
    macOS Privacy & Security, Security section: Unvibe was blocked to protect your Mac, with the Open Anyway button
    Real screen, macOS 15

The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open