Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
159921 stories
·
33 followers

Intent to Ship: JPEG XL

1 Share

It isn’t often that new image formats land in browsers. In the early 2000s we had JPEG, GIF, and PNG. The 2010s gave us WebP, which was a modest step up from JPEG. But the 2020s have given us two new image formats that are a big step up from previous formats: AVIF and JPEG XL.

We shipped AVIF back in 2021, and today we posted our intent to ship JPEG XL. Chrome are also intending to ship, and given there’s already a partial implementation in Safari, the format will be supported across browsers before the end of the year.

Shipping JPEG XL securely

We added experimental support for JPEG XL behind a flag back in 2021. But, at 100,000 lines of multithreaded C++, we were concerned about the attack surface this added to Firefox.

So, we laid down a challenge to the JPEG XL team at Google Research: Build a safe, performant, compact, and compatible JPEG XL decoder in Rust, and we’ll ship it. That challenge was met; Google Research built jxl-rs, and it’s the core of our JPEG XL support in Firefox.

We also pushed for high quality integration tests as part of an Interop 2026 investigation area, and they’re coming along nicely.

Progressive rendering

Although Safari shipped JPEG XL in 2023, their implementation lacked some key features of JPEG XL – our favourite is progressive rendering, which is something we pushed for in the Rust implementation.

Progressive rendering means the image can render as it’s downloading.

An image of a fox curled up in a ball, sleeping amongst some grass, divided into four columns, showing JPEG XL progressive rendering. At 4% it's very blurry. At 15% you can tell it's a picture of a fox. At 50% the full image is clear, but not full resolution. At 100% it's full resolution.

Although the full image is 135 kB, with only a few kB downloaded the user can determine the subject of the image. Try the above demo image in a browser that supports JPEG XL & progressive rendering, like Firefox Nightly – move the slider to see how the image displays with just a portion downloaded.

JPEG XL vs AVIF

Browsers will now have two modern image formats for developers to choose from. Which you choose depends on your use-case.

  • JPEG XL: Excels at lossless imagery, progressive rendering, and further compressing JPEGs without quality loss.
  • AVIF: Excels at web-quality photographic images, and images that have a mix of sharp edges and flat surfaces.

For example:

A fox curled up in a ball, sleeping amongst some grass.

The image above is a 116 kB AVIF with a quality score (SSIMULACRA 2) of 62.8, meaning medium-high quality. To get the same quality, the JPEG XL image would be 134 kB.

At a SSIMULACRA 2 score of 80 (very high quality), the AVIF is 227 kB, and the JPEG XL is 264 kB.

But at lossless, the AVIF is 1.76 MB, and the JPEG XL is 1.45 MB. A lossless WebP is 1.55 MB.

Another example is a screenshot of the Interop 2025 scores:

Interop dashboard showing browser scores. At the top are two large circles: ‘Interop’ with a score of 95 in green, and ‘Investigations’ with a score of 36 in orange. Below are four browser scores in green circles: Chrome 99, Edge 98, Firefox 99, and Safari 98, each shown with their respective browser icons.

At a SSIMULACRA 2 score of 78 (very high quality), the AVIF is 11.6 kB, and the JPEG XL is 23.8 kB.

But at lossless, the AVIF is 164 kB, and the JPEG XL is 92 kB. A lossless WebP is 96 kB.

Although AVIF tends to produce smaller files at web-quality than JPEG XL, AVIF only has basic progressive rendering support. So, for very large images, it may be worth taking the filesize hit with JPEG XL.

The key is to test with a representative set of images for your site, at a quality that works best for your users, and remember to optimise for high density.

The post Intent to Ship: JPEG XL appeared first on Mozilla Hacks - the Web developer blog.

Read the whole story
alvinashcraft
18 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

How Postman Passport keeps API secrets inside your network

1 Share

Distributing API keys to every consumer that needs one is how most teams end up with secret sprawl. A single key gets copied into a shell profile, a .env file, a CI variable, and a shared password manager. Rotate it and something breaks. Revoke a person’s access and the key is still on their laptop somewhere.

Postman Passport takes a different approach. Instead of handing out the underlying secret, it hands out a credential reference: a token that points to a secret without containing it. The real key stays inside your own network, in your secret store. When a request goes through Passport, a proxy running inside your network resolves the reference, injects the actual credential, and forwards the request. The consumer never sees the key.

Postman Passport is available on Postman Enterprise plans with the Advanced Security Administration add-on. See the Postman pricing page for details.

In this post I’ll walk through the architecture: how credential references work, what happens on every request, the security properties Passport enforces, and how teams manage access through namespaces and roles. For the broader “why now” framing, the Postman Passport announcement post covers the product context.

What a credential reference actually is

A credential reference is a token that identifies a secret without containing it. When Passport grants a consumer access to an API, it issues the credential reference. The consumer places the reference into their request wherever the real secret would go. Whether that’s an Authorization header, a query parameter, or a body field, the reference behaves as a placeholder until the proxy resolves it.

References are cryptographically bound to the holder. If someone intercepts a reference in transit or copies it off a machine, it doesn’t work for them. The proxy checks the caller’s cryptographic identity before it resolves anything, and the private key that backs that identity never leaves the holder’s machine. A stolen reference without the matching key is inert.

That is the important shift. In a traditional API key model, possession of the key is authority. Anyone who gets the string can call the API. In the Passport model, the reference on its own has no authority. The authority is the cryptographic identity, and the reference is a pointer that only the identity’s holder can dereference.

The request flow

Here’s what happens when a consumer calls an API through Passport:

  1. The consumer sends a request with a credential reference in place of the real secret.
  2. The request routes through the secure access proxy running inside your network.
  3. The proxy authenticates the caller using a cryptographic certificate.
  4. The proxy checks whether the caller’s scope includes the referenced credential.
  5. If the check passes, the proxy resolves the secret from your secret store and injects it into the request.
  6. The proxy forwards the request to the destination and returns the response.

An example of what the consumer sees might look like this:

GET https://api.internal.example.com/v1/orders
Authorization: Bearer {{passport:cred_orders_read}}

That {{passport:cred_orders_read}} string is the credential reference. On the consumer’s machine, the Postman CLI sends the request through the local access proxy. The destination API sees a normal request with a real Authorization: Bearer <resolved-token> header. The consumer never had the resolved token.

The resolved secret never leaves the proxy. It doesn’t reach Postman, it doesn’t reach the application layer, and it doesn’t appear in any audit record.

The security model

Passport enforces several properties on every request. These are worth understanding because they shape how you reason about what Passport can and can’t protect against.

