Using C# keywords as variables

Hold it, don’t shoot me. I know this would be an awful practice, but it is an interesting C# compiler quirk nonetheless. Keywords are predefined reserved identifiers that have special meanings to the compiler. They cannot be used as identifiers in your program unless they include @ as a prefix. For example, @if is a legal identifier but if is not because it is a keyword. static void Main(string[] args) { var @if = "oh my.."; Console.WriteLine(@if); } ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

April 11, 2011 · 1 min · Jef Claes

It's not how good you are, it's how good you want to be

This Christmas, my girlfriend and I got this little book called It’s not how good you are, it’s how good you want to be. This book is mainly directed to (advertisement) designers, but since I feel that designers and developers do have a few things in common, we both like to create things, I also read it. The content of this book is a collection of Paul Ardens observations on business and life presented in a very consumable format. As it turns out, although I am not part of the target audience, a good amount of his thoughts can be applied to software development as well. ...

April 10, 2011 · 1 min · Jef Claes

Video, slides and source from my WebSockets talk

Yesterday, I gave a talk on WebSockets at HTML5 WebCamps Belgium. WebSockets on Fire While the WebSockets API specification is not stable yet, various browser vendors have already implemented a prototype in their latest browser versions. Microsoft released their WebSockets prototype in December 2010. While there is no native implementation of WebSockets in IE9 just yet, for now they are providing a solution which works cross-browser, relying on a Silverlight client. Server-side a Windows Communication Foundation server is made available, which implements the latest version of the WebSockets protocol. ...

April 7, 2011 · 1 min · Jef Claes

Keeping WebSockets alive

The problem with using stateful connections on an imperfect place as the internet is that connections might drop. The server or an intermediary can drop the connection due to an idle timeout. Even a temporary problem at the server or a local network hiccup might kill your connection. If you aren’t prepared to handle these scenarios, you will not be able to fully rely on WebSockets. A simple solution The simplest solution is checking every few seconds whether the WebSocket is still opened. This might suffice in a good amount of scenarios, but a lot of other scenarios require more stable connectivity. ...

March 12, 2011 · 3 min · Jef Claes

Why I still buy real books

As a technology geek, it should be hard to keep ignoring the latest generation of eReaders (read: the Kindle). With over three million devices sold, the Kindle has proven that it adds value to people’s lives, and that it’s a lot more than just a gadget. Some of the most obvious benefits… You can carry a whole library in your backpack. The price of an eBook often is substantially less than the hardcover version. I am far from a Green, but I can’t neglect the fact that no trees need to be chopped down to print an eBook. Reading a 1000+ page book in bed or next to the pool is the opposite of convenient. ...

February 1, 2011 · 1 min · Jef Claes

Book review: The Art of Non-Conformity

The book The Art of Non-Conformity: Set Your Own Rules, Live the Life You Want, and Change the World was written by Chris Guillebeau. I learned about this book through Chris’ blog. He hosts a very popular blog where he writes on lifehacking, entrepreneurship and his goal to travel to each country in the world. In this book Chris tries to show the reader that you don’t have the live your life the way other people expect you to. As long as you are open to new ideas, are dissatisfied with the status quo and are willing to work hard, you should be able to live the life of your dreams. ...

January 22, 2011 · 2 min · Jef Claes

Book review: Got Fight?

I rarely review books with non-technical content here, but I just felt like I had to with this one. The book Got Fight? was written by Forrest Griffin, assisted by Erich Krauss. Forrest Griffin is one of the toughest light-heavyweight mixed martial artists competing in the UFC. If you are unfamiliar with MMA and UFC, I encourage you to watch one of the Forrest Griffin tribute videos on Youtube. This book touches several subjects. Forrest talks about the path he followed to become a professional fighter and what made him who he is today. Forrest also shares a bunch of advice on fighting and non-fighting topics. The last part of the book contains a series of how-to MMA techniques. All these topics are talked together in the form of hilarious, and sometimes offending (to some of you), ramblings. After all, the main goal to read this book shouldn’t be to learn, but to be entertained, and maybe learn something along the way! ...

January 15, 2011 · 3 min · Jef Claes

Book review: Pro HTML5 Programming

The Apress book Pro HTML5 Programming was written by three authors: Peter Lubbers, Brian Albers and Frank Salim. In this book the authors introduce the reader to the most popular and useful features of HTML5. The book contains 11 concise chapters: An overview of HTML5, the Canvas API, audio and video, the Geolocation API, the Communication API, the WebSocket API, Forms, the Web Workers API, the Web Storage API, Offline Web Applications and the future of HTML5. ...

January 6, 2011 · 2 min · Jef Claes

Reviewing and renewing resolutions

My career I’m still working on the same projects as I was last year: Firestation Antwerp and Ghent. This year we did not build a lot of brand new things, but we have added a decent amount of new functionalities. Next to that there were a bunch of bugs to fix and technical debt to pay off. I learned a lot from the mistakes we made and refactoring makes you really think about what good and clean code should look like. ...

December 29, 2010 · 4 min · Jef Claes

HTML5: Exception handling with the Geolocation API

In my previous post on the Geolocation API I passed in a PositionErrorCallback to the geolocation.getCurrentPosition() method. When I received this callback I displayed a generic message informing the user something went wrong. In real-world scenarios you probably want the message to be more specific. You might also want to call a specific fallback method depending on what went wrong. This is where the PositionError argument of the PositionErrorCallback comes in handy. This object has two properties: code and message. ...

December 26, 2010 · 1 min · Jef Claes