What Makes Code Readable: Not What You Think

You often hear about how important it is to write “readable code.” Developers have pretty strong opinions about what makes code more readable. The more senior the developer, the stronger the opinion. But, have you ever stopped to think about what really makes code readable? The standard answer You would probably agree that the following things, regardless of programming language, ...

Read More »

Cross Origin Resource Sharing with WCF JSON REST Services

My KonfDB platform provides a reliable way of configuration management as a service for cross-platform multi-tenant applications. When we refer to cross-platform capabilities, one of the ways to allow clients built using native technologies is by the way of REST services. WCF allows us to host a service and expose multiple endpoints using different protocols. So when KonfDB was in ...

Read More »

Lambda methods and implicit context

The C# compiler is lazy, which is usually a very good thing, but that can also give you some issues. We recently tracked down a memory usage issue to code that looked roughly like this. var stats = new PerformatStats { Size = largeData.Length }; stats.OnCompletion += () => this.RecordCompletion(stats); Write(stats, o => { var sp = new Stopwatch(); foreach ...

Read More »

Software Development Guidelines to Live By

Not too long ago I posted a tweet that immediately went viral. (OK, it’s all relative – to me 66 retweets and 120 favorites is viral.)  It referred to Microsoft’s Engineering Guidelines for contributing to its open-source repository on GitHub for the next version of its web development platform, ASP.NET 5.               You may ...

Read More »

Taking full dumps for big IIS apps

If your application is running on IIS, you are getting quite a lot for free. To start with, monitoring and management tools are right there out of the box. You are also getting some… other effects. In particular, we had RavenDB running inside IIS that exhibit a set of performance problems in a couple of nodes (and just on those ...

Read More »

11 Rules All Programmers Should Live By

I am a person who tends to live by rules. Now granted, they are mostly rules I set for myself—but they are still rules. I find that creating rules for myself helps me to function better, because I pre-decide things ahead of time instead of making all kinds of decisions on the fly. Should I go to the gym this ...

Read More »

Integrating Node.js with a C# dll

Recently I had to integrate a Node.js based server application with a C# DLL. Our software (a web-app) offers the possibility to execute payments over a POS terminal. This latter one is controllable through a dedicated DLL which exposes interfaces like ExecutePayment(operation, amount) and so on. As I mentioned, there is the Node.js server that somehow exposes the functionality of ...

Read More »

Handle Cyclical References with ASP.NET Web API 2 and MVC 6

Many ORM (object-relational mapping) tools, such as Entity Framework 6 Tools for Visual Studio 2012 & 2013, Entity Framework Power Tools, or Entity Framework Reverse POCO Generator, generate entity classes that contain cyclical references. Download the source code, samples, and NuGet packages for this blog post:             AspNet WebApi 2 Helpers (Asp.Net 4 / vCurrent) ...

Read More »

Pairing Patterns

Pair programming is hard. When most developers start pairing it feels unnatural. After a lifetime of coding alone, headphones on, no human contact; suddenly talking about every damned line of code can seem weird. Counter-productive, even. And yet… effective pairing is the cheapest way to improve code quality. Despite what superficially seems like a halving in productivity – after all, your ...

Read More »

Deploying: Git vs. TFS Showdown

I think everyone agrees deployment should be as simple as possible. Seems like everyone talks about continuous integration/deployment/delivery. More and more people (and cloud providers) start using the source control mgmt system as their deployment solution. Especially Git seems to be quite suitable for that, i.e. you push to a dedicated “deploy” branch which is being automatically fetched, build and ...

Read More »