Contents

312 Articles
14 Comments

Search

2 weeks Ago

Maddy Mondaquila (new .NET Aspire PM) talks programming tools

Published by marco on

This is a wide-ranging, occasionally delightfully foul-mouthed, and brutally honest interview with PM Maddy Mondaquila of Microsoft. Kudos to them for letting their best people do these kinds of informative and insightful interviews.

MAUI Lead Leaves to Work on .NET Aspire (and interview with Maddy Mondaquila) by Nick Chapsas (YouTube)

At 45:57,

“[…] yesterday Dave [Fowler] and I were fighting about if the Visual Studio .gitignore is getting dumber and he was like, ‘who cares about that? Why would anyone care about that?’ And I was, like, it’s 400 lines, dude. Like, we’re ignoring things... [More]”

1 month Ago

tsc is going native

Published by marco on

The article A 10x Faster TypeScript by Anders Hejlsberg (Microsoft) includes the following text, as well as a link to the video below,

“[…] we’ve begun work on a native port of the TypeScript compiler and tools. The native implementation will drastically improve editor startup, reduce most build times by 10x, and substantially reduce memory usage. By porting the current code-base, we expect to be able to preview a native implementation of tsc capable of command-line type-checking by mid-2025, with a feature-complete... [More]

Pointers for large files and repositories in Git

Published by marco on

How to Add files to a Large Repository? (Reddit)

Git has opt-in support for handling large files.

  • Use the –depth option to control how much history to clone (good for pipelines, where you’re usually only interested in the tip, so depth 1)
  • Whereas depth controls how much you clone (size of the .git folder), sparse-checkout controls the size of your working tree.
  •  git logoUse LFS (Large File Storage) to store files. This will not remove large files from existing commits. This feature is seamless to enable and... [More]

Narrowing types to avoid primitive obsession

Published by marco on

Recently, I saw that the following error had been fixed in a code review.

 Classic primitive obsession error

The error shown above is an example of a design smell called Primitive Obsession. This is where code is “obsessed” with primitives, in that it uses a much “wider” type than is actually acceptable.

Whereas C++ has a typedef, TypeScript and Delphi Pascal have a type, C# has … nothing simple. The linked article describes a hand-coded version for making “narrower” types (e.g., MeanLength or ShortFiber). Our go-to... [More]

Who’s going to fix the bad projects?

Published by marco on

The article Can You Get Better Doing a Bad Job? by Jim Neilsen cites Woody Harrelson as saying, “I think when you do your job badly you never really get better at your craft.”

Of course that’s true on the surface: If you manage to avoid learning anything else, then you will only ever get better at doing a bad job. The author expands on this point as follows,

“Experience is a hard teacher. Perhaps, from a technical standpoint, my skillset didn’t get any better. But from an experiential standpoint, my... [More]

James Mickens is back with more

Published by marco on

 James MickensI recently stumbled upon some Essays from the funniest man in Microsoft Research by Raymond (Old New Thing). He is such a funny writer that this article, against convention and like the one before it (Brilliant articles by the funniest guy at Microsoft), will consist mostly of citations rather than an even mix of citations and paraphrasing that I naturally consider to be much more lucid and pithy. I quote at length to do the material justice, for documentation and to ensure that you all download the PDFs to see if there... [More]

2 months Ago

And another thing about MVVM

Published by marco on

