Joรฃo Antunes's Avatar

Joรฃo Antunes

@joao.antunes.dev

Code, headbang, grouch, repeat! ๐Ÿ‘จโ€๐Ÿ’ป๐Ÿค˜๐Ÿ˜ˆ๐Ÿ” Writing and talking about code, headbanging @ concerts, ranting @ anywhere. He/him https://antunes.dev & https://blog.codingmilitia.com

229 Followers  |  228 Following  |  196 Posts  |  Joined: 01.09.2023  |  2.0011

Latest posts by joao.antunes.dev on Bluesky

Maybe that's because yield was already taken (at least in C#, which I think was one of the originators of the whole async/await stuff).

06.08.2025 09:35 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Nope, still there with you

05.08.2025 21:23 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

For a moment, I naively thought (hoped?) the PR got merged, then looked more closely ๐Ÿ˜…

26.07.2025 09:25 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Screenshot of a portion of .NET documentation about dictionaries, reading:

"Use AI to initialize a dictionary
You can use AI tools, such as GitHub Copilot, to generate C# code to initialize a dictionary with a collection initializer. You can customize the prompt to add specifics per your requirements.

The following text shows an example prompt for Copilot Chat:"

Then a "code" box appears with a prompt reading: "Generate C# code to initialize Dictionary<int, Employee> using key-value pairs within the collection initializer. The employee class is a record class with two properties: Name and Age."

Wraps up with the usual warnings about generative AI being crap, reading: "GitHub Copilot is powered by AI, so surprises and mistakes are possible. For more information, see Copilot FAQs"

Screenshot of a portion of .NET documentation about dictionaries, reading: "Use AI to initialize a dictionary You can use AI tools, such as GitHub Copilot, to generate C# code to initialize a dictionary with a collection initializer. You can customize the prompt to add specifics per your requirements. The following text shows an example prompt for Copilot Chat:" Then a "code" box appears with a prompt reading: "Generate C# code to initialize Dictionary<int, Employee> using key-value pairs within the collection initializer. The employee class is a record class with two properties: Name and Age." Wraps up with the usual warnings about generative AI being crap, reading: "GitHub Copilot is powered by AI, so surprises and mistakes are possible. For more information, see Copilot FAQs"

What in the actual hell is this ๐Ÿ’ฉ?

Saw someone sharing it, thought it was a joke, but alas, this is really there in the docs. I don't even have words to describe the utter nonsense that this is.

#DotNet #CSharp

learn.microsoft.com/en-us/dotnet...

26.07.2025 07:56 โ€” ๐Ÿ‘ 9    ๐Ÿ” 1    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Learned this, the hard way, a few years back ๐Ÿ˜…

blog.codingmilitia.com/2022/09/01/b...

20.07.2025 10:00 โ€” ๐Ÿ‘ 3    ๐Ÿ” 1    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Preview
Unexpected inconsistency in records Unexpected inconsistency in records The other day, I was trying to figure out a bug in my code, and it turned out to be a misunderstanding on my part as to how C# records work. Itโ€™s entirely โ€ฆ

Blogged: Unexpected inconsistency in records - codeblog.jonskeet.uk/2025/07/19/u... - if you use C# records and the "with" operator, I'd suggest reading this to avoid a footgun you may be unaware of

19.07.2025 13:08 โ€” ๐Ÿ‘ 56    ๐Ÿ” 13    ๐Ÿ’ฌ 5    ๐Ÿ“Œ 2

๐Ÿฐ dotnet cake.cs - Cake.Sdk Preview!

New way to get Cake .NET tool scripting in .NET console apps:
โœ… File-based builds (.NET 10)
โœ… Project-based builds (.NET 8/9/10)
โœ… Auto-generated aliases
โœ… Full addin/module support

Early feedback wanted!
cakebuild.net/blog/2025/07...

#CakeBuild #DotNet

17.07.2025 18:43 โ€” ๐Ÿ‘ 20    ๐Ÿ” 11    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 4
Video thumbnail

"dotnet cake.cs"

#dotnet #cake #devops #itshappening #staytuned

16.07.2025 14:39 โ€” ๐Ÿ‘ 14    ๐Ÿ” 10    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 3
Preview
Adopting Problem Details for HTTP APIs Time for a quick post about Problem Details, and how we adopted it at work, in a way thatโ€™s actually useful.

New one up ๐Ÿ—ž๏ธ

"Adopting Problem Details for HTTP APIs"

In which I rant a bit, but also provide a glimpse into how we're approaching it at work.

#OpenApi #HttpApi #ProblemDetails #DotNet #CSharp

blog.codingmilitia.com/2025/07/15/a...

15.07.2025 14:07 โ€” ๐Ÿ‘ 3    ๐Ÿ” 1    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

WeTransfer just changed their TOS giving themselves permission to train AI on any content you transfer and produce derivative works based on content you transfer that they are allowed to monetize and you are not allowed payment for.

Stop using WeTransfer.

14.07.2025 23:05 โ€” ๐Ÿ‘ 7655    ๐Ÿ” 5361    ๐Ÿ’ฌ 132    ๐Ÿ“Œ 475

Does nobody care about providing information about what went wrong when handling an API request? I'd think this should be a must from the get go, but given its complete absence from the framework and lack of folks asking for it, maybe I'm the minority here.

