Archive for May 2010


The Apple Insider Myth

May 12th, 2010 — 08:44 am

A co-worker just walked up on me and told me the great success story of his new Apple product: The Apple Mybook NAS.

Probably you are now wondering like I did. Let me re-tell you the story. It went like this:

“Yesterday I bought the the Mybook NAS (*cough* Mybook? Why didn’t I get the memo from Apple, I thought I read the news..). It’s such a great product! It worked out of the box, no strings attached – and even using Windows (note: which is of course the only OS he uses)! I even use the built-in backup mechanism – there was only a little trouble, because I wanted to use it on my second computer as well, but it didn’t ship with a second licence. But Apple is quite nice, after my complaint they sent me another key right away (*cough* Licence keys for Timemachine instances?..). However, my new Apple Mybook NAS works so great, I now consider becoming part of the family and buy myself a Mac. Of course I will install Windows XP, because I consider that to be the better OS.”

This is how the story went. If you wonder what the new Apple Mybook NAS looks like, I took the liberty of asking him for a picture. Enjoy(;

The new Apple Mybook NAS
The new Apple Mybook NAS

    If you liked the article, follow me on twitter here
twitter_preek

2 comments » | personal

C# 4.0’s dynamicity

May 10th, 2010 — 10:23 pm

I just found an article ranking highly on Hacker News (my favourite read) concerning the release of C# 4.0 – you can find it on blogs.msdn.com. On this blog Microsoft claims a couple of highly sophistacated new features. Being the spoiled guy I am, they just seem natural to me. Since they started their article with the words “The dynamic keyword is a key feature of this release.”, let me demonstrate the new features in a really dynamically typed language where they have been around for quite some time: Python

Dynamic

C#

 
                        dynamic contact = new ExpandoObject();
                        contact.Name = "Patrick Hines";
                        contact.Phone = "206-555-0144";
                        

Python

 
                        class contact: None
                        contact.Name = "Patrick Hines"
                        contact.Phone = "206-555-0144"
                        

Optional (or Default) Parameters

C#

 
                        public static void SomeMethod(int optional = 0) { }
                        SomeMethod(); // 0 is used in the method.
                        SomeMethod(10);
                        

Python

 
                        def some_method(optional = 0): pass

                        some_method()
                        some_method(10)
                        

Named Arguments

C#

 
                        var sample = new List<String>();
                        sample.InsertRange(collection: new List<String>(), index: 0);
                        sample.InsertRange(index: 0, collection: new List<String>());
                        

Python

 
                        def foo(bar, foobar): None

                        foo(bar='asdf', foobar=12)
                        foo(foobar=12, bar='asdf')
                        

I honestly know that a comparison of a statically typed language on the CLR and an interpreted dynamic language doesn’t account for too much. But since Microsoft is making a fuzz about dynamic being the keyword of the new release, I felt the urge to drop this note.

The Python code was tested with v2.5 – that’s the oldest installation I’ve got. However, it’s old enough, because .NET didn’t even have decent IPC back then (i.e. Named pipes were added in .NET 3.5).

Well, that’s my rant for the night – I’m going back to teaching myself a real programmers language(Clojure) – as you should, too(;


    If you liked the article, follow me on twitter here
twitter_preek

2 comments » | articles