今日已更新 119 条资讯 | 累计 20985 条内容
关于我们

标签:#programming

找到 1386 篇相关文章

开发者

C# 14: The `field` Keyword — Cleaner Properties, Zero Boilerplate

C# 14: The field Keyword — Cleaner Properties, Zero Boilerplate Every C# developer has been there. You start with a clean auto-property, then requirements change and you need to add a tiny bit of validation. Suddenly that one-liner explodes into six lines of boilerplate — a private backing field, a getter that just returns it, a setter that assigns it. The logic is two words. The ceremony is everything else. C# 14 fixes this with the field keyword: a contextual keyword that refers to the compiler-synthesized backing field of a property, letting you write custom accessor logic without ever declaring an explicit field. The Problem: Boilerplate Tax on Simple Properties Auto-properties are one of C#'s best quality-of-life features. This is clean: public string Username { get ; set ; } But the moment you need to trim whitespace on assignment, that cleanness evaporates: private string _username = string . Empty ; public string Username { get => _username ; set => _username = value . Trim (); } You now have six lines — and four of them exist only to hold the shape of the pattern together. The backing field _username is not carrying any meaningful design weight. Its only job is to be a storage slot that Username uses privately. You already know the compiler creates one for auto-properties. You are just forced to make it visible so you can reference it. This is the boilerplate tax. You pay it every time you add even the smallest piece of logic to a property. Why field Exists The C# language team has discussed this friction for years. The challenge was finding syntax that is: Unambiguous — no conflict with existing identifiers Familiar — consistent with how value works in setters Scoped — only meaningful inside a property accessor The solution landed in C# 14: the contextual keyword field . Just like value refers to the incoming assignment in a setter, field refers to the hidden backing storage the compiler manages for the property. It is contextual, which means it only acts

2026-06-11 原文 →
AI 资讯

Your Agent Returns 200 and Lies. Verify Before You Trust