14.07.2025 18:46 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
[Question] Is there a way to properly emulate InvalidModelStateResponseFactory in minimal apis? ยท Issue #57337 ยท dotnet/aspnetcore Hi. When trying to migrate some existing endpoints to minimal apis, I discovered that is not as easy as in controllers to change the behaviour of a binding error (and I wanted to return the same re...

Kind of sad that the linked issue, about being able to tailor a nice 400 response with actionable information for the API client, doesn't seem to even come close to be a priority.

#DotNet #CSharp #MinimalApis

github.com/dotnet/aspne...

14.07.2025 18:46 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Home | xUnit.net

In preparation for publishing v3 3.0.0, we've switched over to the new website at xunit.net (and new.xunit.net is no longer published).

The new content lives at github.com/xunit/xunit.... (the old `gh-pages` branch of xunit/xunit will be deleted soon).

Let us know of any issues with the new site!

13.07.2025 18:07 โ€” ๐Ÿ‘ 1    ๐Ÿ” 3    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Creating #DotNet new templates is such a pain ๐Ÿ˜ฎโ€๐Ÿ’จ

Either Rider could use some improved support there, or I'm "holding it wrong" ๐Ÿ˜…

11.07.2025 08:42 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Preview
Introducing OpenCLI Patrik Svensson's blog

I just published a blog post about the OpenCLI initiative. I think it's time we had a way to standardize CLI automation!

Feedback, suggestions, and thoughts are more than welcome.

patriksvensson.se/posts/2025/0...

08.07.2025 08:29 โ€” ๐Ÿ‘ 61    ๐Ÿ” 33    ๐Ÿ’ฌ 8    ๐Ÿ“Œ 3
Release v0.3.0 ยท YakShaveFx/outboxkit Behind the scenes: Resiliency improvements (#45 and #47) Introduced retry completion of already produced messages, to try to minimize duplicates Introduced retries with backoff strategies to mini...

Link to the (terse) release notes github.com/YakShaveFx/o...

07.07.2025 13:36 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Not much user facing going on (other than renaming some metrics), but the new version has some resiliency improvements to help when there are infrastructure issues (i.e. problems with the database or message broker).

07.07.2025 13:36 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
OutboxKit Toolkit to implement the transactional outbox pattern

New version of #OutboxKit out, focused on resiliency.
#DotNet #CSharp #OutboxPattern
outboxkit.yakshavefx.dev

07.07.2025 13:36 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

In mid 2010's? I still have to fight/workaround this resistance to using different stacks and we're mid 2025 ๐Ÿ˜…

Folks probably missed the memo around these parts ๐Ÿ˜‚

04.07.2025 15:44 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Post image

we have never been more back than right now, at this very moment, as you read this

01.07.2025 02:19 โ€” ๐Ÿ‘ 26    ๐Ÿ” 5    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Yeah, makes total sense!

It's just that, out of habit, I defaulted to want to touch the application and not the collector config ๐Ÿ˜…

30.06.2025 09:54 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Many thanks for the input!

30.06.2025 09:29 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Ok, I think I see what you mean. Instead of touching the application, I could improve the sampling logic to keep these traces (e.g. HTTP requests with 4xx responses).

30.06.2025 09:27 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Would it make sense to set the request span status to error, or would that be a dirty hack, which would do the trick, but isn't a good practice?

30.06.2025 09:08 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

However, we're using tail sampling, sampling a small percentage of the total traces, as well as any trace that has an error status.

This means there's a high likelihood the trace id won't be found, cause the problem details are returned as part of the normal flow of the request handling.

30.06.2025 09:08 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Hey @martindotnet.bsky.social , would love a quick opinion ๐Ÿ™‚

We're using problem details to provide our API clients with information about issues with the requests (validation, domain, etc), including a trace id in the payload.

30.06.2025 09:08 โ€” ๐Ÿ‘ 0    ๐Ÿ” 1    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Can't find information in the code, comments, docs, nothing. Ideally, the unit should be encoded with a type (strongly typed languages and all that), but at least give me a clearer parameter name or a comment ๐Ÿ˜…

30.06.2025 08:42 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
A screenshot of a Java method named setSizeThreshold, which has a single parameter named sizeThreshold.

This method is part of a FileCompactionStrategy.Builder class, and serves to set the maximum file size before compaction is triggered.

Nowhere in the code does it say the unit associated with this size threshold.

A screenshot of a Java method named setSizeThreshold, which has a single parameter named sizeThreshold. This method is part of a FileCompactionStrategy.Builder class, and serves to set the maximum file size before compaction is triggered. Nowhere in the code does it say the unit associated with this size threshold.

Gotta love methods and parameters with vague names.

What's the unit for this size threshold? I have to assume it's bytes, but as the saying goes "assumption is the mother of all f***-ups", so I shouldn't be assuming anything ๐Ÿ˜’

30.06.2025 08:42 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Video thumbnail

Absolutely incredible turnout for Budapest Pride! So proud of all the organizers, including some old friends, who estimate hundreds of thousandsโ€” major embarrassment to Orban

28.06.2025 17:23 โ€” ๐Ÿ‘ 39082    ๐Ÿ” 8185    ๐Ÿ’ฌ 520    ๐Ÿ“Œ 818

The worst part is that we have an administration now that wants people to use fossil fuels. Trump would have children shoveling coal into the data center hatch if it made him money somehow.

Iโ€™m so tired of people handwaving the environmental impact. They did the same thing with web3.

28.06.2025 14:49 โ€” ๐Ÿ‘ 26    ๐Ÿ” 6    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

@joao.antunes.dev is following 19 prominent accounts