Contents

197 Articles
12 Comments

Search

1 week Ago

Svelte vs. React (overselling a framework as a revolution)

Published by marco on

I’ve just read about a web framework called Svelte in the post Virtual DOM is pure overhead. I think the product itself sounds interesting, but that the author uses unnecessarily misleading arguments.

From what I gather, Svelte is a compile-time reconciliation generator for JSX/TSX components. This pre-calculated generator applies changes to the DOM without needing a virtual DOM and without real-time diffing or reconciliation. That is, instead of having real-time calculation, with possible... [More]

2 months Ago

Why use an IOC? (hint: testing)

Published by marco on

Inversion of Control Pattern

The IOC pattern is the [I] in SOLID. It stands for “Inversion of Control”.

In order to make good use of this pattern, an application should adhere to the following rules:

  • Prefers composition over inheritance, exposing clear dependencies
  • Refers to dependencies via interface or protocol types with as small a surface area as possible Obtains dependencies through injection, preferably in the constructor

Components built in this manner are agnostic in their... [More]

4 months Ago

Using Unity, Collab and Git

Published by marco on

If you’re familiar with the topic, you might be recoiling in horror. It would be unclear, though, whether you’re recoiling from the “using Collab” part or the “using Collab with Git” part.

Neither is as straightforward as I’d hoped.

tl;dr: If you have to use Collab with Unity, but want to back it up with Git, disable core.autocrlf[1] and add * -text to the .gitattributes.

Collab’s Drawbacks

Collab is the source-control system integrated into the Unity IDE.

It was built for designers to be... [More]

Finding deep assembly dependencies

Published by marco on

Quino contains a Sandbox in the main solution that lets us test a lot of the Quino subsystems in real-world conditions. The Sandbox has several application targets:

  • WPF
  • Winform
  • Remote Data Server
  • WebAPI Server
  • Console

The targets that connect directly to a database (e.g. WPF, Winform) were using the PostgreSql driver by default. I wanted to configure all Sandbox applications to be easily configurable to run with SqlServer.

Just add the driver, right?

This is pretty straightforward for a... [More]

QQL: A Query Language for Quino

Published by marco on

In late 2011 and early 2012, Encodo designed a querying language for Quino. Quino has an ORM that, combined with .NET Linq provides a powerful querying interface for developers. QQL is a DSL that brings this power to non-developers.

QQL never made it to implementation—only specification. In the meantime, the world moved on and we have common, generic querying APIs like OData. The time for QQL is past, but the specification is still an interesting artifact, in its own right.

Who knows? Maybe... [More]

Breaking Changes in C#

Published by marco on

Due to the nature of the language, there are some API changes that almost inevitably lead to breaking changes in C#.

Change constructor parameters

While you can easily make another constructor, marking the old one(s) as obsolete, if you use an IOC that allows only a single public constructor, you’re forced to either

  • remove the obsolete constructor or
  • mark the obsolete constructor as protected.

In either case, the user has a compile error.

Virtual methods/Interfaces

There are several... [More]

Version numbers in .NET Projects

Published by marco on

Any software product should have a version number. This article will answer the following questions about how Encodo works with them.

  • How do we choose a version number?
  • What parts does a version number have?
  • What do these parts mean?
  • How do different stakeholders interpret the number?
  • What conventions exist for choosing numbers?
  • Who chooses and sets these parts?

Stakeholders

In decreasing order of expected expertise,

  • Developers: Writes the software; may *change* version numbers
  • Testers:... [More]

v6.0: .NET Standard & Authentication

Published by marco on

Note: this article was originally published at Encodo.com at the end of October, 2018.


The summary below describes major new features, items of note and breaking changes.

The links above require a login.

Overview

At long last, Quino enters the world of .NET Standard and .NET Core. Libraries target .NET Standard 2.0, which means they can all be used with any .NET runtime... [More]

Learning Quino: a roadmap for documentation and tutorials

Published by marco on

Note: this article was originally published at Encodo.com in July, 2018.


In recent articles, we outlined a roadmap to .NET Standard and .NET Core and a roadmap for deployment and debugging. These two roadmaps taken together illustrate our plans to extend as much of Quino as possible to other platforms (.NET Standard/Core) and to make development with Quino as convenient as possible (getting/upgrading/debugging).

To round it off, we’ve made good progress on another vital piece of any... [More]

Delivering Quino: a roadmap for deployment

Published by marco on

Note: this article was originally published at Encodo.com in July, 2018.


In a recent article, we outlined a roadmap to .NET Standard and .NET Core. We’ve made really good progress on that front: we have a branch of Quino-Standard that targets .NET Standard for class libraries and .NET Core for utilities and tests. So far, we’ve smoke-tested these packages with Quino-WebApi. Our next steps there are to convert Quino-WebApi to .NET Standard and .NET Core as well. We’ll let you know when it’s... [More]

