Win a copy of C# Smorgasbord!

Posted by Filip Ekberg on August 14 2012 35 Comments

C# Smorgasbord is getting great reviews, specially on Amazon UK and to celebrate this I want to give a away a free copy of C# Smorgasbord!

Best of all, it’s the printed copy (which also includes the ebook bundle)!

What you need to do to participate:

  1. Leave a comment down below with the reason as to why you should be the lucky winner
  2. Share this post with your friends on twitter:

The best motivation wins and the winner will be notified via e-mail, so be sure to leave your e-mail address when you’re commenting below.

That’s it! Good Luck to you all!

The draw ends September 20 August 26 (6pm CEST) and all comments will be published after that.

The winners have been announced!

Vote on HN

C# Smorgasbord

Posted by Filip Ekberg on August 10 2012 1 Comment

As mentioned in my previous post “C# Smorgasbord will soon be available!” I have been working on a C# programming book.

I am now happy to announce that this book is published and available on CreateSpace and Amazon.com!

Grab a copy and let me know what you think!

It is also available on the following other Amazon sites:

Amazon.co.uk
Amazon.de
Amazon.fr
Amazon.it
Amazon.es

James Sugrue from DZone was able to get early access to C# Smorgasbord and has written an article about it. He also had the opportunity to do an interview with me.

I have gotten a lot of questions regarding the digital copy/ebook, I’m happy to share that the PDF, epub and mobi versions of the book are free if you purchase a printed copy!

If you’ve purchased C# Smorgasbord and are looking to retreive the digital copies, just fill out this form.

The Foreword to the book is written by Kevin Pilch-Bisson who works as a Development — Visual Studio IDE Services for C# and VB.Net. The Foreword is available online and can be read here.

C# Smorgasbord covers a vast variety of different technologies, patterns and best practices that any C# developer should master.

Looking at everything from testing strategies to compilation as a service and how to do really advance things in runtime; you get a great sense of what you as a developer can do. By taking his personal views and his personal experience, Filip digs into each subject with a personal touch and by having real world problems at hand; we can look at how these problems could be tackled.

No matter if you are an experienced .NET developer, or a beginner, you will most certainly find a lot of interesting things in this book. The book covers important patterns and technologies that any developer would benefit from mastering.

Explore your possibilities
Improve your skills
Be Inspired to challenge yourself

Enjoy the read!

Vote on HN

C# Smorgasbord will soon be available!

Posted by Filip Ekberg on July 21 2012 1 Comment

UPDATE: C# Smorgasbord is now available!

Since the fall 2011 I have been working on a book called C# Smorgasbord. The book is inspired by all the interesting topics that I’ve touched in this blog.

I’m proud to announce that the book will soon be available for purchase on Amazon and CreateSpace! You will also be able to purchase digital copies on the website for C# Smorgasbord.

It will be available for purchase August, 2012.

The cover

The cover is produced by a very talented art directory, Christoffer Saltelid and looks like this:

C# Smorgasbord Cover

3D-view of the book

A little bit about the book

Looking at everything from testing strategies to compilation as a service and how to do really advanced things in runtime; you get a great sense of what you as a developer can do. By taking his personal views and his personal experience, Filip digs into each subject with a personal touch and by having real world problems at hand, we can look at how these problems could be tackled.

No matter if you are an experienced .NET developer, or a beginner, you will most certainly find a lot of interesting things in this book. The book covers important patterns and technologies that any developer would benefit from mastering.

Table of Contents

This is the top-level Table of Contents for C# Smorgasbord:

  • Introduction to Parallel Extensions
  • Productivity and Quality with Unit Testing
  • Is upgrading your code a productive step?
  • Creating a challenge out of the trivial tasks
  • Asynchronous programming with async and await
  • Dynamic programming
  • Increase readability with anonymous types and methods
  • Exploring Reflection
  • Creating things at runtime
  • Introducing Roslyn
  • Adapting to Inversion of Control
  • Are you Mocking me?

If you head over to books.filipekberg.se you can pre-order a digital copy today.

Vote on HN

Big O-notation

Posted by Filip Ekberg on August 18 2008 5 Comments

So starting school in a couple of weeks and being told that you wont get any “allowance” from the state makes you think twice about your current situtation. Not that this has anything ( directly  ) to do with o-notation. However this is how i forced myself into learning it. I have to re-take an exam in Algorithms and Datastructures this upcoming week and i want to share my experience in big o-notation.

So basicly we have an array, a list of some sort and somehow we need to go through each element in this list. Having ‘n’ elements we need to create some kind of look like this:

void walkList(int[] numbers)
{
for ( int i = 0 ; i < numbers.lenght(); i ++ )
{
print numbers[i];
}
}

Now this will print all the elements contained in the list of numbers. Lets look at this from a time complexity way, 4 constant operations these being:

  • function input
  • int i assignment
  • i < numbers check
  • increment

And the loop will run ‘n’ times meaning we have n + 4 this will give us O(n + 4), but constant access times are irrelevant talking about runtime so all we do is write O(n). O, ordor as it is pronounced, is a way of stating the time complexity.

Now lets say we need to process ths array in another way, play with the thought that we have this list of numbers and for each number we want to go through the list again. This would give us a nested loop and give the time complexity O(n^2). This meaning that we need to process the list twice for each item, hence n ^ 2.

Looking at a sorting algorithm like Merge Sort that first divides the list into 2 peices untill its at the last item, then merges them. We see the typical behavior of a log() with the base 2. So, the split / sort part is basicly log(n) while the merging part is n and log (n) * n = nlog(n) which is slower than log(n). There are however no “standard” sort algorithms that can do better than nlog(n), in a random case that is. Best case for i.e. bubblesort is log(n)  and worst case for bubblesort is log(n^2) which is slower than mergesort.

Mergesort

When is time complexity nessesary? I would say that during all my years of programming, learning speed, size and other performance parts the hard way, i would say that this is a very good complement to fast calculate time complexity of your algorithm. You can be a very good programmer without knowing a lot about this. A lot of this is just something that a programmer knows how to handle without knowing O-notation. But as said, a good complement.

Vote on HN