Category Archives: Personal

Radical language and platform shift

I realize it’s been a really long time since I put something on this blog. And for those of you expecting more (iron)ruby posts I’m going to have to dissapoint you. This is mostly a braindump of what I’ve been working out the last months.

A few months ago Adam Burmister, who I met at  Xero, and I got incubated by O2 to do a project that allowed me to push the boundaries and it required me to look outside what I already knew.  I had to go look for a new way of approaching problems, it isn’t said that the problems couldn’t be solved with a language like C# or Ruby. The solution would have been pretty much sub-par. In this quest for the best way to approach that problem it turned out that Scala was the language that hit a sweet spot for me.

We needed something that resembled Erlang; and while I did my best to really get into Erlang I never could (this could possibly be because of the eye bleeds because the language is just so friggin’ ugly). So it turns out there is a design pattern called ActiveObject which is at the core the same as an erlang node (it’s not I know a node has many other properties).   We also needed to be able to process humongous volumes of data (Terrabytes worth) at this point Ruby is out of the picture. I’m sure I will upset many fanboys but face it ruby is slooooooooooooooow and advances slow, by the time you can properly program distributed systems in ruby the way I had in mind I’ll be a great grand dad and have a long and pointy grey beard. .Net is lacking libraries and the ruby libraries often are good enough, but good enough never is. And since I got tired of patching every single bloody library I touched I vowed to steer clear of ruby. We still use ruby but we use it for what it’s great at: system automation scripts and sometimes quick prototyping.