Removing unwanted references to .NET 4.6.1 from web applications

Published by marco on

Note: this article was originally published at Encodo.com in July, 2018.


The title is a bit specific for this blog post, but that’s the gist of it: we ended up with a bunch of references to an in-between version of .NET (4.6.1) that was falsely advertising itself as a more optimal candidate for satisfying 4.6.2 dependencies. This is a known issue; there are several links to MS GitHub issues below.

In this blog, I will discuss direct vs. transient dependencies as well as internal vs. runtime... [More]

Quino’s Roadmap to .NET Standard and .NET Core

Published by marco on

Note: this article was originally published at Encodo.com in May, 2018.


With Quino 5, we’ve gotten to a pretty good place organizationally. Dependencies are well-separated into projects—and there are almost 150 of them.

We can use code-coverage, solution-wide-analysis and so on without a problem. TeamCity runs the ~10,000 tests quickly enough to provide feedback in a reasonable time. The tests run even more quickly on our desktops. It’s a pretty comfortable and efficient experience,... [More]

Convert Markdown to earthli format

Published by marco on

The earthli blogging format uses HTML-like formatting, described in the lengthy manual (with examples). However, Encodo’s blogging back-end now uses Umbraco, with Markdown for content. I used to be able to cross-post with ease, by copy/pasting. Now, I need to convert the content from Markdown to earthli formatting.

The following steps suffice to convert any article:

  1. If there are attached media (e.g. graphics), save those locally
  2. Create a new earthli article with the same title as the source... [More]

5 months Ago

Compiler Pessimism

Published by marco on

“In practice, nearly everything you write is potentially dependent upon the order of evaluation, but in practice it isn’t because you are not a nincompoop.”

He completes the thought with “[b]ut the compiler doesn’t know that. The compiler must adhere to the letter of the language standard, because it has to compile insane code as well as sane code.”

Inventing languages for the sake of it

Published by marco on

The article Fear, trust and JavaScript: When types and functional programming fail presents issues in JavaScript and a solution: use another language. The list several newer ones that are completely untested.

But the main problem that the article mentions can’t be solved 100% by any language. The main problem is at the boundaries of your application: inputs.

When you get data from an external source, you have to validate it somehow before passing it along to the rest of the application.

No... [More]

Anyone Can Be a Programmer, Right?

Published by marco on

The post on Reddit called Someone asked me to make a site for them and I don’t know how the fuck I’m supposed to go about it. is about exactly what it sounds like it’s about. Amid the flurry of comments with recommendations on how to pretend he (or she) knows how to build a web site by using tools he’s (or she’s) never heard of, I chimed in with,

What is it about software that makes people who have never done it think that they can do it professionally?

What if your neighbor had heard you... [More]

Ray-tracing on postcards

Published by marco on

The article Deciphering The Postcard Sized Raytracer by Fabien Sanglard is a wonderfully presented breakdown of how the path tracer found on a postcard does its magic. It’s not super-fast (it takes 3 minutes to produce a much rougher version on the author’s machine). He includes his final cleaned-up source code.

It comes from the same person who made the business card ray-tracer discussed in the article Decyphering The Business Card Raytracer by Fabien Sanglard.

The problem with slow development tools

Published by marco on

The article ”Modern” C++ Lamentations by Aras Pranckeviciusis a wide-ranging rant about the inefficiency of C++ template programming and the degree to which it’s inappropriate for many of the areas where C++ is used. Aras is one of the developers for the Unity game engine

In particular, he highlights the disastrous compilation and execution speeds when using a lot of the STL. Not only that, but the debugging time is extremely slow, due to the inordinate amount of extra symbol information associated with hundreds of... [More]

.NET Tips and Resources

Published by marco on

If you’re a .NET developer, this is video you’ve been looking for:

S107 − Build great libraries using .NET Standard by Immo Landwerth (YouTube)

Immo tells you everything you need to know about Nuget, using Package References, switching to .NET Core, and using Assembly-Binding Redirects in .NET Framework (they’re not necessary in .NET Core). He also includes an effusive apology for the nightmare of compatibility issues that accompanied the purported interoperability between .NET 4.6.1 and .NET Core.

If you want to be compatible with .NET Core 1.5 or lower, then you... [More]

11 months Ago

Which type should you register in an IOC container?

Published by marco on

Use Case

I just ran into an issue recently where a concrete implementation registered as a singleton was suddenly not registered as a singleton because of architectural changes.

The changes involved creating mini-applications within a main application, each of which has its own IOC. Instead of creating controllers using the main application, I was now creating controllers with the mini-application instead (to support multi-tenancy, of which more in an upcoming post).

Silent Replacement of... [More]

1 year Ago

Tools for maintaining Quino

Published by marco on

The Quino roadmap shows you where we’re headed. How do we plan to get there?

