Showing posts with label patterns. Show all posts
Showing posts with label patterns. Show all posts

2015-05-21

The ultimate programming language

One of my favorite bloggers had an article last month that resulted in a rather interesting conclusion; that the ultimate programming language is a language without a lot of features most developers take for granted.

2015-05-07

To await or not to await - that is the question

One question that comes up quite often is if you should always use async/await or not. Sadly enough the answer is not simple because there is a trade-off between performance and ease of understanding exceptions.

2015-04-23

Don't let your constructor create the world around it

I recently listened to a developer podcast about the async/await feature in .Net. And I was terrified when the host asked about using those key words in the constructor.

2015-04-09

Proper collection implementation in .net

Most people I've worked with that needed a collection of some sort have implemented the collection by inheriting from one of the standard collection classes. This is however typically not the right thing to do since you expose more functionality than you really want in many cases.

2015-03-26

What fire and forget really means

From time to time people implement something that they want to use in a fire-and-forget fashion. Typically it is some non-critical service you want to notify. Sadly most people get this wrong since they don't understand what fire-and-forget means and instead fire blindly.

2015-03-12

Bleeding HTTP status codes

Developing web services there is an anti-pattern that I often see slip through the cracks and that is when HTTP constructs bleed through abstraction layers.

2015-02-19

Object Calisthenics and Domain Modeling

Several times before I've covered how object calisthenics can save you so naturally I'm happy to see yet another example. This time referenced to as domain modeling which is probably a better approach than talking about calisthenics since that is a work many of us have no idea what it means...

2015-01-22

What to do with a caught exception

Some people like exceptions and some don't. Some people like them for exceptional things. Regardless of what type you are there is also a debate about what you do with that exception once you catch it.

2015-01-15

These are not the abstractions you are looking for

People around me often hear me mumble things like "I think we are missing a level of abstraction here". This is something that often happens when I help people understand how to efficiently unit test a piece of code. But right before Christmas I was working in some code that perfectly highlighted that all abstractions are not equal.

2014-10-23

2014-08-21

IoC - good, bad and ugly

I was reading this article that is doing a pretty good job at explaining in what situations an IoC container saves the day. And even though I dislike most uses of IoC containers I've seen I have found them useful once or twice.

2014-07-24

How object calisthenics can save the night

Last week we had a 24 hour hackathon at work. And I ended up using an old trick I've mentioned before.

2014-07-03

Avoiding conditionals to improve code

Last year Michael Feathers wrote an article about unconditional programming which in essence is just an idea to avoid any type of control structures since control structures tend to make code harder to understand. This is not a new idea.

2014-06-26

Enforcing parameter names

In the late 90s I was asked to teach an "introduction to C for programmers" course at a large Swedish company. Turned out that my definition of programmer was quite different than that of the company.

2014-03-20

When to use Tuples in C#

I've seen people use the Tuple class in C# code and I've even done it myself once. And I didn't like it. I'm still struggling to see find a case where using a Tuple would actually be a good idea versus the alternatives.