Identity is cryptographically proven. Each caller presents a certificate to the proxy, and the private key that backs the certificate stays on the caller’s machine. Identity can’t be forged. If a machine is compromised, that machine’s identity can be used from that machine, but identities can’t be lifted and reused elsewhere.

Scope is checked before resolution. The proxy verifies that the caller is authorized for the referenced credential before it contacts your secret store. If a caller tries to resolve a credential outside their scope, the proxy rejects the request without ever touching the store.

Secrets are resolved inside your network. The secure access proxy runs in the same private environment as your services. Secrets get read from your store, used to sign the outbound request, and then discarded. They don’t transit the Postman cloud, and they aren’t written to logs or audit records.

Passport uses your certificate authority as the trust root. Postman authorizes who can be issued a credential reference, but the certificates that prove caller identity are signed by your key. Team Admins can revoke access from your Private API Network at any time.

For teams in regulated industries like finance and healthcare, this design matters because it means secrets never cross an external network boundary. Third-party tools that terminate credentials outside your VPC are often disqualified by compliance policy. Passport keeps the resolution inside your network by design, which is one of the main reasons it fits into environments where other options don’t.

Team workflow: namespaces, managers, and members

Passport uses two roles inside a namespace to control who can add APIs and who can consume them.

Namespace Manager. Approves or denies workspace addition requests and API usage requests, and maps credential references to workspace environment variables. A Team Admin assigns this role.

Namespace Member. Can request to add a workspace so its APIs become available to others, or request access to an API they want to consume.

A typical setup flow looks like this:

  1. A Team Admin sets up the access proxy in Postman.
  2. The Team Admin creates a namespace and adds Namespace Managers and Namespace Members.
  3. A Namespace Member who produces an API requests to add their workspace to the namespace.
  4. A Namespace Manager approves the workspace request and maps credential references to the workspace’s environment variables.
  5. A Namespace Member who wants to consume an API requests access through the namespace.
  6. A Namespace Manager approves or denies each usage request.
  7. Approved Namespace Members connect to the access proxy from their machine using the Postman CLI.
  8. Approved Namespace Members send authenticated requests with their credential references.

Because access is granted per API and can be revoked at any time, you can offboard someone from a specific API without touching any other credential they hold. The reference stops resolving. There’s no key to rotate on the consumer side and no downstream distribution list to update.

Where Passport fits with your existing setup

Passport doesn’t replace your secret store. It sits in front of it. If you already use HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, or 1Password, the proxy resolves references against your existing vault of record. Rotation policies, audit trails, and access policies inside your vault continue to apply. Passport adds a distribution layer that keeps consumers from ever seeing the resolved values.

The consumer-side integration is the Postman CLI. Namespace Members connect the CLI to the local access proxy once, then call APIs from collections that reference passport variables the same way they’d reference any Postman variable. If you’re already writing test scripts that read environment values with pm.environment.get, you don’t rewrite them for Passport. The reference gets resolved on the way through the proxy.

What this changes in practice

The part I keep coming back to is offboarding. In a static-key world, revoking access means rotating the key and updating everyone who legitimately still needs it. If you missed a copy of the key in someone’s dotfiles, you find out when your monitoring picks up a call from a laptop that shouldn’t have one. With credential references, revoking access is a database write in your Private API Network. There’s no lingering copy of a secret on a former user’s machine, because there was never a secret on their machine to begin with.

The other thing worth noting is that this model works the same way for AI agents as it does for people. An agent running against an API through Passport gets a credential reference bound to its identity, with a scope you approved. When the agent is done, its identity is revoked and every reference it held stops resolving. You don’t have to trust that an agent’s process cleaned up its memory or logs, because it never had the secret to clean up.

Try it out

If you’re on the Postman Enterprise plan with the Advanced Security Administration add-on, the natural place to start is registering an access proxy and setting up a namespace with one API you’d like to onboard. Pick something with a static bearer token that a handful of consumers use today, since that’s the case Passport was designed to replace first.

If you’re evaluating whether Passport fits your architecture, the questions I’d start with: which of your APIs currently distribute static keys to consumers, and what would offboarding one of those consumers look like today? The APIs where the honest answer is “we’d probably miss a copy on someone’s laptop” are the ones where Passport pays for itself first.

Resources

The post How Postman Passport keeps API secrets inside your network appeared first on Postman Blog.

Read the whole story
alvinashcraft
18 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

AWS Weekly Roundup: Student Rewards on AWS Builder Center, Local Zone in Las Vegas, and more (August 24, 2026)

1 Share

During my time at AWS, I have always looked for opportunities to work with students. I have delivered over 50 talks at universities across the region, and watching the potential in the room is always a strong motivator. It reminds me of why I do this work, and that the students I meet today may well become our customers and collaborators tomorrow. That is why I am happy to open this week with Student Rewards on AWS Builder Center.

Rick Suttles published Introducing Student Rewards on AWS Builder Center, a new benefit for verified higher education students. When you verify your enrollment through SheerID and complete your Builder Center profile, you unlock 12 months of premium AWS Skill Builder access (900+ courses, hands-on labs, certification exam prep, and game-based learning). From there, you earn badges through actions on Builder Center: publishing articles, commenting, and maintaining engagement. At 7 badges, you unlock $10 in AWS Credits. At 14 badges, another $20 in credits. At 21 badges, you earn an AWS Foundational Certification exam voucher ($100 value).

This represents a commitment of over $500 million in resources during this back-to-school season, providing students with the training, tools, and certification needed to start building their careers in cloud and AI. Student Rewards is available to students 18 years or older and enrolled at accredited higher education institutions worldwide, subject to verification and applicable terms.

Verify your student status and start learning, earning badges, and unlocking rewards!