A few years back, we made a big leap in Quino 2.0 to split up dependencies in anticipation of the initial release of .NET Core. Three tools were indispensable: ReSharper, NDepend and, of course, Visual Studio. Almost all .NET developers use Visual Studio, many use ReSharper and most should have at least heard of NDepend.

At the time, I wrote a series of articles on the migration from two monolithic assemblies (Encodo... [More]

File-system consistency

Published by marco on

The long and technical article Files are hard by Dan Luu discusses several low-level and scholarly analyses of how common file-systems and user-space applications deal with read/write errors.

  • How theoretically consistent is the file system?
  • How well-documented are patterns that guarantee consistency?
  • How well-understand are these patterns in the communities using them?
  • How do common applications (e.g. source control, databases, etc.) use these patterns?
  • Are these applications guaranteeing consistency?... [More]

2 years Ago

Adventures in .NET Standard 2.0-preview1

Published by marco on

.NET Standard 2.0 is finally publicly available as a preview release. I couldn’t help myself and took a crack at converting parts of Quino to .NET Standard just to see where we stand. To keep me honest, I did all of my investigations on my MacBook Pro in MacOS.

IDEs and Tools

I installed Visual Studio for Mac, the latest JetBrains Rider EAP and .NET Standard 2.0-preview1. I already had Visual Studio Code with the C#/OmniSharp extensions installed. Everything installed easily and quickly and I... [More]

C# Handbook 7.0

Published by marco on

 I announced almost exactly one year ago that I was rewriting the Encodo C# Handbook. The original was published almost exactly nine years ago. There were a few more releases as well as a few unpublished chapters.

I finally finished a version that I think I can once again recommend to my employees at Encodo. The major changes are:

  • The entire book is now a Git Repository (GitHub). All content is now in Markdown. Pull requests are welcome.
  • I’ve rewritten pretty much everything. I removed a lot of... [More]

The weird world of type-compatibility in TypeScript

Published by marco on

I recently fixed a bug in some TypeScript code that compiled just fine—but it looked for all the world like it shouldn’t have.

tl;dr: there is no TypeScript compiler bug, but my faith in the TypeScript language’s type model is badly shaken.

A simple example

The following code compiles—and well it should.

interface IB {
  name: string;
}

interface IA {
  f(action: (p: IB) => void): IA;
}

class A implements IA {
  f = (action: (p: IB) => void): IA => {
    return this;
  }
}

Some... [More]

My Impressions and Notes from VoxxedDays 2017

Published by marco on

Encodo presented a short talk at Voxxed Days 2017 this year, called The truth about code reviews. Sebastian and I also attended the rest of the conference. The following is a list of notes and reactions to the talks.


Engineering You

Martin ThompsonVideo

The keynote was about our place in the history of software engineering. Martin described us more as alchemists than engineers right now, a sentiment with which I can only agree. There is too little precision, too little... [More]

The evolving Swift string API and implementation

Published by marco on

As Microsoft did a couple of years ago, Apple’s language designers are also designing the next version of Swift in public.[1] One example of the new design is the discussion of String Processing For Swift 4 (GitHub). If you read through the relatively long document, you can at least see that they’re giving the API design a tremendous amount of thought.

API Considerations for Strings

There are so many factors to weigh when building the API, especially for a low-level construct like String.

  • As they state... [More]

A tuple-inference bug in the Swift 3.0.1 compiler

Published by marco on

I encountered some curious behavior while writing a service-locator interface (_protocol_) in Swift. I’ve reproduced the issue in a stripped-down playground[1] and am almost certain I’ve found a bug in the Swift 3.0.1 compiler included in XCode 8.2.1.

Update: At the suggestion of a reader, I searched and found Apple’s Jira for Swift[2] and reported this issue as A possible tuple-inference/parameter-resolution bug in Swift 3.0.1

A Simple, Generic Function

We’ll start off with a very basic example,... [More]

Programming-language Features: How much is too much?

Published by marco on

The article Dark Path by Robert C. Martin was an interesting analysis of a recent “stricter” trend in programming languages, as evidenced by Swift and Kotlin. I think TypeScript is also taking some steps along this path, as well as Rust, which I have a read a lot about, but haven’t had much occasion to use.

Correct vs. Expressive

The point Martin makes is that all of these languages seem to be heedlessly improving correctness at the possible cost of expressiveness and maintainability. That is, as types are... [More]

Set up JetBrains DataGrip with local SQL Server Express

Published by marco on

The article Connecting DataGrip to MS SQL Server by Maksim Sobolevskiy on June 21, 2016 (JetBrains Blog) covers all of the points well, with screen shots but I just wanted to record my steps, collected into a tight list. Screenshots for most of these steps are available in the blog linked above.

If you don’t have a license for DataGrip, you can download a 30-day trial or you can download the JetBrains Rider EAP, which bundles it. Once Rider is released, you’ll have to have a license for it, but—for now—you can use it for free.

  • Open SQL Server... [More]