Tuesday, November 26, 2013

Learning Mac: Basic Setup

Background

A few month ago, a friend just gifted me his MacBookPro.
About two years earlier he felt to need a Mac to be cool, but never managed the transition as a decades old Windows user. So he switched back to Windows. And his old MacBookPro now is mine.
Thanks Martin!

To overcome my almost exclusive Windows only experience so far, I decided to use the Mac to dive into node.js development.

This blog post is just a little scratch pad to note down some steps and findings with the basic setup of OSX. Development related stuff will come later. More might follow.

Attention: For an even moderately experienced Mac user most of the things might be trivial. But being an almost Windows-only person so far, I'm constantly finding myself struggling with absolutely basic stuff.

Phase 0 - Six Month Ago

Basic Setup

On my first weekend as a Mac owner, I tried to clean it up from everything left over from the previous owner, update the software, and setup some basic stuff.

Here's what I did (from the top of my head):
  • Created a new user account including getting an AppleId. - Interesting: It felt strange to type apple.com into a browser's address bar. :)
  • Deleted the previous owner's account
  • Got the latest version of OSX
  • Got Dropbox from the AppStore and set it up
  • Set up the pre-installed Microsoft Outlook 2011 (strange version number for a Windows-guy)

Print a Photo from my Camera

That was astonishingly hard.
A few of the challenges along that way:
  • Simply seeing a file from the inserted memory card. Constantly hitting Win+E (which is not there of course) to open a Windows Explorer. Accidentally found the automatically mounted memory card on the Desktop (is it called like this on a Mac?)
  • Installing the correct driver for my photo printer
  • Chosing photo paper instead of normal paper. I remember that I gave up on this one. The result of the print was awful.

Bottom Line

For the first day, I had the feeling that it is incredible hard to work on the Mac. I was constantly googling almost every little command. On windows, I love using keyboard shortcuts all way. And on the Mac it is all different.
I'm sure it will take quite an amount of time until I will feel productive on OSX as well. But I will strive for it and share.

Thursday, August 1, 2013

Dictionary: Indexer Setter Can Add New Item

Did you know that the following test passes instead of failing with an exception?

[TestMethod]
public void WriteAccessToNonExistingKeyAddsTheElement()
{
   var dict = new Dictionary<string, object>();
   dict["NonExistingKey"] = new object();
   Assert.AreEqual(1, dict.Count);
}

What I learned today is, that you can add an item to a dictionary by just assigning it using the indexer setter where I had expected an exception.

Does this mean, that should happily use this indexer syntax to add new elements to a dictionary?
No!

Here's my reasoning:

1. It is semantically wrong

What does a line like this say?

   dict[aKey] = aValue;

It says: Set the value for the item in the dictionary associated to the key aKey. Trying to do this for a key that has not been added to the dictionary at all, does not make sense.

Therefore I would expect an exception.

2. It is inconsistent

A read access to the indexer with a non existing key throws an exception. So it seems inconsistent to get no exception in the write case.

3. It is unexpected

Of course, letting the behaviour of the index setter being as it is, was a valid design decision. But I think it is an absolutely unexpected behaviour. There are explicit Add(...) methods in the Dictionary-class. The name of these methods are absolutely clear. They say that they do. So why not make these the only means to add an item?


Conclusion

To make your code readable, use an Add(...) overload. To change the value of an existing item in the dictionary, use the indexer setter.

Please.

Friday, November 26, 2010

TextGen v0.2 released: COM interop

Recently I released TextGen v0.2 on CodePlex.

There are two major things added to this version:

Interface for COM Clients

TextGen now provides an interface for the usage by COM clients.

Since the original public API is partially based on generics, the API exposed to COM had to provide different methods for those parts.

To get started with the API visible to COM, please refer to the Access demo file that is included in the package. Shell scripts to create and register/unregister the TypeLib are included.

Download Package

With v0.2 a zip-file with all necessary files is available. So there’s no need to compile yourself. Just use TextGen from your application.

Have fun and provide feedback!

Thursday, November 25, 2010

Podcast “Anwendungsentwicklung mit WPF” veröffentlicht

(This is a German post since it is about a podcast in German language.)

Mein Arbeitgeber TechTalk bietet unter dem Titel “On TechTalk’s Mind” eine Serie von Podcasts an.

Es freut mich, dass ich den dritten in dieser Serie veröffentlichten Podcast zum Thema “Anwendungsentwicklung mit der Windows Presentation Foundation” ankündigen darf.

In dieser Folge spreche ich mit meiner Kollegin Claudia Oster, Usability-Expertin bei TechTalk und mit meinem Kollegen Stephan Zehetner über die Auswirkungen des Einsatzes von WPF auf das Zusammenspiel zwischen Usability-Experten, Designern und Entwicklern in einem großen Softwareentwicklungs-Projekt. Wir sprechen darüber ob die mit WPF wieder einmal versprochene Trennung dieser Aspekte der Anwendungsentwicklung nun tatsächlich funktioniert.

Die Vorbereitung, Durchführung und Nachbearbeitung dieses Podcasts waren sehr spannend und haben großen Spaß gemacht. Ich habe viel Zeit und Energie hineingesteckt, aber auch sehr viel gelernt.

Die nächste Folge ist in Vorbereitung!

Workshop “Testen in Access”

(This post is in German since it is about a workshop held in German)

Nach meinen Vorträgen zum Thema “Pragmatisches Testen in Access” auf der diesjährigen AEK freut es mich auch einen Workshop zum Thema “Testen in Access” anbieten zu können.

Dieser Workshop findet am 26./27. Jänner 2011 in Hannover statt.

Themen:

  • Grobüberblick UnitTesting/TDD
  • Anwendung testbar machen
  • Was konkret testen?
  • Wie testen?
  • Wie Änderungen implementieren?
  • Features von AccUnit
  • Details und Anmeldung sind hier möglich: http://www.techtalk.at/About-us/News/Events/Workshop--Testen-in-Access.aspx