2 weeks Ago
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.
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.
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.
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.
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.
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]
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
This 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.
The API is quite high-level and robust but it’s so clear how limited the Python... [More]