Showing posts with label .net. Show all posts
Showing posts with label .net. Show all posts
2016-12-15
All in on async/await
While I haven't been coding in C# for about a year now I couldn't resist reading this recent article. A nice write-up where I only want to make two additions.
2016-07-07
Military LINQ, Time and pointers for kids.
Wow, I was apparently very busy blogging in October 2008. While there are some things that I will not cover below that might be worth reading I wanted to highlight a few things. Both good and embarrassing stuff...
2016-04-21
Go for C# developers: Introduction
When I first started to learn Go a few months ago I compared a lot of things to things that was familiar to me; C#. And I decided to make a series of posts explaining some go-isms in C# (or .Net) terms as well as high-light some of the differences that are important to know about.
2016-02-18
Go, maps and randomization
A couple of years ago it was very easy to DoS attack .Net web services as the headers were added to a dictionary. Back then the hash of the key was predictable so using a bunch of machines in azure and a few days it was possible to generate enough strings that resulted in the same hash value that you then could make a fake request with a lot of headers (a few hundred is typically enough) that caused the web server to spend 100% of CPU searching and updating the header dictionary. Since I recently started doing some work using go (aka golang) I immediately started to wonder how this worked in this language.
2016-01-21
Alternatives to hydrating IEnumerables
You should know that whenever you get an IEnumerable you should only enumerate it twice as some implementations don't allow you to enumerate it twice. Normally you don't get an error the second time - just no more items. But what is really the best way to handle this?
2015-11-12
Writing your own LINQ extension methods?
2015-06-11
Asynchronous enumerations - again
Almost 2 years ago I wrote about this problem with accessing data from Azure and returning it in a LINQ friendly way. Well not long ago the discussion came up again only this time it was in regard to access data in a Cassandra cluster.
2015-05-28
Enumerating dictionaries
When people work with the Dictionary class in .Net there are two common assumptions that I see used a lot. Worst part is that these assumptions are both wrong.
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-16
Advanced breakpoints
I try to live by the motto; starting the debugger is a failure when it comes to code I write. That means that through logging and just reading the code it should be possible to figure out what is going on in my code. However quite often I have to work with code I did not write and then some advanced breakpoint tricks come in handy.
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.
2014-11-27
2014-11-13
The NoMemoryStream
The say there are two hard problems in computer science; cache invalidation, naming things and off by one errors. Hence I can proudly present the NoMemoryStream.
2014-10-23
When generic exceptions are useful
So this is not about catching the base exception but something kind of like using tuples; having an exception template using generics.
2014-10-16
What's on tap? And stay hydrated!
Recently when I was experimenting with Spark and Scala I encountered two patterns that I liked; Tap and Hydrate. So I decided to add them to the toolbox as LINQ extensions.
2014-09-18
Spies and Stubs
I was reading this article which is a response to an email from a person liking mocks but disliking spies. Before starting to read I was confused since I personally dislike mocks and spies sounded even worse. However it turned out I was wrong.
2014-08-14
Appreciating garbage
I once was working with a company that complained that my code was not optimized because it used 100% of the CPU. So I asked if the user interface was responsive. And it was. So I asked if they experienced any noticeable delays in responses. They didn't. So I asked for how long the CPU was at 100%. And the answer was...
2014-07-10
Writing async tests
Ever since async/await was introduced in .net 4.5 I've seen people happily using those keywords in their (unit) tests. A usage I believe to be a mistake.
2014-05-01
Abstracting vs Isolating dependencies
Anybody who is practicing TDD or BDD knows that it is important to abstract dependencies. Especially external dependencies you have no control over. But that might not be enough always.
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.
Subscribe to:
Posts (Atom)