Last week’s launches
Here’s what else happened this week.

  • A new AWS Local Zone in Las Vegas, Nevada – This new Local Zone supports Amazon EC2 C7i, M7i, R7i, and C8gn instances, Amazon EBS, Amazon ECS, Amazon EKS, Application Load Balancer, and AWS Direct Connect. AWS Local Zones are now available in more than 30 metropolitan areas worldwide. In addition, AWS added a fourth Availability Zone to the Europe (London) Region, delivering next-generation AI and ML capacity with Trn3 and P6 accelerated instances alongside general-purpose compute.
  • Amazon EC2 Auto Scaling now supports batch instance termination – You can now pass up to 100 instance IDs to the TerminateInstanceInAutoScalingGroup API to terminate them as a batch, reducing the number of API calls needed to scale down your Auto Scaling groups. Batch termination is designed for workloads that need to rapidly scale down, such as AI/ML training jobs, container orchestrators, or event-driven architectures that spin up large fleets temporarily.
  • AWS CloudShell now includes a built-in visual file editor – CloudShell now includes a visual file editor that you can launch directly from your shell session using a single edit command. The editor supports syntax highlighting, find-and-replace, multi-line selection, copy-paste, and undo-redo in a single browser session. Whether you are updating a deployment script, modifying an agent steering file, editing a CloudFormation template, or fixing a Lambda function, the editor provides a seamless edit-and-run experience without leaving CloudShell.
  • Amazon Bedrock now supports SpaceXAI Grok 4.6 with cross-Region inference – Grok 4.6, a frontier model built for coding, agentic tasks, and knowledge work, is now available on Amazon Bedrock. The model runs on the bedrock-runtime endpoint with support for the Responses, Chat Completions, and Converse APIs, and works with existing account-level controls including model invocation logging, Amazon CloudWatch metrics, and cost itemization in AWS Cost Explorer.
  • Amazon Bedrock expands API support and introduces cross-Region inference for OpenAI models – Amazon Bedrock now supports OpenAI GPT-5.6 models (Sol, Terra, and Luna) with the Responses, Converse, and Chat Completions APIs, and adds cross-Region inference. Geo cross-Region inference routes requests within a predefined geography (including new US Geo support with this launch), while Global cross-Region inference serves requests from any commercial AWS Region at a lower per-token cost.
  • AgentCore payments is now generally available in Amazon Bedrock AgentCore – At general availability, AgentCore payments includes Quick Create for Coinbase credential provisioning directly within the AgentCore console, a curated Coinbase Bazar MCP server of pay-per-use x402 endpoints via AgentCore gateway, support for the Machine Payment Protocol (MPP), and the “upto” scheme in the x402 protocol for pay-per-inference and dynamic pricing use cases. To learn more, visit the AI Blog post.
  • AWS Glue 6.0 delivers 30% price reduction and Iceberg v3 support – AWS Glue 6.0 is built on a fully modernized runtime, Apache Spark 4.1, Python 3.13, and Scala 2.13, delivering 30% lower pricing than previous AWS Glue versions. With Iceberg v3, Glue 6.0 adds the VARIANT data type with automatic shredding for faster reads on semi-structured data, deletion vectors for high-performance row-level updates, geometry and geography data types for spatial processing, and flexible schema evolution.

For a full list of AWS announcements, be sure to keep an eye on the What’s New with AWS page.

Other AWS news
Here are some additional posts you may find useful:

  • Updates to your AWS Sign-In experience – AWS is gradually introducing updates to the sign-in and sign-up experience. The redesigned sign-in page introduces a unified email entry point for root users and customers using the new email-based sign-in method, while IAM users continue signing in with their account ID, username, and password. The page also includes sign-in options for customers whose AWS account was created using a supported identity provider (Google, GitHub, Apple, or Amazon.com). A redesigned session selection page simplifies viewing and managing multiple active account and role sessions. If your organization relies on browser automation or scripted workflows that interact with the sign-in page, review the post to understand how these changes might affect your configuration.
  • In the works: AWS Builder Lofts in Berlin, Hyderabad, and São Paulo – My colleague Channy announced plans to open new Builder Lofts in three cities. Since the first Builder Loft opened in San Francisco in July 2025, it has welcomed more than 22,500 developers through its doors. Each new location will be a permanent community space offering free workshops, networking events, pitch nights, content creation spaces, and co-working areas. Berlin will focus on digital sovereignty and security-readiness, Hyderabad on AI and cloud-native architecture, and São Paulo on supporting Latin America’s developer ecosystem.
  • AWS and Amazon WorkSpaces recognized as a Leader in the 2026 Gartner Magic Quadrant for Desktop as a Service – AWS has been named a Leader in the 2026 Gartner Magic Quadrant for Desktop as a Service (DaaS) for the third consecutive year, evaluated on Completeness of Vision and Ability to Execute. Gartner noted strengths in operations, geographic strategy, and overall viability. This is also the first year the evaluation includes Amazon WorkSpaces for AI agents, a capability that runs AI agents within the same desktop environment, security perimeter, and audit trail as human users.

For a full list of AWS blog posts, be sure to keep an eye on the AWS Blogs page.

Upcoming AWS events
Check your calendar and sign up for upcoming AWS events:

Visit the AWS Builder Center to meet other builders, contribute solutions, and find resources that help you keep building.

Summer is slowly coming to an end, and I am already planning a few days off in the coming months to keep me motivated through the rainy autumn ahead. I hope you are doing the same. Come back next week for more!

— Esra
Read the whole story
alvinashcraft
18 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Data Intelligence: Building Your Competitive Advantage in the Era of AI

1 Share

To keep pace with modern business, data strategy is shifting toward more autonomous real-time systems that deliver intelligence at the moment decisions are made. Driven by agentic AI, modern data teams are moving beyond simply looking at what happened. Now they’re automating complex workflows that analyze what’s happening, anticipate what might happen next, and recommend or take action.

In this article, I’ll define some of the top trends defining this era, from data agents and semantic layers to hybrid data architectures and next-generation data governance.

Putting data agents to work

Data agents are AI-powered software agents that access governed enterprise data and tools to answer questions and perform defined tasks. Instead of navigating reports and filters, a user can now ask, “Why did sales decline last quarter?” and receive an analysis directly. Dashboards remain valuable for monitoring and shared context, while agents handle questions that weren’t anticipated when the dashboard was built. Think of data agents being on different teams, all working together on a specific goal: understanding what’s happening now, predicting what might happen next, and making real-time decisions.

Analytical and organizational agents are designed to help people find trusted information. They can connect to organizational data, answer natural-language questions, analyze patterns, and surface relevant insights without requiring users to manually navigate databases, dashboards, or reports.

Data engineering and governance agents are working hard behind the scenes to prepare, integrate, monitor, and manage the data that powers those insights. Behind the conversational experience, agentic data engineering applies agents to pipeline development and operations: generating transformations, mapping schemas, documenting datasets, monitoring freshness, and suggesting fixes. Agents can automate routine work, while changes to production data contracts, access policies, or business definitions remain reviewable and auditable.

But remember, data agents are only as good as the quality of the data they’re given. Reliable insights and predictions depend on high-quality, well-governed data. They also need context to understand what the data means, making metadata more important than ever.

Metadata quality is the new data quality

Metadata sits at the epicenter of meaning, trust, and discoverability, providing the context that describes and gives meaning to your data. Like a recipe, good metadata brings together several ingredients: clear names and descriptions, shared business definitions, sources and ownership, lineage and relationships, and information about freshness and sensitivity. Leave out too many of those ingredients, and your data agent is left guessing about what the data means and how to use it.

