Sunday, December 30, 2007

Solution Wide Error Analysis - Someone is reading my blog

I blogged about ReSharpers 'Solution Wide Error Analysis' before. Unfortunately the feature was not released in the 3.0 release of ReSharper. But now it's here in the 3.1 release:
ResharperSolutionWide2.png
JetBrains announces the feature on their .NET-Blog.

And here it comes: There, at the bottom of their announcement, they reference my blog! I feel honored ...

Thursday, December 20, 2007

Yet another Addiction

Long ago, I realized that I am an addict. But recently I had a look at my browser and discovered yet another addiction!image

How many times is Google present? I make daily usage of iGoogle, Gmail, Google Calendar, Google Reader, Picasa, Blogger ... at least del.icio.us seems not to be infiltrated yet ...

Recently I seem to notice an increasing popularity of Google Code. More and more projects seem to choose it as host. Guice, Moq, FEST, testngroove, jpboodhoo ... just to name a few.

I exactly remember the first time somebody told me to use Google, and I was like "Gugl? Huh?". This was less than 10 years ago.

Should I be concerned?

Tuesday, December 18, 2007

Information Theory: Nonsense Bandwith

image Do you think you know how much nonsense can be transmitted with a given amount of words?
Well, have a look at this. But be prepared to revise the theories you learned...

Monday, December 17, 2007

PostSharp

PostSharp

Mantra of POSTSHARP:

Make Sense

not Code!

 

Fallacy of Code Generation

LawAndOrder

Why is code generation bad?

Because once you start with code gen, people seem to forget that generated code should fall under all the laws & rules of code anywhere.

-Ayende

This quote is from an interesting thread on Ayendes blog. As usual Ayende is quite provocative by imposing that Microsoft applied the "We'll just code-gen our way out of here!"-Tactic in Linq to SQL.

Friday, December 14, 2007

iRack

About Side-Effects

image

 

Models are forever...

...data is a happy side-effect.

- David Laribee

This quote is from a VERY cool and visually polished presentation about Domain Driven Design. Even if it doesn't provide much technical content, the eye-candy is really great...

Wednesday, December 12, 2007

Alter Ego

image It is always funny to search the web with your own name.
There is definitely some strange attraction in the thought of discovering your alter ego, your private Tyler Durden.

I am quite content with my hits:
My CV on top... ok,
... Patrick will be proud to have his appearance ...
... then some references from groups and schools ...
... well, the badminton-ranking I am really not proud of ...
... then a movie ...
... then ... wait ... a movie? ...
...
OUCH!!!!!!

[I have absolutely nothing to do with this. This is too political incorrect even for my taste, even though not too political incorrect to link it here]

Friday, November 23, 2007

War in Heaven

I blogged about my religion before. As I stated there Christian Bauer, the author of Java Persistence with Hibernate, ranks high on my personal divinity-scale.

But there are other deities on my IT-Olympus. Near the top, towering Zeus-like above all others, is Eric Evans, the Author of Domain Driven Design. A recent divine manifestation of his presence can be found here.

For years I was living in peace and piety, looking up to my IT-Olympus in awe.

But the time in harmony has abruptly ended now! My religious foundation was put into question! The pillars of my existence began to shake!

Mercy upon our troubled souls: One deity has risen to challenge another! 

With a provoking strike the harmony of my IT-Olympus was deliberately demolished:

Repository Pattern vs. Transparent Persistence

[Check out the comments, the war has been enflamed among the minions ... Lo and behold, the paradise is lost!]

Tuesday, November 20, 2007

Rules and Professionalism

image Just quote-rumination:

There is no universal rule.  Programmers need to think, communicate, and learn.  That's part of being professional.

- Kent Beck, Implementation Patterns

Monday, October 29, 2007

Reading List

