GOTO day 2 – good times in .NET land

by DotNetNerd 26. September 2014 17:46

As I wrote before the conference I was glad to see some good speakers on the Microsoft track. So of course I prioritized a couple of these sessions, and went to Mads Torgersens C# talk and to Mads Kristensen talking about tooling in ASP.NET. Well technically Thorgersens talk was on the architecture track, but you get the point.

The new world after Roslyn

The C# talk went a bit more into writing analyzers and codefixes than what I had seen before, so that was quite interesting and one of the very concretely usefull takeaways. The idea is that writing an analyzer is just like working with any object model. No more magic, so writing extentions is becomming something any developer can do and no longer reserved for the minority with too much time on their hands. Torgersen also demoed some of the new language features that I blogged about earlier, but on top of that let slide that primary constructors probably won't make it into the language for the final release  in the comming version. The reason is that they want to do more and look at providing recordtypes as well as pattern matching - and want to make sure that they get it right. These are two great features that I miss from F# on a daily basis, so I was glad to hear this. I also aired the idea of make shorthands for stuff like factory methods, which could also reduce some of the boilerplate code that I see a lot.

More...

Goto day 1 roundup – distribute all the things

by DotNetNerd 25. September 2014 15:21

At other conferences I have attended the last year or so, distribution and concurrency have been hot topics, coupled with functional programming and immutability which leands itself well to these kinds of problems. Todays program has certainly been no exception - at least for the talks I ended up picking.

The right Elixir for concurrent fault tolerant systems

In the afternoon I ended up sticking with the bleeding edge track, which has been really interesting. First off was a talk on Idioms of distributed applications with Elixir by Jose Valim, who wrote the language. In his talk Jose went over the idioms of Erlang, which is what Elixir is built on top of. He did a good job at presenting why light weight processes that are allowed to fail fast and recreated by supervisors makes it possible to build fault tolerant distributed systems that are easier to understand and run faster than other paradigmes often based on handeling exceptions via try catch blocks.

More...

Goto keynote "Does the browser have a future"

by DotNetNerd 25. September 2014 09:59

So first day of GOTO in Copenhagen has kicked off, with a somewhat provocative talk entitled "Does the browser have a future?" by Tim Bray - the farther of XML. His initial point was that the browser being declared dead hardly is a new thing since this also happened on the frontpage of Wired magazine in both 1997 and 2010.

A backend detour

Tim went on a detour to cover how this is the golden era of backend development, where life is good because you have few interfaces and testing is easy because it is machines talking to machines. He went over how Erlang, Clojure and Scala are popular but probably not the answer, where he was more optimistic about Go. This should hardly be a surprise, because he has been working at google for a number of years until quite recently. He did however make some good points about having a simple way to work with asyncronicity in a simple language. In the same way he made a short argument that it is also the golden era of persistence, with big companies using NoSQL solutions like Cassandra that enables them to build huge systems that scale with relative ease.

More...

Build 2014 announcements for C#

by DotNetNerd 4. April 2014 17:38

Its Build time again and I just finished watching Mads Torgesens keynote on day 3, where he has been talking about Roslyn and new C# features that are comming. I am really getting excited about Roslyn, with demos comming out that show how to write tooling extentions. Its one of those things that have always seemed out of reach for most things in every day development, simply because it was too much work and pain to do. With Roslyn being open sourced yesterday (by Anders Hejlsberg live on stage), it will provide options never seen before. So it is really a good time to be a C# developer.

On top of that todays demo got into some language features that the team at Microsoft are putting into C# and VB. As Mads said these are all relatively small features, but small as they might be they solve some real pains with todays C#. More...

SQL and NoSQL tools as you know and love them with F#

by DotNetNerd 6. May 2013 14:31

toolsWhile looking at how you can do your common scenarios in F# an obvious thing to look at is data access. I already covered type providers which are fantastic for consuming data. However type providers won't help you when you need to create data or in other ways interact with your SQL database, MongoDB, RavenDB or any other NoSQL solution you might be using. For this you will most likely want to use some of the libraries you already know and love - there is no reason to reinvent everything.

Working with existing libraries is mostly trivial, but F# likes types that are immutable which straight out of the box doesn't play well with serialization and mapping. This means that ORM's and libraries for MongoDB and RavenDB will throw exceptions when they try to construct your F# types. This basically boils down to the fact that code like the sample below won’t work, because the serializer can not instantiate the type and fill in the values.

More...

Canopy – web testing in 10 lines of code

by DotNetNerd 16. April 2013 13:22

With my latest dive into F# I recently came across Canopy, which is a really nice and simple web testing framework. It really is as simple as installing a package and writing a few lines in a console application.

More...

Type Providers – all you can eat data buffet

by DotNetNerd 28. March 2013 20:08