I recently wrote Real quick on MVVM and now I see that a good colleague and friend has written his own MVVM understandings by Austin Jones (Austin's Journey for Meaning). His piece got me thinking again about how the concept is a good start but isn’t really sufficient.

Justifying the view model

Somewhere near the beginning, he writes,

“The View Model’s function is separate from the Model. Abstraction requires discipline to not let two pieces of code that do the same thing become the same thing, purely out of convenience. Things that... [More]”

Avoiding completely failed estimates

Published by marco on

 The relatively short post My Washing Machine Refreshed My Thinking on Software Effort Estimation by Chris Horsley (Cosive) is kind of interesting, in that it’s a cautionary tale about being overconfident about your estimates. As the title suggests, his was a real-world task where he’d assumed that a tenth iteration would go just as smoothly. He draws some good conclusions but for what I think might be the wrong reasons.

“[…] while 90% of the project will be the same, there’s going to be one critical difference between... [More]

Tacking against the winds of Copilot

Published by marco on

The tweet ”Programming” by Andrej Karpathy (Twitter) is what some people are calling the future of programming—with the loudest claiming that it’s already here and that you’re all missing the boat if you’re not programming like this.

“There’s a new kind of coding I call “vibe coding”, where you fully give in to the vibes, embrace exponentials, and forget that the code even exists. It’s possible because the LLMs (e.g. Cursor Composer w Sonnet) are getting too good. Also I just talk to Composer with SuperWhisper so I... [More]

Building sites with HTML and CSS

Published by marco on

This is a 40-minute discussion about the combining the latest technologies, like scroll-snapping, scroll-driven animations, anchoring, etc. to produce responsive, progressive, animated, modern, and very fast sites without any JavaScript at all.

Pure CSS Scroll Spy Table of contents − No JavaScript Required! by Kevin Powell & Adam Argyle (YouTube)

Carousels

Adam uses it all to build carousels, which is fine for demos and proving the power of the technologies, but … I’m not a fan. While our two hosts mention that Netflix comprises only carousels, they don’t really discuss that Netflix is... [More]

A roundup of .NET 9 release videos

Published by marco on

In November of 2024, Microsoft released a lot of videos about .NET to accompany the release of .NET 9. I watched/listened to a lot of these, with varying levels of attention paid. When something caught my attention, I took notes. These videos are roughly in the other than I watched them, although I reserved the right to shuffle them about a bit to improve grouping.

AI
  1. AI Building Blocks − A new, unified AI layer by Steve Sanderson
  2. Discover the Latest GitHub Copilot Features for .NET... [More]

Mads Torgerson on union types, existential types, and C# missteps

Published by marco on

This is a nearly 100-minute-long interview and discussion about programming-language design and evolution. It gets deep into the weeds on very specific and relatively advanced language features. While a feature may eventually feel quite simple to use, the considerations about how to design it and how to fit it into the landscape of the rest of the language can be very, very complex. There are a lot of moving parts to consider in a language, runtime, community, and ecosystem as established as... [More]

3 months Ago

CSS: Popovers and anchors

Published by marco on

The article Do JavaScript frameworks still need portals? by Ollie Williams (Fully Stacked) explains a bit more about the relationship between dialog, popover, and anchor as well as how these elements have made “portal” support in frameworks obsolete. The following ~20-minute video shows how to use only CSS and HTML to position and display elements, regardless of their nesting in the document.

CSS Popover + Anchor Positioning is Magical by Kevin Powell (YouTube)

The main example uses CSS anchor positioning (MDN), position-try (MDN) and :popover-open (MDN). You can use position-try to direct the browser to adjust... [More]

4 months Ago

Angular 19 sounds … complicated?

Published by marco on

Some of the features described in the video below sound pretty interesting but they also sounds super-complicated, with deferred-loading, hydration, signals, and event/replay all combined with decisions about whether something loads on the client or the server or whether it’s initially built on the server but then enhanced on the client and then run independently from the server, …

I understand that a lot of this technology is for optimizing large web sites, but It’s honestly questionable... [More]

Using calc-size in CSS

Published by marco on

The following video shows not only when and how to use calc-size(), it also mixes in advice on generating timing functions for animations, sprinkles CSS variables throughout, and even uses overflow: clip combined with an absolutely positioned element to reveal more content without disturbing the layout.

Animate and do math on things like height: auto with interpolate-size and calc-size() by Kevin Powell (YouTube)

The syntax for calc-size() is, as Kevin says, “weird”; you have to pass two parameters: the first is the name of the logical size you’d like to use, while the second parameter is a formula that... [More]

How to apply EF migrations

Published by marco on

The picture and title are, as usual, clickbait-y, because apparently people don’t click on videos that sound educational unless you promise them ground-breaking learnings. Still, I don’t hate the player; I hate the game. But it’s the world we have.

The video is quite informative and is 90% not the guy pictured. Instead, it’s another guy called Gui Ferrera, who is quite competent.

The Correct Way to Run Database Migrations in EF Core by Nick Chapsas / @gui.ferreira (YouTube)

He starts by explaining how to deploy migrations in production—you don’t just run them, as you would in... [More]

5 months Ago

Are you doing the Advent of Code?

Published by marco on

No. No, I’m not.

I was briefly considering it because two good programmer friends[1] of mine asked me, and it seemed like it might be kind of fun to compare our solutions.

But … 24 days, man.

I’ve got other things to do. Like, a lot of other things to do.

I am not in any way bored or looking for things to do.

I’m not even lacking in programming projects that I could be working on.

I’m teaching a JavaScript class right now, for which I’m constantly refining the examples and project code,... [More]

Real quick on MVVM

Published by marco on

A little while back, someone wrote I can’t wrap my head around MVVM (Reddit), asking for help. I answered with a short example, reproduced below.

tl;dr: Use the MVVM Toolkit and try JetBrains ReSharper or Rider for more IDE assistance for binding and fixing up views.[1]

The concept is that:

  • the (M)odel describes your data in the shape you want to store it, process it, etc.
  • a (V)iew describes the elements of the UI.
  • a (V)iew(M)odel mediates between these two “shapes”.

Why do we need this? Why not... [More]

Writing elegant code

Published by marco on

I watched this video analyzing a chunk of code, in the hopes of refactoring it.

Always Return Early in Your Code | Code Cop #024 by Nick Chapsas (YouTube)

The original code is the laughably overblown example below.

public List<int> ProcessData(List<int> data)
{
  if (data != null)
  {
    if (data.Count > 0)
    {
      var processedData = new List<int>();
      foreach (var d in data)
      {
        processedData.Add(d * 2);
      }
      return processedData;
    }
    else
    {
      return new List<int>();
    }
  }
  else
  {
    return null;
  }
}

Nick... [More]

You’re probably doing code reviews incorrectly

Published by marco on

The article Processes and rules make code review less intimidating by Stefan Judis writes,

 Code reviews are, by nature, intimidating. Sometimes even brutal. If you’ve been in the game for long enough, you probably experienced the following: you worked hard on a feature, you’re proud of yourself and open the PR to be praised and land your changes, and then… it rains comments, suggestions and nitpicks. And if it’s really bad, you’re forced to take multiple feedback and clean-up rounds. It sucks.”

Oh, wow.
... [More]

C# vs. TypeScript type-narrowing and coercion

Published by marco on

I was working with a colleague to get the properties that have a particular attribute. The original formulation returned the properties then got the attributes again, plucking the first one off of the list and asserting that it exists to convince the compiler that everything’s OK. We know it exists because otherwise we wouldn’t have returned the property—but the computer doesn’t know that.

Ok, it works but it’s not efficient or elegant. Is there some way to build this so we allocate... [More]

CSS Typography is really good now!

Published by marco on

I not unexpectedly very much enjoyed this somewhat-rambling 59-minute course on controlling font features from CSS. It’s really quite amazing and wonderful what you can do declaratively these days.

CSS Typography Crash Course by Kevin Powell (YouTube)

To begin, Roel Nieskens takes a long look at variable fonts, which can be manipulated via both standard CSS properties, like font-weight, as well as using font-variation-settings, all of which can be animated. Variable fonts support a much more granular range of values for font-weight than... [More]

Delimiting multiple CSS classes

Published by marco on

 While investigating Charts.css, I learned that you can throw unrecognized special characters like square brackets or pipes into CSS class references and its just fine. So you can use them to separate longer lists of classes. For more information, see Cube CSS: grouping by Andy Bell (Piccalilli).

So, you can write:

<article 
class="[ card ] [ section box ] [ bg-base color-primary ]">
</article>

or

<article class="card | section box | bg-base color-primary">
…
</article>

and it works just fine, while being more... [More]

More Stephen Toub: Array Pools

Published by marco on

In this otherwise excellent video, I found myself very much wishing that Toub had written at least a single test for the ArrayPool implementation that he built in this video. Still, check out the selected citation below to get a feeling for how they consider performance implications—there are no easy answers, there is only testing and benchmarking.

Deep .NET: Let's Build Our Own ArrayPool with Stephen Toub and Scott Hanselman by dotnet (YouTube)

At 34:45,

Hanselmann: For folks that may not know what NUMA is: so NUMA is this non-uniform memory access that the computer knows that, like,... [More]”

CSS Magician Roman Komarov plays with sibling-count and sibling-index

Published by marco on

The article Possible Future CSS: Tree-Counting Functions and Random Values by Roman Komarov (Kizu.Dev) is another mathematical master class in using CSS variables and calculations to get at values like “sibling count” and “sibling index”, two values that are in a future proposal for CSS Values and Units Module Level 5 (w3C).

The final demo looks like this, with randomly laid out items squared up into equal columns and rows where possible, all done with only CSS.

 Stacking and squaring up grid items

Here’s a taste of the code for getting a random value in CSS,

... [More]

IAsyncEnumerable for and by dummies

Published by marco on

This isn’t a terrible video on IAsyncEnumerable but it’s also not nearly as high-level and fast-paced as I’m come to expect from the .NET Deep Dive series, which is no-muss/no-fuss with Stephen Toub. Those are much better than this one but, if you’re not grokking what IAsyncEnumerable is good for from the documentation or examples, maybe this one-hour video will help. If you’re lucky, it will make you feel better about your own skills as a programmer.

On .NET Live: Supercharge .NET with IAsyncEnumerables: Efficient Data Streams by dotnet / Chase Aucoin (YouTube)

Maybe I’m just super-smart but I can’t... [More]

A quick look at .NET Aspire

Published by marco on

.NET Aspire is a newly introduced tool for building distributed solutions that run just as easily locally as they do in the cloud. This video explains how this is a boon for integration testing.

End-to-end integration testing with .NET Aspire by dotnet / Aaron Powell (YouTube)

The concept is very nice and seems to greatly simplify building integration tests. Kudos and thanks for the introduction.

 Still, my hair was standing on end with some of the “fast and loose” programming in this video, though. I know that people will argue that you have to take a direct path to get... [More]

6 months Ago

Don’t return await unless you have to

Published by marco on

I finally got around to verifying that the defining dependent async methods like the following one is wasteful.

public async Task<bool> N()
{
   return await M();
}

 A less-contrived example looks like this:

using System.Threading.Tasks;
public class C {
    public Task<bool> M() 
    {
        return Task.FromResult(false);
    }
    
    public async Task<bool> N() 
    {
        return await M();
    }
    
    public async void RunIt()
    {
        var result = await N();
    }
}

This... [More]

Manim: a bespoke animation editor and engine

Published by marco on

 Manim − linear transformation in 3dThis is a fun video that demonstrates an API, runtime, and IDE called Manim that lets you interactively build 3-D animations. It’s like a game-engine editor[1] in which you build your scenes by calling APIs in Python. There’s an interactive Python terminal, a rendering area, and a text editor.

It’s quite nicely done and he’s put it to good use over the years, building hundreds, if not thousands, of videos with it.

How I animate 3Blue1Brown | A Manim demo with Ben Sparks by 3Blue1Brown (YouTube)

The API is quite high-level and robust but it’s so clear how limited the Python... [More]

7 months Ago

C# 13 improvements

Published by marco on

The final document of What’s new in C# 13 (Microsoft Learn) is available. There are no major changes for most end users; the changes listed are interested for library and framework developers—especially those interested in writing highly performant code, e.g., Microsoft in its BCL and ASP.NET.

  1. Completely unsurprisingly, the params keyword now also applies to IEnumerable<T> (as well as many descendants) as well as Span<T> and ReadOnlySpan<T>.
  2. There’s now an official Lock object that, when used instead of the... [More]