I have to do military service for the next 3 weeks. This is going to be senseless and boring, boring, boring ... My plan to keep my mental sanity is to read as much as possible. This is the list of books I am going to tackle:
07D5D147-F220-4F3D-8F6B-4EB2399AB59D.jpg Kiss me Judas
by Will Christopher Baer
6E2A08C7-A570-4B50-A837-6BB67D976DA3.jpg Clown Girl
by Monica Drake
About a Boy
by Nick Hornby
0B0929A6-0678-4CE1-B7A5-9D6864B1BA64.jpg Java EE 5 Architekturen
by Adam Bien
I am curious how far I will get ...

Sunday, October 28, 2007

Listen to the developers

Astro_svhr.jpg In this presentation Dan North (pioneer of BDD) makes an interesting observation:
How do you know when Domain Driven Design succeeded?

When you listen to a conversation between two developers, and you can't tell if they are discussing the code or the business problem.

A year ago I would not have thought this as a particular accurate observation. At this time I was working in a project, where we had quite a good Ubiquitous Language.
But now I have experience in working in a project, where the developers (including me) often cannot connect their current implementation-steps to the underlying business-reasons. In this project the "implementation-language" is very far away from any business-language. So the above statement seems to bring the value and goal of Domain Driven Design very much to the point.

Is Programming healthy?

Funny picture. Seen in this presentation.
008 tan_lines.png

Monday, October 15, 2007

Introducing ADD

After TDD, BDD and DDD I am promoting a new style of development: Assumption Driven Development (ADD)

Here is an example how I practice this style in my current project:

image

BTW: The code was already there, I only added the comments ...

image

And to be honest, ADD is only the first stage of my plan to revolutionize software development from the ground up. My real goal is to bring awe, humility and worship back into our daily developer lives. The ultimate stage in my ingenious master-plan is PDD: Prayer Driven Development!

Tuesday, October 9, 2007

Language Wars

Keys.png

This is funny!

Don't miss the comments...

Code Generation vs. Code Synthesis

In one of the latest DNR-Interviews Venkat Subramanium makes an interesting statement:

I think code-generation is so 20th century! What you want is code-synthesis.

With code-synthesis a method is actually generated in memory on the fly, it is never created on the disk for you to mess with.

With code generation, the minute you generate the code, its like an itch in the back. You want to modify it, you want to scratch it a little bit and then it turns into a sore after a while.

-Venkat Subramanium, DNR 277 [36min 30s]

 

I think the distinction between code-generation and code-synthesis is very fluent. The C# compiler is basically just a code-generator (it generates IL-code). ASP.Net is also a code generator that generates IL from ASPX-pages (and code-behind).

image In the case of ASP.Net I personally would also talk about code-synthesis, because the generation process is almost completely hidden from the developer and also happens (almost) at run-time and not at compile-time.

This is in contrast to classical code-generation that is promoted by MDA or tools like CodeSmith and MyGeneration ...

Traditional static languages lend themselves to code-generation. Code-synthesis on the fly is a rather complicated endeavor (who does really understand how ASP.Net works under the hood?).

Modern dynamic languages like Ruby or Groovy are much better qualified for code-synthesis. Since they are interpreted, there is a much more powerful runtime to begin with. Furthermore they offer powerful metaprogramming capabilities. This makes dynamic runtime-behavior much more feasible, which in turn is the base for creating DSLs or code-synthesis.

Just to exemplify the consequences of the differences between code-generation and code-synthesis:

Look at the following ActiveRecord model:

 class Firm < ActiveRecord::Base
   has_many   :clients
   has_one    :account
   belongs_to :conglomorate
 end

And now think about all the lines code that get generated, if you want to realize the same model with a strongly typed DataSet...

Monday, October 8, 2007

Motivation and Productivity

imageAccording to this story in 20min, 87% of all employees feel that they are not performing at their best in their current job.

Currently I am one of them!

I think I am stating the obvious, when I say that performance is highly coupled to motivation.

Comparing my current to my last job, I can totally confirm the listed points that are key-enablers for motivation:

  • Acknowledgment
  • Transparent information policy
  • Superiors that live their engagement and can carry it over to their employees (Peter, you are the Archetype in my book [being bold, since you refuse to read blogs] )

In my opinion another point is as important if not more important:

  • The personal impression to be able to make a difference

Salary is not a enabler for motivation, even though it can be a preventer.