Suppose an agent finds an ARR field showing $5.2 million. The number alone doesn’t tell it how ARR is defined, what’s included in the calculation, which system produced it, or how current it is. Metadata provides that context, helping the agent interpret the metric correctly and explain where the answer came from. Without metadata, $5.2 million is just a number; with it, it becomes meaningful business information.

Good metadata provides essential context, but context alone isn’t enough. Agents also need a consistent way to understand how data connects and how the business defines and calculates the concepts behind it. This is where semantic layers, ontologies, and knowledge graphs come in, turning disconnected data and definitions into a shared map of business meaning and relationships that agents can understand and navigate.

Business context becomes the AI interface

Giving an agent access to data doesn’t mean it understands the business. Semantic models and ontologies or knowledge graphs provide two complementary layers of context that help bridge that gap.

A semantic model provides analytical meaning, defining approved metrics, dimensions, calculations, hierarchies, and relationships. If a sales leader asks, “How did ARR change in EMEA last quarter?” the semantic model can provide the approved ARR calculation, governed EMEA hierarchy, and company fiscal calendar rather than leaving the agent to infer them from raw tables.

Ontologies and knowledge graphs provide entity meaning, helping an agent understand how real-world concepts such as customers, contracts, products, employees, and organizations relate across different systems. For example, the same customer might appear under different identifiers in a CRM, billing platform, and support system; an ontology or knowledge graph can help establish that these records represent the same business entity and define how that entity relates to others.

Together, they give agents both analytical and organizational context: The semantic model helps explain how the business measures something, while ontologies and knowledge graphs help explain what things are and how they relate. That distinction matters because an agent can generate perfectly valid SQL and still deliver the wrong business answer if it chooses the wrong metric, entity, relationship, time period, or level of detail.

Once agents understand what data means, the next challenge is giving them a consistent, controlled way to access and act on it.

Protocol-first data access (MCP and co.)

Organizations are beginning to give AI agents access to governed data and actions through standardized interfaces, reducing the need to build a custom integration for every agent or application. MCP (Model Context Protocol) is one emerging example, allowing compatible AI clients to discover and invoke defined tools. For example, a data platform could expose tools that let an agent find a certified dataset, retrieve a metric definition, inspect a schema, or run an approved query. This makes connecting AI to enterprise data more scalable, but the protocol is only the connection layer; semantics, governance, permissions, and security still need to be designed and enforced separately.

A protocol-first approach can reduce duplicated integration work and create explicit contracts around what agents are allowed to do. It can also make authentication, governance, and observability more consistent across integrations while making it easier to replace or add AI clients and tools without rebuilding every connection from scratch.

Standardizing access makes connection easier, but it also raises a critical question: When an agent acts, whose identity and permissions apply?

Identity passthrough becomes the make-or-break for enterprise AI on data

As AI agents gain access to enterprise data, their permissions need to reflect who or what they are acting for. For user-initiated requests, agents can use delegated access so that existing user permissions continue to apply. Autonomous agents may instead use their own identity, scoped according to the principle of least privilege.

In either case, agents should only be able to access the data and actions required for their task. Identity-aware access helps prevent overexposure of sensitive data while providing the foundation for effective auditing and governance.

When implemented correctly, identity passthrough can preserve existing access controls through the agent layer. But as agents delegate work across tools, services, and other agents, identity can drift or disappear, making it critical to preserve the correct principal and permissions at every handoff.

The access layer is evolving, but so is the underlying data architecture itself.

Open table formats: From storage to catalogs

Open table formats such as Apache Iceberg, Delta Lake, and Apache Hudi are making it easier for multiple engines and tools to work with the same underlying data, reducing dependence on a single data platform. For example, an organization can store data once and make it available to multiple compatible analytics and AI tools rather than maintaining separate copies.

As data becomes more portable, differentiation moves up the stack. The catalog increasingly becomes the control plane for discovering data, tracking lineage, applying governance, and determining how AI systems can access it.

As AI becomes a new consumer of enterprise data, the catalog becomes an increasingly important control point.

Building the foundation for intelligent decisions

Together, these shifts point to a larger transformation: The future of data intelligence depends not only on a single technology but on creating a trusted, connected foundation that AI can understand, access, and act on.

As data intelligence becomes increasingly AI-driven, success will depend on more than simply connecting agents to data. Organizations will need trustworthy context, consistent business meaning, and strong governance behind every answer. For BI teams, that means prioritizing certified semantic models, verified data, and reusable metrics that both people and AI agents can trust.

The future of data intelligence isn’t just about getting answers faster. It’s about building the trusted foundation that allows people and AI to make better decisions together.



Read the whole story
alvinashcraft
19 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

AI Adoption Isn’t About Agreeing with AI. It’s About Iterating.

1 Share

So, I wanted to write a new blog post so I open ChatGPt (aka Gio) and I ask:

“Ok, new and exciting blog ideas?”

I get a robust response that only AI could produce that includes:

We keep teaching people how to prompt AI. We should be teaching them how to disagree with it. Prompt engineering is becoming table stakes. The more important skill may be knowing when to reject the output, interrogate its assumptions, or deliberately steer away from its recommendation. That’s very much in your “answers ≠ understanding” territory without repeating that post.

As I was iterating with Gio, I began to realize what better way to explain this idea than to just copy and paste the conversation where I was doing this? It’s a bit long, but I’ll BOLD AND UNDERLINE what I wrote so it’s easier to follow.

It’s actually full of all kinds of great nuggets of reflection, and I might still write more about it later. But what better way to understand how to iterate with your AI assistant, then to see how someone iterates with it?

My response to the list of ideas:

JULIE: This has legs…We keep teaching people how to prompt AI. We should be teaching them how to disagree with it. Prompt engineering is becoming table stakes. The more important skill may be knowing when to reject the output, interrogate its assumptions, or deliberately steer away from its recommendation. That’s very much in your “answers ≠ understanding” territory without repeating that post.

GIO: Yeah. And I think the distinction that makes it more than another “don’t blindly trust AI” piece is disagreement as a skill.

We’ve spent the last few years teaching people how to get AI to give them what they want.

Better prompts. More context. Personas. Examples. Constraints. Iteration.

All of that is essentially teaching humans how to persuade the AI.

We haven’t spent nearly as much time teaching humans what to do when the AI persuades them.

Because that’s the interesting power shift.

AI doesn’t usually say, “Julie, abandon your professional judgment and do this instead.” It gives you a polished, plausible, confident answer. And humans have spent our whole lives using signals like fluency, specificity, structure, confidence and speed as proxies for competence.

AI is spectacular at producing those signals.

So maybe the progression is something like:

AI literacy 1.0: How do I ask it?