We basically needed hadoop, hadoop is a java project (I’ll return to why not java and C# a little bit later). So once I entered the Java domain a new world opened up for me (old for most other people I realise that). Java has what can only be described as a SHITLOAD of great quality libraries. It’s just a pithy that Java like C# suffers from what I call programmer masturbation. I’ve certainly been guilty of that and during my time at Xero they suffered the grunt of it (sorry guys). So lets return to those problems.

You read a book, nicknamed Gang of Four which then becomes “the bible”, it has this thing called design patterns and they need to be applied where ever you can.  I’ll let you in on a little secret: They do next to nothing to make your code more maintainable (quite the opposite in fact) and definitely don’t make it more understandable unless the next guy also knows “the bible”. If he doesn’t he’s a fucking retard, everybody knows those design patterns.  The thing that doesn’t jive is: how is writing more code making your code more maintainable as you have to maintain more code (did I mention more code in this sentence?)The one thing ubiquitous use of design patterns from “the bible” does do is give you some job security. Pythonista’s shun design patterns and if not you should apparently.  Having programmed in many languages I tend to agree with the conclusion that having to use crutches like design patterns (I should really make this into a factory or manager of some sort) actually means your language is flawed.

I still need to meet the person that can actually prove to me that your code is more maintainable than code that follows the following simple rules:
* Don’t Repeat Yourself
* Don’t write what you don’t need right now
* write a couple of tests
*  Generalize as if there was no tomorrow.
* Write as little and as simple code as humanly possible (this kills double dispatch and the visitor pattern)
* Remember that you (as do I) have a bird brain, you will have forgotten what you did 2 weeks ago, let alone 6 months from now, so it needs to be understandable by the biggest idiot on the planet, namely the author of the code (in my case me).

I don’t want to write a post on why I left .NET but it’s inevitable to mention it. I used to think .NET was the greatest thing since sliced bread and I still think it’s a really cool piece of technology. However there is only a small minority of .NET programmers I actually get along with so some of the remarks I’m going to make are not directed at those people. I have felt unhappy about the way .NET was evolving around the same time microsoft introduced the class designer tool. Don’t even get me started on people advocating UML because that belongs in the same classification, a vertical one. Once Oslo got introduced or is it M I wanted to get out as quickly as possible. I happen to like writing code, if I wanted to drag and drop boxes and connect them with fancy lines I would have gone for a designer career.

.NET also suffers from another problem, whatever the all-knowing company produces is innovation created by them (never mind if some of those things have been around for more than 20 years). And most developers on .NET suffer from that phenomenon that can only be called Stockholm Syndrome. It is mind boggling to me that you want to use tools you know suck, they don’t make you do a better job faster in fact once you move past the hello world example they fall apart really quickly, not to mention having to debug a problem and submitting a bug (which will then be bounced back as by design).

Enough slamming on .NET let’s return to Java. Stephen Colebourne goes the next big JVM language is Java, but this time done right??? One of his arguments is 10.000.000 programmers world wide can’t be wrong. I happen to think that 9,9 million of those programmers mostly likes to get paid, it has little or nothing to do with the fact that it’s a great or not great language.  It’s certainly easier than C and definitely C++, ask Bjarne. Most of the java code I read makes me sick to my stomach the boilerplate needed   (the next example is in C# the java one would most def be longer:  fizzbuzz enterprise edition) is atrocious. Java date arithmetic (I know about joda-time) is an absolute nightmare. The fact that you need to write at least 6 (not counting import statements and the main definition) lines of code to be able to read input from the keyboard and  print it out just amplify my point.

So no ruby, no .NET no java what’s next. There is this cool thing people keep talking about: node.js it’s crazy fast (if you compare it with languages like ruby and run the correct hello world benchmarks). however the libraries are subpar at best and generally feel like they’ve been written by very young programmers (with the odd exception of course) who have little or no clue about what’s going on outside of their blog or what their “gods” are saying. I’m sure it has a place and I’ve given it more than an honest chance but at the end of the day it would have required a big investment to write all kinds of things that just aren’t there (yet).

But you know it’s event driven and asynchronous and that’s why it’s fast and only non-blocking IO is the right way to go because using blocking IO is slow. Ok now you got me, you’re right but also wrong. It depends on your use case and how you work with blocking IO. We’ve come to go by this simple rule: if you need many short-lived connections (like in say HTTP) then non blocking io is indeed better, however long lasting connections may benefit from blocking IO, because the throughput is a lot higher (although it’s not quite as black and white as that).

So back to we want erlang but without the bleeding eyes: enter scala + akka. Boy was I happy camper when I started reading their docs. An open-source project, written in this language called scala that solves the same problems as Erlang only this language is beautiful, yes I’ll repeat that beauuuutifuuuulll. Scala gives me what ruby was never able to give me, a fast, pretty language that supports multiple paradigms with a strong nudge towards functional programming. it can be run on .NET as well as on the JVM meaning we didn’t have to forego the much needed libraries. And the libraries that are available are in a totally different league than those dinky toys node.js and ruby have to offer. It’s like comparing the majors to the minors I guess.

The downside is that we do need core i7 machines to get any decent compile times out of the thing and IDE support (while it gets better steadily) is still behind on other languages. If you’re wondering about LOC count vs ruby I think they’re about even once you know what you’re doing. Scala is not an easy language but it’s heaps of fun to work with and I’m glad I get to use it the next couple of years.  if you’re looking for an acceptable alternative on .NET that is supported by the all-knowing hugely innovative company you should look at F#.

As an aside the next time somebody mentions enterprise ready as baked in to me; they will get a rope, chair and nail it’s quicker and less painful.

There the rant is over, I feel a lot better now. I already know I’m an idiot so tell me something new.

A new year… some changes

With 2009 starting, started actually, it might be time to look ahead at what’s to come this year.

I hope your holidays were better than mine with my grandfather dying on Christmas eve, I wasn’t in much of a celebratory mood this year.

After having tried being a consultant for a while I have a serious hang-over from enterprise style of development. At least the dev style that only listens to what microsoft has to say and swears by their judgment under the motto: “You don’t get fired for buying Microsoft”. As if it wasn’t bad enough all the CRUD went through stored procs over linq-2-sql. When somebody there told me to copy/paste instead of taking a little bit more care I made up my mind and left the place. This leaves me at the start of this year without a project/job, and as it looks now it might not be the best position to be in with the crisis and all.

Another area that I desperately need to make some progress in is the IronRuby in Action book. So far I have 4 chapters completed and the one on Rails is about half-way there. Because I’m not making as much progress as I initially thought. This partly because I decided to turn my life upside down this year.
Now that I’ve finally found a good place to live and my personal life isn’t as messy as it used to be I’ve returned to writing.

More news on the IronRuby in Action front is that I’ve got a co-author now. His name is Michael Letterle and he has contributed to the IronRuby project.  Michael is very passionate about Ruby development and is currently working on the Silverlight chapter of the IronRuby in Action book.

As part of the Chapter on Rails I’ve built a twitter clone. In the wpf chapter I created a twitter client and to be ensure things continue to work both offline as online it seemed like a good idea to me to create the server side too.  The last couple of days I’ve been implementing this limited version and you can find it at http://codeplex.com/mocktwitter. Finishing this application is on my to-do list for this year for now it does a little bit more than it needs to for the samples from the WPF chapter to work.

More on the IronRuby subject. I’ve also created a DBI layer for ADO.NET that you can use in conjection with IronRuby to talk to ADO.NET data sources. I don’t know yet if I will base my activerecord adapters on this DBI layer or just with the providers immediately. I put a post up on how to get started and where to get the sources etc on rubydoes.net

I intend to spend some time on agdlr as well as on ironnails as well because ironnails has been a lot of fun to develop.

Back to contracting

Yesterday I gave notice at Xero, my last day will be mid February (15/02).

It’s been fun working with the team of people at Xero, but I just want my own time back. I won’t go into more detail around the reasons for my leaving Xero but we part ways on friendly terms.

I’ve been getting more and more into Ruby again and I really like that language. So I’m mostly interested in jobs that will allow me to use those dynamic languages. I can now take some time off to finish the book I’m writing and to do some coding on a couple of things I have in mind.

Ideal places for me to work would be a place that practices Agile development et al. I’ll be going back to contracting probably unless somebody makes me a really great offer :)

Rejoining the pack

The last year I’ve dabbled a lot with linux, ruby etc. Investigating alternative means of developing web applications.  I have switched back to vista ultimate x64 now because I spend about 95% of my time developing on windows so it didn’t make sense to run linux as a base system.  Both ubuntu with Beryl or vista are just as slow/fast on my computer the admin time for my windows system is a lot shorter than the one for my ubuntu system.

I’m not taking a hard line against webforms any more, I still think I won’t be using them in complex projects but for quick prototyping the dynamic datacontrols are pretty cool. Which won’t stop me from building my own mvc style architecture because the current defacto standard is suffering from code bloat and a too tight integration of javascript frameworks etc.

This weekend I’ve finally started playing around with c# 3.0 and silverlight and I liked what I saw a lot. 

I’m getting my head around the new technolgies by building a little texas holdem multiplayer game.  So the technologies this project will use are: .net 3.5 with c# 3.0, silverlight 1.1 (with xaml), WCF.

I started building that texas holdem poker game because I couldn’t find a nice one that I could install on my LAN or one that wouldn’t require me to get a mortgage if I would lose a game online.

The microsoft one that comes with vista ultimate is nice and i aim to beat it by making it multiplayer.

The most challenging bit of this poker game is definitely the AI for the computer players because I don’t want them to be idiots but also not the best players in the world seen as i’m not the world’s greatest poker player (I’m still working for a living :) ). If somebody that reads this blog has done some similar work or knows of some resources for me to work through some of that stuff please share them.