Since I am currently looking for a new job, my big challenge is to find a way to ensure the above points. Because I remember that it feels good to perform at my best!

Sunday, October 7, 2007

Oops, I did it again!

image I just ordered a MacBook Pro!

After using a black MacBook for several months now, I decided to try and switch completely (bye bye ThinkPad).

Probably this is just a desperate attempt to be as cool as the real gang members (1, 2, 3, 4 ...)

So why do I need a MacBook Pro when I already have a MacBook? The Answer is Screen! For my work-laptop I do need more screen real estate than the 13'' of the MacBook offers. Also the non-glossy and LED backlit (its bright, real bright...) is a plus.

Does it mean I abandon Windows? No, I will run Windows in a Virtual Machine (either VMware Fusion or Parallels). I played around with Visual Studio 2008 in Parallels, and I did not experience any problems. There are some benchmarks here, that confirm this impression.

Saturday, October 6, 2007

Switching Blogging to Mac?

B9DBCF7C-16C2-4397-AC37-C9CDB5DE22AB.jpg This is my first post with Mars Edit from my MacBook.

I am not that exited about the mac-options I have found for blogging...
I have looked at Mars Edit, at ecto and TextMate but none of them has convinced me ... None of them is near as comfortable as Windows Live Writer (which is free by the way!)

Wednesday, October 3, 2007

Great ORM Quote


image

From the SQLAlchemy Home Page:

SQL databases behave less and less like object collections the more size and performance start to matter; object collections behave less and less like tables and rows the more abstraction starts to matter.

Thursday, September 6, 2007

Computer-Science: Adventures await you!

image

Hmm... why do I get the feeling of being in a bad hacker-movie? Probably I should start looking for the TCP-Button now!

Wednesday, September 5, 2007

Mind the context!

image

Architecture? Sure Architecture! Ok...

I am curious what I get suggested after buying a "King Kong"-DVD. Maybe this?

Thursday, August 16, 2007

Ruby vs. Java: Request for an adult version!

Question: Whats the average age of a ruby programmer?

It would be much more interesting, if both of them would be over 18 and one of them would be a girl… so they could actualy record the “Conception of JRuby” … but you would have to pay for that kind of content!

Tuesday, August 14, 2007

Know Your Language: Try-Catch-Fun in C#

I am currently going through several interview-processes. During the last technical interview I realized, that my knowledge of my favorite programming languages is not as profound as I would like it to be. I always dismissed this shortcoming with the excuse, that such "low-level stuff" was not my primary concern. But now I remembered a quote from my German teacher:

Those without sophisticated vocabulary will stay unredeemed!

- Markus Lüdin

Thinking about the truth of this, I set out to learn to express myself: My first stop was the try-catch-playground in C#-world.

In the sandbox a toddler had built the following:

try{
  return true;
}
finally{
  return false;
}
image

I stopped and began to stare ... schizophrenia started to fill my head ... but fortunately my buddy, the C#-Compiler, stepped in and rebuked the toddler: This was not allowed!

But the toddler was not so easily intimidated: He dug and sculpted with his little hands, and as I stayed and watched, schizophrenia slowly crept back into my head:

try
{
  throw new ArgumentException("First Ex!");
}
finally
{
  throw new ApplicationException("Second Ex!");
}
image A inexplicable urge came over me, and I started to build fervently my own constructs in the sand around those of the toddler:
[Test]
public void First_Exception_Is_Lost()
{
  SchizophreniaTrap trap = new SchizophreniaTrap();
  try{
      trap.TryFinallyException();
  }
  catch(ArgumentException ex){
      Debug.WriteLine("Caught First Ex");
      Assert.Fail("Ha! Things dont just disappear!");
  }
  catch(ApplicationException ex){
      Debug.WriteLine("Caught Second");
  }
}
image Oh no! The test passed! I started to scream! The first exception was lost! It had to be there somewhere in the sand! I started digging...

Saturday, August 11, 2007

Insights from reading the bible

The Mythical Man Month is the Bible of Software Engineering, everybody reads it but nobody does anything about it!