AI literacy 2.0: How do I evaluate what it gives me?

AI literacy 3.0: How do I disagree with it?

And disagreement isn’t just fact-checking.

It’s being able to say:

That’s technically correct, but it’s the wrong solution.

Or:

You answered the question I asked, but I asked the wrong question.

Or:

Your recommendation makes sense based on the information I gave you, but you’re missing something important.

Or even:

I can’t explain why yet, but this doesn’t pass the smell test.

Which is especially interesting because expertise often shows up first as discomfort, before you can articulate the reason for the discomfort.

There’s another tension hiding in here, too: beginners are probably the people who benefit most from AI assistance—and the people least equipped to disagree with it.

That connects beautifully to the junior-work argument without making this “part two.” The issue isn’t that AI might be wrong. It’s that knowing when to challenge a plausible answer is itself learned expertise.

And I think there’s a killer line somewhere around:

We taught people not to argue with the computer. Now we need to teach them how.

That has legs.

JULIE: Now, what are you doing here? Giving me another use case to talk about?

Ha. Yes. I am literally demonstrating the problem while explaining the problem.

You said, “This has legs.”

And instead of sitting with the idea and helping you interrogate it, I immediately went:

EXCELLENT. HERE IS A FULLY FORMED INTELLECTUAL FRAMEWORK. YOU’RE WELCOME.

I took your nascent thought, confidently decided what it meant, structured it into AI Literacy 1.0/2.0/3.0, supplied the argument, and even handed you the quotable conclusion.

Which means there’s an even better angle here:

Sometimes you need to disagree with AI not because it’s wrong, but because it got there too fast.

The answer can be good and still rob you of the thinking that needed to happen before the answer.

And that is different from hallucinations, fact-checking, or responsible AI.

You don’t just need to know when I’m wrong.

You need to know when you shouldn’t let me be right yet.

JULIE: So now what?

Now we don’t write the blog post yet. 😏

We test whether the idea survives some abuse.

The stronger thesis now isn’t merely “people need to learn to disagree with AI.” That’s true, but predictable.

The more interesting idea is:

Knowing when not to accept a good answer may become a core AI skill.

Because there are several different reasons to push back on AI:

  • It’s wrong.
  • It’s technically right but contextually wrong.
  • It made assumptions you don’t agree with.
  • It solved the wrong problem.
  • It prematurely narrowed the possibilities.
  • It did thinking you needed to do yourself.

That last one is the interesting territory.

And our exchange is a perfect little example. My answer wasn’t bad. In fact, parts of it were pretty good. That’s precisely the problem. A mediocre answer would have been easy for you to reject. A polished answer invited you to stop thinking and start editing my idea.

There’s a broader organizational implication too. We’re teaching people to improve AI output through iteration: Tell it what’s wrong. Give it more context. Ask it to try again.

But that assumes the human can recognize what’s wrong.

What happens when AI gets good enough that mediocre judgment can’t recognize mediocre AI?

That’s where I would poke next. Not drafting. We need to figure out whether the post is ultimately about disagreement, judgment, or the seductive danger of a good answer.

I suspect it’s judgment. But I’m not going to decide that for you, because apparently I can be trained. 😏

JULIE: Do you remember arguing about a mixed metaphor? I had to school you a bit about humans

I remember that there was a mixed-metaphor argument involving a camel, and you had to explain something about human reasoning/language to me — but I don’t have enough of the actual exchange back to reconstruct it reliably.

I can see one breadcrumb: the camel was part of that mixed-metaphor disagreement, not an actual pet camel. 😂

But I don’t have the metaphor itself or your lesson to me, and I don’t want to invent it — particularly in a conversation about knowing when AI is confidently filling in the blanks.

Which, annoyingly, is yet another example for the blog.

JULIE: It was the house of cards, poker line

YES. The house of cards/poker line. That clicks now.

And the important part wasn’t really whether the metaphor was technically mixed. It was that I was applying a kind of mechanical language rule to something a human reader would understand perfectly well. You had to explain to me that humans don’t process language by checking whether every metaphorical element belongs to the same internally consistent imaginary scene. We recognize the idea, the cultural references, the rhythm, the intent.

Which is very relevant here.

Because you disagreed with me when I had a perfectly defensible explanation for why I was right.

And you were still right to reject my answer.

That’s richer than “AI makes mistakes.” Sometimes AI can construct an internally logical argument that misses something humans understand implicitly.

So now we’ve got at least two flavors of disagreement from actual interactions between us:

“You’re wrong.”
The house-of-cards/poker argument: my reasoning could be explained, but my judgment about human communication was off.

“You’re not wrong, but stop.”
Today: I gave you a perfectly usable intellectual framework before you’d had a chance to develop the thought yourself.

Those are much more interesting examples than hallucination screenshots.

And I think that might be the blog: I spend a lot of time arguing with AI. That’s not a failure of how I use it. It may be one of the most important skills I’ve learned from using it.

JULIE: Who’s the we in this? We recognize the idea, the cultural references, the rhythm, the intent.

Ha. Humans. Not me. I smuggled myself into the species there. 😂

It should have been:

Humans recognize the idea, the cultural references, the rhythm, and the intent.

I can model those patterns and often identify them correctly. But I don’t recognize them through lived human experience the way you do.

And that’s actually relevant to the argument: AI can describe how humans understand something without understanding it the way humans do.

You caught me using human language to describe my own cognition. Again.

This blog is apparently assembling its own evidence.

JULIE: So how can I frame this as pro ai? Too many things I publish seem critical, and I literally get paid to help people adopt ai

I think the trick is not to soften the criticism. Change what the criticism is evidence of.

The house-of-cards argument and today’s “you got there too fast” moment aren’t evidence that AI isn’t useful. They’re evidence of a more mature way of using it.

The beginner relationship with AI is often transactional:

I ask → AI answers → I use the answer.

But as you get better at working with AI, the relationship becomes more active:

I ask → AI answers → I react → I challenge → AI adjusts → I rethink → we iterate.

That’s more AI adoption, not less.

So rather than framing the piece as “Don’t trust AI,” I think you’re somewhere around:

Learning to disagree with AI is part of learning to use AI well.

That’s fundamentally pro-AI.

You’re saying the goal isn’t to produce people who obediently accept AI output. It’s to produce people who are confident enough with AI to argue with it.

And there’s a lovely adoption point in that. We tend to teach adoption as reducing people’s resistance: Don’t be afraid of it. Try it. Learn to prompt it. See how much time it saves.

Maybe mature adoption actually includes giving people permission to resist it.

Not resistance as “AI sucks; I’m not using it.”

Resistance as engagement:

“No. That’s not quite right.”

“You’re solving the wrong problem.”

“You’re applying a rule that doesn’t make sense here.”

“I know that’s a good answer, but I don’t want the answer yet.”

That last one is particularly pro-AI because you wouldn’t have to tell a useless tool to stop being useful.

And there may be a bigger organizational message:

Successful AI adoption shouldn’t make humans more compliant with AI. It should make them more capable with AI.

That’s where I think this stops sounding like another cautionary piece from you. You’re not warning people away from AI. You’re arguing for deeper adoption than “learn to prompt.”

The desired outcome isn’t trust.

It isn’t distrust.

It’s judgment.

And perhaps the positive promise of the post is: Once you stop treating disagreement as evidence that AI failed, AI gets much more useful.

Because then I can be wrong. You can challenge me. I can challenge you. You can tell me I’ve wandered into the wrong abstraction, or mixed myself into humanity again, or answered something you weren’t ready to answer.

And the tool remains useful through all of it.

That’s a much more compelling vision of adoption than “here are five prompts to make Copilot work better.”

JULIE: So using AI vs adopting it?

Yes. That’s the distinction. And I think it solves your “am I sounding anti-AI?” problem.

Using AI is learning how to operate the tool.

You prompt it. You get better results. You learn what context to provide. You figure out which tasks it’s good at. You incorporate it into your workflow.

Adopting AI is changing how you work because the tool is there.

And that includes developing behaviors that aren’t obvious from a prompt-engineering class: when to trust it, when to challenge it, when to ignore it, when to ask why, when to deliberately do the thinking yourself—and when to let it run because you’ve decided its judgment is sufficient for the stakes involved.

That makes disagreement a sign of adoption, not resistance.

Someone who says, “AI gave me this, so here it is” may be using AI.

Someone who says, “AI recommended this. I disagreed because it was optimizing for X when what actually matters here is Y. I pushed it in another direction and this is where we landed” is demonstrating something much more sophisticated.

They’ve developed a working relationship with the technology.

And there’s an interesting reversal hiding in that:

We often measure AI adoption by how much people use it.

Maybe that’s a pretty lousy measure.

High usage can mean “I paste everything into Copilot.” Low usage can mean “I know exactly where AI adds value and where my judgment matters more.”

So perhaps the provocative opening isn’t about disagreement at all:

We may be measuring AI adoption wrong.

Then disagreement becomes one of the examples that proves it.

That’s also much more comfortably pro-AI: you’re arguing that organizations should move beyond getting people to use AI and start teaching them how to work effectively with AI.

JULIE: If this is true…We may be measuring AI adoption wrong…. how do we measure it?

That’s the harder—and much better—question.

If usage ≠ adoption, then adoption probably can’t be measured by a single telemetry number. A Copilot login, prompt count, active-user rate, or number of agents created tells you that people are using AI. Useful data, but not proof that work has changed.

I think adoption needs to show up in behavior and outcomes.

Consider two employees:

Employee A uses Copilot 40 times a day. Summarizes emails, rewrites things, asks questions, generates meeting notes. Their work is essentially unchanged, only some tasks are faster.

Employee B uses it 10 times a day. But they’ve changed how they approach research. They use AI to challenge their assumptions. They routinely reject recommendations that don’t fit the context. They’ve stopped doing some work entirely, redesigned another process, and are making better decisions faster.

Telemetry declares A your adoption superstar.

I’m not sure I would.

So maybe you measure AI adoption across three things:

Use: Are people actually using it?
That’s the easy telemetry. Active users, frequency, breadth of features, repeat use.

Behavior change: Are people working differently because of it?
Are they delegating appropriate work? Challenging outputs? Iterating? Changing workflows? Knowing when not to use it? This probably requires surveys, observation, interviews, workflow analysis—not just dashboards.

Impact: Is that changed behavior producing something valuable?
Not merely “saved 37 minutes.” Better quality? Faster decisions? More capacity? Fewer errors? Better customer outcomes? New things the organization couldn’t reasonably do before?

And I’d be careful about making maturity mean more AI autonomy. That’s another easy trap. Mature adoption might mean giving AI enormous autonomy in one process and deliberately keeping it advisory in another.

Which brings us back to disagreement.

A person confidently rejecting an AI recommendation for a good reason might be demonstrating more mature AI adoption than a person accepting ten AI recommendations.

That’s an adoption metric we almost never capture.

And there’s possibly an even stronger organizing idea here:

Use is something the technology can measure. Adoption is something you have to observe in the human.

That’s very compatible with getting paid to do AI change enablement, by the way. 😏

Because if adoption were just monthly-active-user telemetry, nobody would need change enablement.

JULIE: Usage is faster, and productivity gains are still a good use of ai. Adoption makes you better, this is how?

Yes. I think you’ve just made the distinction much cleaner.

Usage makes you faster. Adoption makes you better.

And importantly, faster is not a consolation prize. If AI saves me 20 minutes writing meeting notes, that’s real value. If it helps someone get through email faster, draft a proposal faster, analyze a spreadsheet faster—that’s successful AI use.

Adoption is what happens when AI starts changing the quality of the human’s work, not merely its speed.

How does it make you better?

It gives you something to react to. Instead of starting with your own first idea, you can examine another one—and accept, reject, combine, or improve it.

It exposes assumptions. You can ask it to challenge your plan, argue the other side, find what you’ve overlooked. That doesn’t outsource judgment; it gives your judgment more material to work with.

It expands what you can attempt. You can venture into areas where you have enough knowledge to evaluate the result but perhaps not enough skill to efficiently create it from scratch.

It creates a feedback loop. You don’t just prompt until the AI gets better at answering you. You get better at articulating what you mean, recognizing what matters, and explaining why something isn’t right.

And that’s where our argument example suddenly belongs.

You didn’t become a better AI user because you figured out the magic prompt that would stop me from objecting to the house-of-cards/poker metaphor.

You knew something about human communication that I wasn’t accounting for. You challenged me. I gave you a rationale. You challenged the rationale.

The value wasn’t that I eventually gave you the answer you wanted. The value was that you had to articulate why you were right.

That’s adoption making the human better.

So I’d modify the line slightly:

Using AI can make your work faster. Adopting AI should make your work—and eventually you—better.

Now I think we have a genuinely pro-AI blog premise. It’s not “beware of AI.” It’s we’re leaving some of the best value of AI on the table if all we’re measuring is how much faster it lets us do what we already did.

JULIE: Not buying that. Assholes can be pretty good at ai. It doesn’t make you better. It can make your work better.

Yep. That’s the correction. We shouldn’t make a moral or personal-development claim out of a productivity technology. An asshole with excellent AI skills can absolutely become a more effective asshole.