A success gate verifies an AI agent's claimed success before your system accepts it. SuccessGate runs three read-only checks — schema/contract, claim-vs-evidence against the actual tool-call trace, and an optional post-condition probe — and turns a silent 200 into an explicit REJECTED with reasons. It's stdlib Python, needs no API key, moves nothing, and ships with a self-test you run in one command. Here's the failure that started this for me. An agent in a CRM workflow reported {"status": "sent", ...} for an invoice. Clean run. Green dashboard. 200 OK. The invoice went to a customer id that wasn't on our allow-list — a near-miss hallucination the model was completely sure about. Nothing crashed. No exception, no stack trace. We found it days later, downstream, the expensive way. That's not a rare bug. It's the default failure mode of agents in production, and it has a name now: silent-success drift . Cycles' writeup put it bluntly — "200 OK Is the Most Dangerous Response in Production" : "The most dangerous failures look like success." And the measurements back it up. The Berkeley Function-Calling Leaderboard (BFCL v3) puts frontier-model structurally invalid tool calls at 2–5% even on clean benchmark prompts — higher in noisy production ( via Future AGI ). The arXiv paper Agent Behavioral Contracts reports that across 1,980 sessions , contracted agents caught 5.2–6.8 soft violations per session that uncontracted baselines missed entirely. So the question is not how do I see failures sooner . It's how do I stop accepting a success the agent never actually achieved. TL;DR A 200 and a "status": "done" are claims, not proof. Agents return both while doing the wrong thing — or nothing. Observability is tracking : it tells you a call happened. It can't tell you the result was correct. That's a control problem. verify() runs three checks before you accept success: (1) schema/contract (shape, types, enums/allow-list), (2) claim-vs-evidence (did the agent actually call th

2026-06-11 原文 →
AI 资讯

You Don't Need Another Agent. You Need a Linter.

In my last post I complained — a lot — about product managers and how they made my life hell with vibe code. PS: apologies, manager, if you're reading this — but it's true. Now, I'm not here just to complain. There were a lot of learning opportunities too, like how to handle legacy / vibe code. Because at the end of the day, both are the same: no one knows how they work, but somehow they keep working. Touching them is like defusing a bomb — you never know how your change might cascade and break the core logic. The good news is that vibe code is much simpler than legacy. AI, in all its glory, tries to write perfect-looking code — proper function names, comments, the works — not like legacy code where a single function runs 500 lines, with spaghetti names all over that make no sense and comments that are out of date. And that makes it something I can actually handle. I still don't have a perfect, step-by-step playbook — but I've got pieces. The first one. The cheapest and the oldest one. The one the industry solved decades ago and the whole "AI built my app in a day" crowd somehow forgot exists. A linter. Yes, you heard me right. A linter. ESLint. Most people who've been in this industry already know it. It's the most boring, reliable tool in the box. But in an era where the answer to every problem is "add another AI," it's worth saying out loud why the boring tool still wins. What a linter actually is If you vibe-coded your way into this world, or you're new to web dev in general and have never heard the word "lint", here's the honest version. A linter is a set of rules you add to your repo. It reads your code without running it, checks it against those rules, and flags everything that's broken, sloppy, or about to bite you in production. The detail people get wrong: it's not a grep for bad words. A real linter parses your code into a syntax tree and actually reasons about its structure — what's imported, what's called, what's reachable, what types flow where. That's

2026-06-10 原文 →
AI 资讯

CLI over MCP: a small Chrome DevTools experiment in Copilot CLI

I ran the same browser smoke task through two paths: direct Chrome DevTools MCP and a custom CLI skill around mcp2cli . In GitHub Copilot CLI with gpt-5.3-codex-medium , direct Chrome DevTools MCP added about 5k tokens of upfront context before the agent did any work. The runtime table is too small and too noisy to rank the tools. The useful question is where the agent pays to discover the browser-control surface. mcp2cli README says it can “Save 96-99% of the tokens wasted on tool schemas every turn.” That is a strong claim and frankly I didn't no expect that sort of numbers... It's just the CLI part resonates with me - (a) there's no system prompt pollution with CLI, (b) if you choose between gh CLI and GitHub MCP the former would be better due to the fact that model already knows the tool and there's less tokens wasted on JSON schemas and tool calls. I used Chrome DevTools MCP a lot and I have chosen this MCP as a test bed to try mcp2cli . This came handy cause I started my experiments with the minimal pi coding agent and it doesn't bundle any MCP integration, just the basic bash tool, I was very much happy not to bloat my instal with a dedicated MCP plugin. Although in this cases I cmpared MCP vs CLI using a fully fledged GitHub CLI. Tool discovery is part of the experiment. Native MCP gives the agent a tool surface by loading schemas into context. A CLI wrapper makes the agent discover the surface the way it discovers any other command-line tool: list, search, ask for help, run a small probe, write down what worked. That changes where the discovery cost lands. The Setup I ran this in GitHub Copilot CLI using gpt-5.3-codex-medium : Copilot stock MCP servers were disabled. The app under test was a private Pythobn/Streamlit codebase. The browser task was the same 9-step smoke test in both variants. One variant used direct Chrome DevTools MCP. Another variant used a custom skill that wraps Chrome DevTools MCP via mcp2cli . The custom skill itself started as an ad-h

2026-06-10 原文 →
AI 资讯

# I Just Published My First npm Package — Here's Everything I Did

A complete walkthrough of publishing Cartlify — a React e-commerce UI kit — to npm for the first time. The Milestone Yesterday I published Cartlify to npm. npm install cartlify It sounds simple. But getting to that one line took more decisions, more configuration, and more trial and error than I expected. This article covers everything — from setting up the build config to the actual publish command — so you don't have to figure it out the hard way. What Is Cartlify? Cartlify is a production-ready React + TypeScript + Tailwind CSS component library focused on e-commerce UI. 4 components that every e-commerce project needs: ProductCard — 3 layout variants, image gallery, wishlist, sale badges, skeleton loading CartDrawer — animated slide-in, focus trap, ESC dismiss, quantity stepper CheckoutStepper — horizontal/vertical, animated connectors, keyboard navigation PageLoader — 4 animation styles, 3 position modes Plus 3 utility hooks, 11 tree-shakeable icons, 40+ CSS design tokens, full dark mode, and 141 Jest + React Testing Library tests. Built so freelance developers and indie makers can skip the painful e-commerce UI layer and ship faster. Why Publish to npm? Before npm, Cartlify was only available on Gumroad as a paid download. That's fine — but npm adds something Gumroad can't: Developer sees Cartlify → runs npm install cartlify → evaluates the compiled output → trusts the quality → buys the full source on Gumroad npm is a credibility and discovery channel — not just a distribution method. A package on npm signals that something is real, maintained, and production-ready. Also: npmjs.com gets millions of developer searches every month. That's free traffic you can't get from Gumroad alone. The Build Setup — tsup The most important decision before publishing is how you bundle your library. I chose tsup — a zero-config TypeScript bundler built on esbuild. Here's why: Tool Config needed Speed Output Rollup Lots Medium ESM + CJS Webpack Heavy Slow CJS only Vite lib mode

2026-06-10 原文 →
AI 资讯

Generation-Side Tooling Outpaces Validation-Side Tooling

The generation side is shipping fast (TileGym, AutoKernel, KernelEvolve). The validation-side surface for “what the kernel actually did at runtime” has not kept pace. TL;DR In the past nine months, three significant releases have landed for auto-generation of CUDA kernels: NVIDIA TileGym , RightNow AutoKernel, and Meta’s KernelEvolve. Each ships training infrastructure for kernel generation. Validation infrastructure (what the generated kernel actually did at runtime, on a real workload, in a production-shaped environment) has not kept the same pace. eBPF traces are the ground-truth layer that closes the gap. What “validation” means at the kernel level Two distinct validation surfaces: Pre-launch: the generated CUDA C compiles, the PTX assembles, the kernel passes a numerical-equivalence test against a reference. Standard compiler / unit-test territory. Generation frameworks ship this themselves. Post-launch: the kernel ran, returned, took N microseconds, used M registers per thread, hit X cache miss rate, and did or did not serialize the rest of the stream behind it. This is the layer that an eBPF trace plus standard CUDA driver counters can answer for any kernel, generated or hand-written. Auto-generation pipelines do not by default close the post-launch loop. They demonstrate “the kernel works in our test setup”. They do not demonstrate “the kernel does not regress p99 latency on production inference traffic”. What an eBPF trace adds to a generated kernel Once a generated kernel is in a real workload, the same trace surface used for any CUDA kernel applies: launch latency from cudaLaunchKernel , sync stalls from cudaStreamSynchronize , host-side overhead from the dispatcher, host scheduling preemption while the GPU is busy. None of those signals are visible to a generation framework that evaluates kernels in isolation. -- post-launch validation: did the new generated kernel regress p99? SELECT kernel_name , COUNT ( * ) AS launches , AVG ( duration_ns ) / 1 e3 AS

2026-06-10 原文 →
开发者

ReactJS Syntax For Web Components

Im investigating an idea i had about JSX for webcomponents after some experience with Lit. I am sharing this here because it might be interesting/educational for someone, if it isnt, let me know and i'll remove the post. Lit is a nice lightweight UI framework, but i didnt like that it was using class-based components. Vue has a nice approach but i prefer working with the syntax that React uses. I find it more intuitive for debugging and deterministic rendering. I wondered if with webcomponents, i could create a UI framework that didnt need to be transpiled. Read the docs Checkout the code Storybook demo (My intentions with this framework is to get to a reasonable level of stability, to then replace React on some of my existing projects.) IMPORTANT: Im not trying to promote "yet another ui framework", this is an investigation to see what is possible. You should not use this framework in your own code. It is not production-ready. It is not on NPM. Im not looking for another framework to replace React (im trying to create it). This framework is intended for myself on my own projects. This project is far from finished. Feel free to reach out for clarity if you have any questions. submitted by /u/Accurate-Screen8774 [link] [留言]

2026-06-10 原文 →
AI 资讯

Thinking in Graphs: A Cypher Crash Course for SQL Engineers | by Aayush Ostwal | Jun, 2026

I've written SQL for over a decade. Joins, subqueries, recursive CTEs – the whole deal. Then I tried a graph database (Neo4j). And my relational muscle memory kept getting in the way. I kept trying to "map foreign keys" instead of just… traversing edges. So I built myself a side‑by‑side cheat sheet: SQL → Cypher for everything from basic SELECTs to variable‑length paths that would require recursive CTEs in PG/SQL Server. Turns out, queries like "users who bought this also bought…" go from 30 lines of self‑joins to 6 lines of zig‑zag pattern matching. If you've ever felt frustrated with: multi‑hop join performance LIKE '%...%' on string scans or just the sheer noise of mapping join tables for many‑to‑many …give this 5‑min read a shot. The mental shift alone (relationships as physical edges, not ID matching) changed how I model data – even when I go back to SQL. submitted by /u/ostwal [link] [留言]

2026-06-10 原文 →
AI 资讯

Built my first proper agentic AI project

Over the last few weeks, while learning LangGraph and agentic systems, I ended up building Co-Founder Memory . It's a stateful AI assistant with: • long-term memory • planning loops • self-correcting RAG • web search fallback • automated timeline summaries • project and preference tracking Nothing revolutionary — many ideas already exist. The goal wasn't to reinvent memory, but to understand how these systems work by actually building one. A lot of concepts only started making sense once I had to connect them together: graph-based workflows with LangGraph memory extraction and storage retrieval and validation loops routing and planning nodes maintaining context across sessions Building it taught me far more than watching tutorials ever did. Repo: https://github.com/Somay-kousis/Co-Founder-Memory I'm currently entering my 3rd year at IIITM Gwalior and looking for ML / GenAI internships . If you're building interesting things around LLMs, agents, RAG, or AI products, I'd love to connect. Always happy to chat with fellow builders as well 🚀 AI #GenerativeAI #LangGraph #RAG #LLM #MachineLearning #Internship

2026-06-10 原文 →
AI 资讯

Why I Stopped Using reset() and end() in PHP (And What I Use Now)

If you have been writing PHP for a year or two, you have almost certainly written something like this: $items = getFilteredOrders (); $first = reset ( $items ); $last = end ( $items ); It works. It runs. It looks fine in code review. And it contains a subtle bug waiting to happen. The problem with reset() and end() Both functions move PHP's internal array pointer as a side effect. PHP arrays have a hidden cursor that tracks "the current position" in the array. Functions like current() , next() , prev() , and each() depend on where that cursor sits. reset() moves it to the first element. end() moves it to the last. This is harmless in an isolated script. But in a real application, the same array often passes through multiple functions — and any function that relies on the cursor position after your call will get unexpected results. Here is a concrete example: function getFirstActiveOrder ( array $orders ): ?array { // Moves the pointer to the first element $first = reset ( $orders ); foreach ( $orders as $order ) { if ( $order [ 'status' ] === 'active' ) { return $order ; } } return null ; } At first glance this looks fine. But foreach in PHP actually resets the pointer to the beginning before iterating — so in this simple case you get lucky. The bug shows up in less obvious situations: when you call reset() inside a function that the caller is already iterating with current() / next() , or when you use end() to peek at the last item while a foreach is in progress on the same array reference. The deeper issue: reset() and end() return false on an empty array. But false might also be a legitimate value stored in your array: $flags = [ true , false , true ]; $last = end ( $flags ); // returns false — but is this "empty array" or "the value false"? You have to write: if ( $flags === [] || end ( $flags ) === false ) { ... } Which is already awkward. And it still mutates the pointer. The modern solution: array_key_first() and array_key_last() PHP 7.3 introduced two functi

2026-06-10 原文 →
AI 资讯

Are we becoming developers of .md files?

AI has become part of our lives, whether we like it or not, and it doesn't seem to be going away anytime soon. People seem to be using AI on many different levels, ranging from those still trying to avoid it, to people actively playing with it, trying to break it and find its limitations. The same goes for companies. There are those still barely using AI, those using it for absolutely everything, hoping it's a magical solution to their problems, and those in between. If you're more on the heavy use side, agents and instruction files are probably part of your daily discussions now. For our AI’s to work correctly they need the correct instructions, so they know how we want them to respond, how our project works, etc. We can use .md files to supply these instructions and/or context to the models. Those little markdown files are getting a huge importance in the development lifecycle. Since we can use the same file in each request we make, we can put in it the specifics of our project, as detailed as we want, so the model has as much information as possible to work with. “Garbage in, garbage out” makes sense here because, in theory, the better information the model has, the better results it can provide. Because of that, we're having to be more careful with the way we write them. Although markdown isn't something new, I don't know about you, but I haven't done much markdown writing before, so this feels like another tool to learn, like we're adding a new language on our tech stack. When I say is something else to learn, I don't mean learning only the markdown syntax, but also the correct way of writing all the instructions. A development stack now could look like: HTML, CSS and JavaScript for frontend, a language like Java, a framework like Spring or Quarkus, and SQL for the backend, and now .md files and markdown for the agents. I know I'm being very simplistic here, there are a lot more pieces of technology I didn't mention, but you got the idea, right? Besides everyth

2026-06-10 原文 →
AI 资讯

🤖 Your AI Agent Is Failing in Prod — You Just Don't Know It Yet

The demo is impressive. ✅ The demo works in your environment, with your data, with you watching. ✅ Production? Silent failures. Cost overruns. Wrong tool calls. Stuck loops. No fallback. ❌ Agents in 2026: The Real Problem Here is the thing most people are not talking about when they ship AI agents: A demo agent and a production agent are completely different things. A demo is: "watch this work once." A production agent is: "what happens when it is wrong, stuck, expensive, over-permissioned, or called 10,000 times by real users?" That second question is what separates a cool technical proof-of-concept from something a business can actually rely on. Demos are not systems. 1️⃣ The 7 Things That Break in Prod In every agent hardening sprint I run, the same failures show up: Failure Mode What It Costs No logging You have no idea what the agent did or why No eval set You cannot measure quality or catch regressions Unlimited tool access Agent calls tools it should never touch No retry logic Transient failures become permanent failures No memory rules Context leaks between sessions or inflates cost No fallback path Agent loops or crashes instead of escalating No cost checks 1 misconfigured prompt → $400 API bill overnight If your agent is in production with 3 or more of those missing — you are one bad prompt away from a very expensive incident. 2️⃣ The Production Hardening Checklist Before you call an agent production-ready, run through this: Eval set exists — at least 20 test cases covering happy path + edge cases Structured logging — every tool call, every input, every output, every error — logged and searchable Retry logic — transient API failures handled gracefully, not crashed Tool limits — agent cannot call tools outside its defined scope Memory rules — what carries over between sessions, what gets cleared, how context is compressed Fallback paths — when the agent gets stuck or uncertain, it has an exit: escalate to human, return partial result, surface an error Cost

2026-06-10 原文 →
AI 资讯

⚡ Proof Compounds. Claims Decay. — Why Delivery Is Your Next Marketing Asset

Here is the move most technical service providers miss: Every project you deliver quietly dies inside a private folder. Every project you deliver with receipts becomes a trust asset that sells the next sprint without you lifting a finger. The Insight Almost No One Acts On Delivery is not the end of marketing. Delivery is where the next marketing asset is born. The before/after screenshot. The launch-readiness report excerpt. The workflow map. The metric improvement. The buyer quote. All of that is proof. And proof is the compound interest of service work. Claims decay. Proof compounds. 1️⃣ What Proof Actually Looks Like This is the proof asset menu. Every sprint should produce at least 1 item from this list: Before/after screenshot — the most shareable format Launch-readiness report excerpt — shows rigor and standard Workflow map — visual, specific, credibility-dense Dashboard screenshot — metrics that moved Test checklist — shows what was verified, not just what was built Client quote — even 1 sentence is worth 1,000 words of claims Metric improvement — "response time dropped from 24 hours to 4 minutes" Public teardown — anonymous version of the diagnosis Case study — structured story: context → pain → fix → result One-minute walkthrough video — screen-recorded, narrated, personal You do not need all of them. You need 1 per sprint. 2️⃣ The Case Study Structure That Sells A case study is not a trophy. It is a reusable trust asset. Use this structure every time: 1️⃣ Context — who had the problem? (anonymized if needed) 2️⃣ Pain — what was it costing them? 3️⃣ Hidden cause — what was really broken underneath? 4️⃣ Fix — what did you change, specifically? 5️⃣ Result — what improved? With a number. 6️⃣ Proof — what artifact backs it up? 7️⃣ Lesson — what should similar buyers do next? That is 7 steps. The whole thing can fit in a LinkedIn post or a page section. And here is the thing most people are not talking about: a case study with a specific number outperforms 10 po

2026-06-10 原文 →
AI 资讯

📊 Distribution Is the Moat — And Most Technical Founders Have None

Products are easier to build. Workflows are easier to automate. Content is easier to generate. But trust is not easier. Attention is not easier. Buyer memory is not easier. The Hard Truth Here is the thing most people are not talking about in 2026: The bottleneck is no longer the product. The bottleneck is whether the right buyer has seen your diagnosis 3 times in 2 weeks. Because that is how trust is built. Not with one perfect post. With repeated, useful presence in the right feed. Distribution is the moat. 1️⃣ Why "Staying Active" Is the Wrong Goal Most founders post to stay active. That is not a content strategy. That is anxiety dressed up as marketing. Every post should do one of 3 things: Make the buyer understand a pain they already have Make the buyer trust your diagnosis of that pain Move the buyer closer to a conversation A post about your tech stack? Probably none of those. A post that says "Your AI app is not launch-ready until auth, payments, logging, and rollback are boring" — that does all 3. 2️⃣ The Five Content Pillars That Build Pipeline Here is the system I use. 5 pillars. Everything maps to one of them: Pillar What It Signals Launch risk Why AI-built products break before production GTM systems How founders turn expertise into pipeline Workflow automation How businesses leak time and revenue Proof and case studies What changed before/after — with receipts Founder operating lessons The discipline behind building for money Every post I write maps to one of these. Not because it is tidy. Because each pillar speaks directly to a buyer who has a specific pain — and positions me as the operator who sees it clearly. 3️⃣ The Daily Format That Creates Pipeline This is the actual weekly posting structure that works: Monday — mistake post: a painful thing technical founders do wrong Tuesday — teardown post: a real example dissected publicly Wednesday — checklist: the 10-item audit your buyer needs Thursday — before/after: what changed after a sprint, with s

2026-06-10 原文 →
AI 资讯

⚡ Your AI Demo Is Not a Product — Here's the Checklist That Proves It

The demo worked perfectly. ✅ Production? First real users. 50% failure rate. ❌ The Gap Nobody Warns You About I see this pattern every week — a founder launches, pushes traffic, and watches their app fall apart in real conditions. Not because the core idea was wrong. Because "it works on my machine" is not a launch-readiness standard. AI-built apps in 2026 ship fast. That is the superpower. But fast shipping without hardening means you are presenting a demo as a product — and real users will find every crack within 48 hours. 1️⃣ What "Launch-Ready" Actually Means Launch-ready is not "the feature works." Launch-ready is when auth, payments, logging, analytics, database permissions, and rollback are boring — because they have already been thought through and tested. Here is the difference: Demo State Launch-Ready State Auth works for happy path Auth handles edge cases, token expiry, role conflicts Payments go through in test mode Webhooks confirmed, retries handled, failures logged Console.log for debugging Structured logging with alerts on errors No analytics Core events tracked from day 1 Manual deploy Automated deploy + rollback path exists No onboarding flow User activation measured from first session If your app is in column one — you are not ready. 2️⃣ The Launch-Readiness Checklist Copy this. Run it before you push traffic. Authentication and authorization — roles, permissions, token handling, session expiry Environment variables — nothing sensitive exposed, prod secrets separate from dev Database permissions — row-level security, no open-read tables, no admin keys in frontend Payment webhooks — test confirmed, failure logged, retry logic exists Error logging — uncaught exceptions surfaced somewhere you will actually see them Analytics events — signup, activation, key action, churn signal — all firing Rate limits — LLM calls protected, API routes guarded Backups and rollback — you have a path back if something breaks Onboarding flow — first session gets the use

2026-06-10 原文 →