- Frederick P. Brooks

image

 

A project becomes a year late one day at a time.


Plan to throw one away.

Software is like waffles: Throw away the first.

image
image
Extrapolation of times for the hundred-yard dash shows that a man can run a mile in under three minutes.


Add little to little and there will be a big pile.
image
image
There is nothing in this world constant but inconstancy.

The only constancy is change itself.

Wednesday, August 8, 2007

Workshop: Object Relational Mapping

image I am going to give a workshop about Object Relational Mapping at the Workshop-Days of the Swiss Open Systems User Group.

The workshop will take place at the ETH Zurich, on the morning of September 12.

This is going to be a basic workshop that aims do give an overview and an introduction to the topic of object relational mapping.

I am going to talk a lot about patterns and techniques. I am going to illustrate this theoretical background with concrete examples realized in Java Hibernate and Ruby Active Record, since those are two very popular, yet different ORM-implementations.

The following workshop in the afternoon is going to be all about Hibernate. The lecturer will be Christian Bauer himself (one of the two Hibernate-Gods and author of Java Persistence with Hibernate). I am a bit nervous about that... I mean to set the stage for a god is quite a responsibility ;-)

image As a lecturer I will be allowed to attend other workshops for free. Of course this chance for knowledge-sucking comes close to my notion of paradise!

I plan to attend Rund um den Software-Architekten, Hibernate (awe and worship) and Introduction to JBoss Seam (some more awe and worship).

But there is still a lot of work to do until then...

Monday, August 6, 2007

Join Tables and Domain Models: The LINQ-Way

I blogged about Join Tables and Domain Models before, where I showed different ways to deal with 'association-entities' in Ruby and C# 2.0.

Now in C# 3.0, LINQ offers another interesting way to express a domain model.

Assume the following object model:

ClassDiagram1

Article has associated Users through the 'association-entities' Readings. Now LINQ allows us to express this association in another elegant way:

private readonly List<Reading> readings = new List<Reading>();
public IEnumerable<User> Readers {
   get {
       return from reading in readings
                  select reading.User;
       }
}

When I think about LINQ its mostly in the context of querying data, which is usually a common task in the data access layer. There LINQ allows us to specify what part of a domain model should be loaded.
But the above example shows us, that LINQ can be used in other scenarios, even in expressing our domain model itself.

Sunday, August 5, 2007

Resharper: to the next level!

image Hello, my name is Jonas and I am an addict! I am hooked for several years now. I have not written a single line of code without being on Resharper!
If I am put in front of a clean Visual Studio, I am getting nervous: My hands begin to shake, sweat appears on my forehead and I feel the distinct urge to download at least a trial version of Resharper...
I admit it: I am an addict!
image
When Visual Studio 2005 came out, I had a very hard time: JetBrains took a long time until they released a version of Resharper for Visual Studio 2005.
Remembering those times I was getting anxious again lately, because Visual Studio 2008 is on our doorsteps...
But I was pleased that this time JetBrains seems to take pity on all those junkies like me out there: There is already a pre-release of Resharper for Visual Studio 2008 available through the Early Access Program.
Resharper and Visual Studio 2008 seem to work fine, until you start to use the new features of C# 3.0. The following code-snippets compile and run ... but Resharper seems not to be happy.
image
image
I hope Resharper will learn C# 3.0 soon.
As a side note:  Mark Miller boasts on his blog that Refactor! Pro (the concurrence product for Resharper from DevExpress) already supports C# 3.0 and even offers special refactorings for the new language features. You can watch this in action in this video (hmm... I was somehow reminded of the beauty and the beast).

Tuesday, July 31, 2007

To Ruby or not to Be?

image The fuss around Ruby and Ruby on Rails is bigger than ever!

But it seems that the backlash is now arriving. Are we approaching what Gartner calls "Trough of Disillusionment"?

On one hand everybody wants to jump on the bandwagon:

On the other hand, there are more and more people voicing their rather critical opinion towards the ruby-hype. Here are two interesting articles I stumbled across lately:

I personally cannot claim, that I have yet fully grasped the implications and consequences of Ruby and dynamic languages in general. I think that Ruby and especially Ruby on Rails brings some fresh air to the 'dusty old' enterprise development, and therefore has a certain pedagogical effect. The biggest value I see there, is the adamant adherence of good design principles like DRY and Convention over Configuration. Another point of value is that successful Ruby projects teach us, that 'lightweight enterprise development' is feasible in reality. But those points are basically language independent. So the insights we gain from the whole ruby-hype can be applied to other environments.

image

I don't think Ruby is a silver bullet for enterprise development in general. But when you wholeheartedly embrace it, it could well become your personal silver bullet...

Monday, July 30, 2007

Embracing Change?

It's not the strongest of the species that survives, nor the most intelligent... but those most responsive to change.

- Charles Darwin

Could it be that someone is doing their homework, and evolution theory is the topic of the next exam?
Well, the result could be promising:

http://www.microsoft.com/opensource/

Tuesday, July 24, 2007

Next in Line, Please!

Historically, there have been more Microsoft ways to access the Northwind database than there are rows in the Customer table.
- David Ing

image 

(from a funny blog post against the hype of C# 3.0 and Linq/DLinq)

Monday, July 23, 2007

Protected? Sure?

image Call me stupid, but I only recently realized, that the access-level 'protected' has a different meaning in Java than in C#.

 

Java:

image

Visibility of the members of Alpha:

Modifier Alpha Beta AlphaSub Gamma
public Y Y Y Y
protected Y Y Y N
no modifier* Y Y N N
private Y N N N

(* also called package private)

C#:

image

Visibility of the members of Alpha:

Modifier Alpha Beta AlphaSub Gamma
public Y Y Y Y
protected internal Y Y Y N
internal Y Y N N
protected Y N Y N
private * Y N N N

(* private is the default access-level for members if nothing is specified)

Thursday, July 19, 2007

Reality Check

image From the ASP.NET Scalability Panel (DNR 246):

Do not underestimate the value of physical reality!

- Kent Alstad (1h 08min 53sec)

Wednesday, July 18, 2007

Return of Friendship

moz-screenshot-11[2][1][1][1]In the good old days, friendship was a meaningful construct.

On lone evenings, I like to look back to the long gone era of C++, long before the decadence of virtual machines and the sloth of garbage collection. 

Back in those days I could declare someone as a friend and this meant trust. Absolute, boundless trust. Even though this intimate relationship was not necessarily bi-directional (I was not necessarily the friend of my friends...sigh!) 

I know, its hard to grasp the full meaning and consequences of friendship for the insubordinate youths of today's Java- and C#-Sharp generation (and even more for their self-indulgent Ruby- and Phyton-offspring).

For a long time I had looked at the world of today with great despair, but recently a spark of new hope has found its way into my heart: Friendship has returned with the .NET Framework 2.0 and seeks its way into the troubled lives of the young generations.

Of course today's new friendship is not the same as in the old days: The friendship between assemblies its much more coarse than the delicate friendship between classes used to be. But hey, it's a beginning, don't call me a grumpy old man!

Here we have a modern declaration of friendship:

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Test")]

namespace Friends {

    public class PublicFriend {
        internal string InternalMethod() {
            return "I am Internal!";
        }
    }
    
    internal class InternalFriend {
        public string PublicMethod() {
            return "I am Internal!";
        }
    }
}

And here we have an example of how to enjoy the pleasures of this friendship:

    [TestFixture]
    public class Test {
        [Test]
        public void instantiate_internal_friend_should_work() {
            InternalFriend myFriend = new InternalFriend();
            Assert.IsNotNull(myFriend);
            string test = myFriend.PublicMethod();
            Assert.IsTrue(test.Length > 0);
        }

        [Test]
        public void calling_internal_method_should_work() {
            PublicFriend myFriend = new PublicFriend();
            string test = myFriend.InternalMethod();
            Assert.IsTrue(test.Length > 0);
        }
    }

Rejoice and praise the lords high up in Redmond for the mercy they show for our blunted souls!

Related Posts Plugin for WordPress, Blogger...