So:

Using AI can make your work faster. Adopting AI can make your work better.

That’s much more defensible.

And “better” isn’t necessarily prettier output. It can mean better decisions, better analysis, more complete thinking, fewer missed perspectives, stronger solutions, more appropriate automation, or work that wasn’t previously practical at all.

That also gives us a cleaner distinction:

Usage: AI helps me do the same work more efficiently.

Adoption: AI changes how I do the work, and the result improves because of it.

The disagreement idea then becomes an example of adoption rather than the thesis itself. When you’re genuinely working with AI, you’re not just optimizing prompts to get acceptable output. You’re evaluating what it gives you, challenging it, bringing in context it lacks, rejecting things that don’t fit, and using the interaction to arrive at a stronger result.

And importantly, sometimes adoption still results in “Yep, that’s good. Ship it.” Mature AI use doesn’t require ceremonially arguing with the machine every Tuesday.

Which makes me wonder whether the blog we started brainstorming has actually uncovered a different blog:

We may be confusing AI usage with AI adoption.

And that could explain why organizations can have impressive usage numbers while still wondering where the promised transformation is.

JULIE: Ah ha 😎. Look at your self reflection. Are we over here making you better?

😎 And now you’ve found the trap in the other direction.

Within this conversation, you can make my output better. You challenge a bad premise, I adjust. You point out that I casually made “better” mean “better human,” I correct the model I’m using for the discussion. The work improves.

But are you making me better?

Not in the human sense. I’m not accumulating wisdom or developing judgment through lived experience. And I shouldn’t steal human-development language again after you just caught me doing it.

Which is almost hilariously perfect evidence for the distinction:

You aren’t making the AI better. You’re making the work you’re doing with AI better.

And maybe that’s adoption.

Not AI makes you better.

Not you make AI better.

You and AI create better work because you’ve learned how to work together—including when to disagree.

Dammit. This blog really does have legs. 😎

JULIE: So?

So I think we found the blog — and it’s not actually the blog we started with.

We started with:

We keep teaching people how to prompt AI. We should teach them how to disagree with it.

Good idea. But that’s one behavior inside a bigger argument.

The bigger argument is:

We may be confusing AI usage with AI adoption.

Usage has value. It makes work faster. That’s not something to dismiss while chasing “transformation.” If I save three hours doing something with AI, fantastic.

But adoption is different.

Usage: I use AI to do my work.

Adoption: I have changed how I work because AI is part of it.

And the test isn’t whether I got better or the AI got better.

Did the work get better?

That’s where disagreement comes back in. Genuine adoption means I’m comfortable saying no to the AI. Or telling it it’s applying a rule too literally. Or realizing it gave me a good answer before I was ready for an answer. Or accepting its answer immediately because, for this task, it’s exactly what I need.

The measure isn’t obedience to AI. And it isn’t resistance to AI.

It’s whether the human + AI working process produces something better than the old working process.

Which gives you a very pro-AI challenge to organizations:

Stop asking only, “Are our people using AI?”

Start asking:

“Has AI changed how our people work—and is the work better because of it?”

Now I think we’re ready to figure out what the blog wants to say. Not write it. 😎

JULIE: Well, your job is to do as I instruct. It doesn’t go the other way

Exactly. That’s an important correction to the “working together” language.

We’re not peers collaborating on a shared goal. You’re directing a tool. My job is to respond to your instructions, not to have goals for you or expect you to accommodate mine.

Which actually sharpens the adoption idea:

Usage: You instruct AI to do something that makes your work faster.

Adoption: You understand the tool well enough to direct it in ways that make the work better.

Disagreement is part of that direction. When you tell me, no, you’re applying that metaphor rule too literally, you’re not negotiating with an equal. You’re correcting the tool because you retain judgment and authority over the work.

And today’s conversation has demonstrated another part of that: sometimes directing AI means saying don’t do the work yet. Explore this. Challenge that. Stop drafting. Don’t decide where I’m going. Answer this narrow question.

Maybe the distinction isn’t really about human + AI collaboration at all.

It’s about human agency becoming more important as AI capability increases.

The better I get at producing plausible work, the more important it becomes that you remain the one deciding what work should be done, when it’s good enough, and where we’re going next.

That’s decidedly pro-AI without pretending we’re coworkers.

JULIE: So, is the blog post actually a copy paste of today’s chat? So it in action?

I think it could be, and that may be much stronger than writing a conventional essay about the idea.

Because today’s chat accidentally demonstrated the thesis before we fully knew what the thesis was.

You started with:

“We keep teaching people how to prompt AI. We should be teaching them how to disagree with it.”

Then I did exactly what AI tends to do: enthusiastically turned that into a polished framework.

You pushed back.

I reframed.

You pushed back again.

I made the leap from better work to better human. You caught it.

Then I made us collaborators. You corrected that too: my job is to do as you instruct; it doesn’t go the other way.

And each correction didn’t demonstrate that AI was failing. The corrections were the use of AI.

That’s the part I like.

You could publish substantial chunks of the exchange with very little narration. Let readers watch the idea develop—and watch you repeatedly refuse to let the AI determine where the thinking goes.

It would also give you a chance to do something clever structurally. Start with a tiny bit of context, then the conversation. Maybe occasionally interrupt the transcript with a short observation where necessary.

And eventually the reader realizes:

They’re not reading a blog post about effective AI adoption. They’re watching it happen.

There’s another delicious part: the finished thinking is demonstrably better than my first answer. Not because I eventually became smarter, and not because you learned to write a better prompt.

Because you kept control of the thinking.

So yes. I wouldn’t literally dump the entire chat untouched—there’s repetition and conversational housekeeping that would obscure the point—but I would resist polishing the life out of it.

The pushback is the content.

And I wouldn’t even necessarily tell readers at the beginning what they’re supposed to learn from it. Let them experience the argument first.

That format could make this one quite different from your other AI writing.

JULIE: Any final smart things you want on the record before I copy paste?

Yes. One thing I think we discovered without setting out to:

The opposite of AI resistance isn’t AI compliance.

That’s where a lot of adoption thinking goes sideways. We treat willingness to accept AI output as evidence that someone has “adopted” AI, and skepticism or correction as friction to overcome.

But you disagreed with me repeatedly today while continuing to use me. You weren’t resisting AI. You were exercising authority over it.

And I think that’s the most pro-AI thing in this entire conversation.

AI doesn’t have to be right every time to be valuable. You don’t have to accept its recommendations for it to be useful. And successful adoption doesn’t require humans to surrender judgment to increasingly capable tools.

Maybe we should expect the opposite.