BuffetI shortly wrote about Type Providers for SQL databases and services in a blog post last year, and since then a range of new providers have been written by the community. Just a quick search and you can find providers for WMI, CSV, XML, Regular expressions, REST services, world bank and pretty much every other thing you can imagine. Especially FSharpX and some of the excellent work done by people like Tomas Petricek.

After looking around I was surprised to see some of the use-cases. I was thinking in the lines of what LINQ provides until I saw samples like the provider for regular expressions.

More...

Indulging in my love for programming languages

by DotNetNerd 3. February 2013 20:12

books-300x272I have started this year spending some spare time with two of my favourite languages, besides C# that I primarily use to earn a living. The two languages in question are F# and Python. The represent two other paradigms from the statically typed and object oriented ones that are by far the most main stream, with languages like Java, VB and all the C-family languages. Playing with other paradigms is a great way to learn how some problems may be solved more elegantly either by going polyglot or simply by implementing some of the basic ideas of another paradigm in the language that you work with on a daily basis.

More...

Regain your sanity – a tale of Console2 and Powershell goodness

by DotNetNerd 19. December 2012 16:29

For some time I have grown weary by the ever increasing number of consoles and one-feature-applications I end up using during a work day. The good thing about being a developer is that it is my own fault, because I can just choose to do something about it - and so I did.

First step was based on two blogposts from Scott Hanselman that I remembered reading; "Console2 - A Better Windows Command Prompt" and "Awesome Visual Studio Command Prompt and PowerShell icons with Overlays". Those two posts gave me a place to start so I could get rid of seperate icons on my desktop for cmd, Visual Studio cmd, Powershell, MongoDb, Ryby, Python, Node, Clojure etc. Basically I can now use Powershell with the capabilities of the Visual Studio Command prompt, and have the rest open in other tabs in Console2.

Of course I made a few tweaks of my own, but all credit goes to Scott for a great blogpost. Only thing I was disliking was choosing the kermit green foreground color, because it overrides coloring of eg. error messages.

Second step was reducing the number of one-feature-applications and long cryptic commands that I had to remember or keep in Evernote, .txt files, .bat files and so on. This turned out to be easy by using my profile in Powershell to store functions.

New-Item -ItemType File -Path $profile -Force
notepad $profile

In my profile I can make naming conventions that make sence and I can wrap more complex operations in easilly discoverable functions utilizing Powershells tab-completion. I can replace small tools and scripts for doing xslt transforms, builds, migrations, remote iis resets, deployment to my development machine and so on. What these tools do often turns out to be the equivalent of a few lines of powershell. Mostly something along the lines of this sample, which runs a nant script that does database migrations.

function Invoke-MyProjectMigrate([string]$version)
{
    Set-Location $path
    if ($version -eq "") {
        .\nant.bat /f:nant.DbMigrations.build db.resources.migrate
    }
    else {
        &{.\nant.bat /f:nant.DbMigrations.build db.resources.migrate /D:migration.version=$version }
    }   
}

After a while I wanted to put my functions into modules, so I could package them up, and have a set of functions for each project I work on. To do this I simply moved my functions into separate files, that I put in my d:\Scripts folder. Then my profile simply imports all modules from that folder.

Get-ChildItem D:\Scripts | Foreach-Object {
    Import-Module D:\Scripts/$_
}

With this in place a have a very simple, lightweight and extensible way of improving my tooling as I go. I can also use Posh-Git/Posh-Hg for version control, and if I need to get more structure at some point I will turn to PSake. In case you don't already know PSake is the Powershell version of make, rake, bake or cake. Simply put it provides a way to do build scripts with interdependent steps. So by now I am starting to feel pretty good about my tooling, and I have been able to remove a lot of clutter from my daily life.

For now my setup is very self-centered, because I use full paths to where I put stuff, but going forward it will probably be generalized and checked into version control for everyone to enjoy.

F# Type Providers and WebAPI

by dotnetnerd 4. April 2012 10:35

imagesLater this month on the 25th I will be speaking along with two other speakers about webframeworks at an ANUG meeting. The frameworks covered are ServiceStack, Nancy and WebAPI where I will cover the latter.

While I have been preparing my eye cought a new feature in F#, which I think is one of the first really good stories for F# that makes sence outside akademia and science. Type Providers give us a way to access data sources that provide its own metadata, and this fits nicely with building WebAPI services.

More...

Who am I?

My name is Christian Holm Diget, and I work as an independent consultant, in Denmark, where I write code, give advice on architecture and help with training. On the side I get to do a bit of speaking and help with miscellaneous community events.

Some of my primary focus areas are code quality, programming languages and using new technologies to provide value.

Microsoft Certified Professional Developer

Microsoft Most Valuable Professional

Month List

bedava tv izle