Archive for the ‘Microsoft’ Category

Think Better

17th December 2008

I suspect many of you will remember Apple’s adverts a few years back, with the tagline Think Different.

Think Different

Think Different

Not think better.  Not think world-changing.  Think different.

What does “different” mean from the point of view of a user or developer?  Different file formats.  Different systems.  Things that don’t interact.  A hundred different bugs in every application.  Just ask a web developer what they think about different browser implementations.

Developers get faced with choices between different systems all the time.  Why should I use system A instead of system B?  Does system A do something that system B doesn’t do, and do I care about that something?  If so, then this is an excellent reason to use system A.  Perhaps system A does the same thing as system B in every regard that matters to me, but does it better.  This is still a good reason to use system A, providing I haven’t already invested heavily in system B.

But “different” isn’t better automatically.  From the point of view of a commercial entity, “different” is generally worse by default.  “Different” costs money.  Is it worth it?  You have to justify that, justify why different is better in this case.

In light of this, I have a question for you, the contributing community of KDE.  What makes KDE better?  What makes it world-changing?

Doing something revolutionary

Let’s make this a bit more specific.  Most immediately I’m interested in what KDE has to offer the software industry at large.  What is KDE pioneering that would make a company that has historically based it’s business model on web applications built on Microsoft technology, but is now branching into open source because it’s not afraid to follow interesting trends, sit up and pay attention?  Consider a target audience of someone who thinks the time of the WIMP interface is over, but that the iPhone is a testament to the ingenuity of graphical designers and not software engineers (and software engineering is what we’re interested in here).  Consider the trend towards service-based computing.  Consider Google’s dominance.

Think about seamless integration of mobile devices, of reading something at your computer, then having to rush off and getting it onto your iPhone/eeePC/PDA/portable toaster with almost no interaction required.  Think of the problem of sifting through the cruft of the intarwebs (cat captions and all) to find that useful nugget of information.  Think of how your life revolves around trust networks (who do you ask for advice?), but how poor computers are at duplicating that.  In short, think of the unsolved problems in computing.

Is the semantic desktop (cf Nepomuk) a bold leap into the future of computing?  If so, how?

Is JOLIE integration into the desktop layer where it’s at?  Why?

Will Plasma revolutionise the way we interact with small form-factor devices?

What problems are KDE solving that haven’t been solved before?

Remember, we’re thinking here about why people who’ve never heard of KDE and see Linux as a server OS should be interested in what we’re doing.  We’re thinking about why budding young developers who don’t care about the GNU software libre philosophy but just want to work on an exciting, intellectually challenging and world-changing project might jump at the chance to get involved with KDE.

Doing something better

Secondly, why should people (again, who don’t care about the KDE desktop) use our development framework?  What makes us better?

Perhaps Eigen is the matrix library to end all matrix libraries?

What can Akonadi offer the world beyond the kdepim module?

How will Plasma make the hoards adore your application?

In what way are KComponents the light side to COM and CORBA’s dark side?

Why should you embed Marble into your application?

How is KDE solving the problems that developers care about in a better way than they have been solved before?

Final words

I’m fully convinced that KDE is awesome.  I care about software freedoms, and KDE is free.  I care about frameworks and APIs, and Qt/KDE beats the competition easily in that regard.  But I want to be able to evangelise KDE to other developers who don’t care about these things, and I don’t have the knowledge to do so.

Post your responses in the comments, or put them straight down on my Techbase page.  I will try to collate everything there.

Managed Environments and ASP.NET

4th September 2008

I started a new job on Monday.  This job involves working with ASP.NET and C#.  Actually, I could choose to use VB, but that way lies madness.

I’m not going to comment on my work or what I do, other than to say that I really like the people and the ethos of the company.  But ASP.NET and C# are technologies that are worth commenting on.

There are many good things to be said about both technologies.  ASP.NET does pretty well at the separation of code and design: you create a pseudo-html (actually a superset of XHTML) file to describe the page, including elements that can be manipulated programmatically such as an <asp:Button> tag, and then write a separate file for the code that does the magic.  Creating forms and reading input from them is a doddle.  As is doing different things depending on which button was pressed, or doing magic when a control is changed.  The backend code is object-orientated, and comes with such useful features as events (essentially a signal/slot mechanism).

In short, PHP eat your heart out.

Of course, it’s not all that straightforward.  PHP wins hands down on text processing.  The overhead of ASP.NET is not to be sniffed at.  And writing something very simple can be a faff, because you have to do it “the right way”.

So, that’s ASP.NET.  How about C#?  In particular, how does it compare to C++?

Well, it removes some of C++’s annoying quirks.  C++ has many of these.  A complete lack of consistency about whether definitions end with a semicolon or not is one, and another is the “explicit” keyword which you almost always want.  Exceptions come as standard, as does reflection (although it doesn’t seem as easy as Java’s reflection system).  Useful features like the foreach construct are welcome, as are the “out” and “ref” parameter keywords (thank you, Pascal).

And, of course, C# is a managed environment, with everything that entails.  Garbage collection.  Having to try really hard to get invalid pointers or references.  Unpredictable desctructors.

Wait.  What was that last one?

Well, say you’re working with a file.  Or a database connection.  Or any other such resource that requires tearing down in some way.  In C, you had to do it manually.  In C++, we did away with that with the advent of destructors.  Create your file object on the stack, then let it go out of focus.  Desctructor gets called, file gets closed, hey presto.

Not so with managed environments like C#.  There is no concept of a stack.  Everything is on the heap.  If you create a file object, it stays around until no-one references it any more, and then (and this is the important bit) at some unspecified later time the garbage collector eats it.  Notice the unspecified bit.  If you depend on the destructor, you don’t know when your file will get closed, and therefore when you’ll be able to open it again.  So you’re back to doing it manually.

There’s really no getting around this.  If variable scope guarantees destruction, you can’t do things like returning objects from functions.  And managed environments are supposed to get you away from petty things like keeping track of memory.  C#’s solution is to introduce a using keyword (well, an overload, since it’s already used like C++’s using keyword) which gives a fixed scope to such objects.  At the end of that scope, the resources they reference are cleaned up (but the now-useless object will hang around until some time after it’s not referenced any more).

That’s one of the irritating quirks of C#.  Another is restrictions on the switch() statement, where you can’t execute some code before falling through to the next case statement.  The reasoning is obvious – many a subtle bug has arisen by people doing this unintentionally.  But it’s annoying when you do intend it.

These are just the issues I’ve found in four days, mind.  No doubt I’ll have other gripes later.  Lack of determinism is one of my pet peeves, though.  That’s the mathematician in me, I guess.

One of these days I must get around to learning ADA.  I suspect I’ll like that.


Get every new post delivered to your Inbox.