So far I’ve got the following logic going:

Evaluating wheter it’s a good hand or a bad hand: simulate about 1000 games with the same hand,same cards on the table and the same number of players.

That gives me an idea of how good the hand is and if it should fold.  Next I want to figure out whether the player should bet, check or raise this is done by looking at the odds and the maximum score I could reach as well as how far along we are in the game.. I have more in my head but not enoughtime to write it all down. I’ll write more on this subject in the course of the next few weeks.

I’m planning on making the multiplayer version open sourced for demo purposes but not the one that contains the AI for the computer players.

 

del.icio.us tags: , , ,

I’ve been tagged and I hid so well :)

Darryl has tagged me

The idea of the tagging bit is that I don’t talk about programming but find a couple of things you don’t really know about me.

So here we go.

1) I used to be into playing volleyball and soccer (goalie) when i was a lot younger.. and I used to be in a band playing the bass. I obviously wasn’t very good in the musical side otherwise i wouldn’t be a programmer :)

2) I’m not married nor do I have a relationship at the current time. Not that I’m not interested the last couple relationships just didn’t work out.

3) I didn’t go to university, but i did start college. I think degrees are highly overrated. Passion, ambition and drive all together is much more important in my book.]

4) I wasn’t always a programmer. I’ve been a bartender/waiter in a studentbar in Antwerp. I’ve sold timesharing in Spain as an OPC and a sales rep. And in between i’ve been a junior system engineer for SGS Belgium.

5) When I was at school, I was the one with the big mouth, making jokes all the time and really walking the line of what can and can’t be done without getting into too much trouble. I didn’t get picked on really but also didn’t do much of the picking that goes against my  nature.

So these are my five things i wanted to share today. I guess now it’s my time to tag somebody :

I’m tagging Alex James – One of the smartest people I know

Another person to tag is Miel Van Opstal we started out together and he is one of my oldest friends.  Miel is workig for Microsoft as an evangelist.

Another Belgian to tag is Raoul Jacobs he knows sql server inside out as well as access

Moving to Wellington

A while ago i posted that I was hiring somebody.

Well first of all ==> It’s not easy to find somebody

Secondly this might have been jumping the gun a bit because in light of some recent developments I’ve decided to move my whole operation to Welington aka “Silicon Welly”.Probably I’ll have to look into hiring somebody again around may-june next year.

So the goal is to be up and running in Wellington on the 1st of march. 

I won’t be boring you with all the reasons why I think Wellington is a better place to be than New Plymouth for a technology company. But one of the main ones would be that cows don’t really need websites or UI’s.

I hope I’ll find myself a proper place to settle. I’m looking for a reasonably small house (not shed or likewise) with a garden, preferrably one that will hold it’s ground and not slide of the mountain when it rains.

Looking forward to moving there :)