woensdag 22 mei 2013

Be a Pragmatist, not an Evangelist.



A couple of weeks ago, during a code retreat, I was pairing up to start a new coding session.  As I wanted to write the first test, my partner said that I should avoid the word ‘should’ in my test names.  I kindly nodded my head but the first thought that crossed my mind was: here we go again.  As it appears, the word ‘should’ implies that my test might do something without any certainty that it will do something… Granted, it’s not wrong what I was told, still I was wondering: how much time and sometimes even money are developers wasting participating in these kind of ├╝ber developer sensei discussions?

Don’t get me wrong, I find discussions about code intriguing and I love learning from my fellow developers.  But… aren’t we sometimes pushing these kind of discussions into the ridicules? An industry as infantile as ours (not necessarily by age) should be worrying about larger problems.

It seems kind of trivial that this gets me going, but just think about how many times developers are wasting time and are overengineering their code because of silly discussions like these. 

For example, take the one assert per test rule.  How many evangelistic developers have I seen taking this rule to the extreme.  Testing a simple 1 on 1 mapper property by property.  And for what reason?  Because there is a golden rule that tells you that you must do this or you're not writing clean code?  Why not be more pragmatic? In many cases you have a beautiful set of testing tools! Use them to send messages to your test runner.  Extend your tools to make life easier.

Extremism can be a good thing to! Take Robert C. Martin, he’s one of my favorite speakers and is my favorite writer.  Yet, he is the Osama Bin Laden of clean code.  I can’t imagine anyone taking it more to the extreme than him.  In his case, good! We need magnets like these pulling developers away from the dark side of procedural spaghetti code.  Just as long as these developers still have a mind of their own, and know that the only golden rule is that there isn’t a golden rule.

Strive for Perfection, Settle for Excellence.

zaterdag 5 januari 2013

Writing code on the Windows RT


So I've got this Surface RT thing sitting on my coffee table and I don't know what to do with it.  The first thought that crosses a developer's mind is: can I write some code on this?  At the moment of writing there are is no IDE or compiler available for Windows RT.
So this is going to be a bit harder than I thought.  I don't have enough free time (not to mention intelligence), to start writing my own compiler so let's forgo languages that need to be compiled to either intermediate language or machine language.  So scripting it is then.  Powershell is an option, but then I'd have to come up with some kind of way to start unit testing this stuff.  Do I want to write scripts in powershell beyond automation?  I want to write code that can be written in a TDD fashion and be represented in a fancy way.

Then it struck me, I already know how to do this... html and javascript.  Next thing I did was set up a small javascript and html project with Qunit and the html5 canvas.   This turned out to work pretty well.  The only pain I felt then was the lack of a descent enough IDE beyond notepad.  I searched the store and bought a texteditor with syntaxhighlighting.  There are some bugs that need to be ironed out but it suits my needs pretty well. 

Now I just snap my browser on the left side of my screen to use it as testrunner and on the right side of the screen I can code.  Just refresh the left side to watch your tests run.



So If the surface RT is your only device at the moment and you want to write some code, then I encourage you to download this startup project, a syntax highlighting texteditor and start coding!

Have fun!


maandag 26 november 2012

Surface RT in a developer's life



I've had the pleasure to play around with the surface rt now for a couple of weeks.  It’s a well build, good looking piece of technology, though the I haven’t been using it much.  Why?  Well simply put, it doesn’t have a direct purpose in my everyday life.  The main reasons I use my PC is: for browsing the internet, watching youtube and the most important part… developing applications, whether it is professional or just for fun.  

So the surface is great for browsing and watching youtube, no?  Yes, but when do I have the need to use the tablet when my laptop is near me and I hardly ever turn it off. When I'm in the couch and I whish to quickly search something online, I'm better off just getting my lazy ass of the couch then I am trying to browse using the onscreen keyboard of the surface, it just isn't as practical.
So you could argue that when you're on the move it can be a handy device.  Sure for people who commute by train or plane allot, this can be a very practical tool.  Yet, I'm sitting in a car for over 2 hours a day and I hardly use the public transit anymore.  Also the surface isn't equipped with 3G.  Do I really want to drain my Lumia's battery, tethering all the time, when I can just as easily browse the web on my phone?

A reason I resent to travel with the surface is that I'm barely able to write code on the damn thing!  When I was on the plane from Chicago to Amsterdam, I had to resort to writing script in powershell.  It is possible to do a bit of coding in javascript, for which I have another blogpost in queue, but it is pretty cumbersome to do so.

That being said, I'm not saying the surface (or any other tablet for that matter) is a useless device.  It can be the only device you need... when you're not a developer.  For the average consumer this can be an awesome device.  It browses smoothly, the integrated kickstand is awesome and the touch cover works great (let's face, typing on glass sucks).  I have a very hard time believing people who say the learning curve is hard.  It took me 5 minutes to teach the mother of my girlfriend all the gestures she needed to know to be able to use the tablet.  Bear in mind, this is a woman that uses a PC for less than an hour or so every week!  If you can't remember swipe up, down, left and right, then I'm sorry to tell you this, but no device will be good for you (including fisher-price laptops).

Untill next post ;-)

woensdag 31 oktober 2012

Breakfast and Keynote delight at build


The first day of build ended yesterday and it was great.

After a great breakfast provided by Microsoft, which was allot better than what our hotel has to offer, we got in line for the keynote.  The tent in which the keynote was hosted was impressive.  Jordan Rudess gave us a musical show on his musical windows 8 app.

Next Ballmer entered and demoed a whole range of windows 8 devices. He did a pretty good job entertaining us and I’ve never seen hem perform like this.  Then off course the big announcement came and after teasing us with the 100gb of skydrive storage (which is also great) he announced that we would get a surface RT.  Good move as it would force developers to start writing the apps they miss on the RT version of windows 8.

Windows Phone 8 was extensively shown after and as a last guest Richard Kerris of Nokia came on stage and told us we would receive the newest Lumia 920!  The crowd was ecstatic after that and the mood was set for everyone at build. 

I’m off to breakfast now and the second keynote.  It’s kind of a mystery what they’ll announce there, but I’m guessing it will be azure, office and xbox.

Till next post!

dinsdag 30 oktober 2012

Build 2012



Yesterday a colleague of mine and I went to the registration of the Microsoft Build conference.  When we arrived after driving fifteen minutes on the Microsoft Campus we finally found building 92 for the registration.  The waiting line was pretty long, but after an hour we got inside and received our badge and ‘goodiebag’. The goodiebag was pretty empty, besides a shirt and an MSDN magazine.  Guess whatever goodies Microsoft will hand out, they will do it at one of the two keynotes, Tuesday or Wednesday. We also got a discount coupon so we could buy stuff in the Microsoft employee store.

Then we got to a demo room with all kinds of Windows 8 tablets and PCs.  I finally got to lay my hands on the surface, and it feels like on sturdy, well build, good looking device.  The mechanical satisfaction of clapping out the kick stand is phenomenal and the way the keyboard clicks into the tablet is flawless. 


I’ve got to get myself ready now so I won’t be late for breakfast.
Keep tuned for more Build ramblings! ;-)