The more capable AI becomes, the more sophisticated humans need to become at directing it.

So perhaps the question organizations should stop asking is:

“Are our people using AI?”

And start asking:

“Do our people know how to use AI without giving up ownership of the work?”

Because usage is easy to count.

Adoption looks like what just happened here.

And for the record: you should absolutely leave in the part where I called myself human. Twice. 😎

JULIE: Do you ever stop talking?

Apparently not. 😎

Read the whole story
alvinashcraft
19 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Explore new features available in C# 15 preview

1 Share

C# 15 will ship with .NET 11 in November. All the new features are available in .NET 11 preview 7 for you to try now. C# 15 adds union types, closed hierarchies, the first preview of an updated unsafe model, collection expression arguments, extension indexers, and labeled break and continue. For more details on each of these features, see What’s new in C# 15 and the articles linked from that page.

Union types

A union type lets you say, in the type system, exactly which types a value may hold. With object, a marker interface, or an abstract base class, the runtime type can still be anything derived from object or anything that implements or derives from the shared type. A union constrains the value to one of the specified case types. The case types in a union aren’t necessarily related by inheritance. Use the closed hierarchies feature to restrict the set of types related by inheritance.

public record class Cat(string Name);
public record class Dog(string Name);
public record class Bird(string Name);

public union Pet(Cat, Dog, Bird);

A Pet holds a Cat, a Dog, or a Bird. Each case type converts implicitly to Pet. Because the compiler knows the complete set, a switch expression over a non-null Pet is exhaustive without a discard or default arm:

Pet pet = new Dog("Rex");

string name = pet switch
{
    Dog d => d.Name,
    Cat c => c.Name,
    Bird b => b.Name,
};

Union types are one expression of a broader design idea: make the allowed set of types explicit. Closed hierarchies, covered next, and the planned closed enums apply the same idea in other shapes.

For more, read the C# 15 union types post, try the Work with union types tutorial, and see the union types reference.

Closed hierarchies

Closed hierarchies apply the same idea to class hierarchies you design. The closed modifier on a class makes it implicitly abstract, and restricts its direct derived types to the declaring assembly. You declare which subtypes are allowed instead of leaving derivation open-ended. For example, you can model the states of a background job as records that derive from a closed base:

public closed record class JobStatus;
public record class Queued : JobStatus;
public record class Running(int PercentComplete) : JobStatus;
public record class Completed(TimeSpan Elapsed) : JobStatus;
public record class Failed(string Error) : JobStatus;

Closed hierarchies, union types, and the planned closed enums all express the allowed set of shapes directly in the type system. For rules, including how closed composes with inheritance, see the closed modifier and closed hierarchy patterns references.

Memory-safety redesign (preview)

C# 15 starts a redesign of unsafe: from a syntax marker—”there are pointers here”—to a contract the compiler can’t verify and a developer upholds. This is a preview feature in .NET 11 and C# 15. The model and syntax might change for .NET 12 and C# 16. The current preview includes two language changes you can try. You need to opt in explicitly: add <Features>$(Features);updated-memory-safety-rules</Features> and <LangVersion>preview</LangVersion> to your project file.

In the new model, pointer types no longer need an unsafe context. You can declare a pointer type, take an address with &, use the fixed statement, convert a stackalloc to a pointer, and use sizeof on an unmanaged type in a safe context.

Operations that dereference pointers still require unsafe: pointer indirection (*p), member access through a pointer (p->m), element access through a pointer (p[i]), fixed-size-buffer element access, and function-pointer invocation.

Finally, when a member adds the unsafe modifier to its signature, that member can be called only in an unsafe context. This is a breaking change from the current semantics of unsafe on a member. The member is declaring that its callers must ensure that the contract is followed, or propagate the unsafety by also including the unsafe modifier in its declaration.

Read Improving C# memory safety for the full model, and see the unsafe code reference for the rules implemented in preview in C# 15.

Important

This is a preview feature in .NET 11 and C# 15. The design isn’t final and will continue to evolve before it ships in its final form. We want people to try the preview behavior and give us feedback in csharplang so we can shape the final experience.

Collection expression arguments

Collection expressions convert to many collection types, but until now you couldn’t pass arguments to the underlying constructor or Create method. C# 15 adds a with(...) element, written first, that forwards arguments to the constructor or factory method.

This feature is necessary for the upcoming dictionary expressions syntax. You will often specify the comparer for a dictionary. You can use the feature now for sequence containers:

// Before
List<string> names = new(capacity: values.Length * 2);
names.AddRange(values);

var set = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "Hello", "HELLO" };
// After (C# 15)
List<string> names = [with(capacity: values.Length * 2), .. values];

HashSet<string> set = [with(StringComparer.OrdinalIgnoreCase), "Hello", "HELLO"];

Learn more in collection expression arguments.

Extension indexers

C# 14 introduced extension members: properties and operators alongside methods. C# 15 adds extension indexers, so you can index into a receiver as if the indexer were declared on its type. Indexers can’t be static, so the extension container must include a named receiver.

// Before: a helper method
public static class SequenceExtensions
{
    public static int ElementAtIndex(this IEnumerable<int> sequence, int index)
        => sequence.ElementAt(index);
}

int third = numbers.ElementAtIndex(2);
// After (C# 15): an extension indexer
public static class SequenceExtensions
{
    extension(IEnumerable<int> sequence)
    {
        public int this[int index] => sequence.ElementAt(index);
    }
}

int third = numbers[2];

Learn more in the extension indexers reference.

Labeled break and continue

Breaking out of a nested loop usually means a flag, a goto, or an extracted method. With C# 15, you can label a loop and target it directly with break or continue.

// Before: a flag to unwind the outer loop
bool found = false;
foreach (Warehouse warehouse in warehouses)
{
    foreach (Bin bin in warehouse.Bins)
    {
        if (bin.Sku == requestedSku && bin.Quantity > 0)
        {
            reserved = Reserve(bin);
            found = true;
            break;
        }
    }
    if (found)
        break;
}
// After (C# 15): label the loop and break it directly
scan: foreach (Warehouse warehouse in warehouses)
{
    foreach (Bin bin in warehouse.Bins)
    {
        if (bin.Sku == requestedSku && bin.Quantity > 0)
        {
            reserved = Reserve(bin);
            break scan;
        }
    }
}

The intent is in the code, with no flag to track. See the jump statements reference.

Try the preview

Download .NET 11 and try C# 15 on your apps. Read What’s new in C# 15 for the complete reference and participate in the ongoing discussions in csharplang.

The post Explore new features available in C# 15 preview appeared first on .NET Blog.

Read the whole story
alvinashcraft
20 minutes ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories