Updated application code

I’ve updated my shared application for download:

RomyView.zip download

Click the image for larger version…

RomyViewUI

This code includes everything I published recently, since I really use this application for most of my prototyping code.

The screenshot is shown using my dark colour theme. I think it looks the best of my three themes.

The ReOpenFile managed wrapper that I wrote about this morning is there, in Romy.Core.StreamExtensions.

The utility to change the Windows logon startup background is there with the Glass Form. (Shown.) I also worked some more on my Photoshopped monitor image (It is much improved and has a screen with 16:9 aspect ratio.), which I am also using for the program’s icons.

After commenting that I have never needed to write editors in the 2nd part of my post on playing with the PropertyGrid, I have added a couple in the solution. That’s my options dialog displayed, which allows you to select a directory path for the cache directory, using the  newer Windows common dialog (without using the Windows API Code-Pack), although I haven’t written about any of that. (I might still get around to it.) The same dialog also uses a custom UITypeEditor that shows a fully expanded  ColorDialog when you edit the colour property.

But this code is not production code and it is not bug-free, as it is always a work in progress. And BTW, if you would like the video player to be useable you need to have decent DirectShow codecs installed, such as the K-Lite Codec Pack.

I think this application is a good example of code that uses async everywhere. There’s very little synchronous code in the solution. In that regard, I have learned some lessons along the way… Like most developers I thought that asynchronous code runs faster… Just throw more threads at your problems. That is a fallacy! Asynchronous code generally runs slower than synchronous code. But compute-heavy tasks can be parallelized; and the more processor cores you have, the better it performs.

Think of synchronous code like a single sprinter in some vast wasteland. He can run super-fast, but the asynchronous code he’s up against is a zombie horde. They might move really slowly, but there’s potentially millions of them surrounding him. Who do you think is going to win?

Advertisements

About Jerome

I am a senior C# developer in Johannesburg, South Africa. I am also a recovering addict, who spent nearly eight years using methamphetamine. I write on my recovery blog about my lessons learned and sometimes give advice to others who have made similar mistakes, often from my viewpoint as an atheist, and I also write some C# programming articles on my programming blog.
This entry was posted in Programming and tagged . Bookmark the permalink.

One Response to Updated application code

  1. Kontrollfreak says:

    > Think of synchronous code like a single sprinter in some vast wasteland. He can run super-fast, but the asynchronous code he’s up against is a zombie horde. They might move really slowly, but there’s potentially millions of them surrounding him. Who do you think is going to win?

    I find it quite odd describing threads as zombies working against each other. After all, threads work towards a common goal: the execution of a program.

    Here’s another analogy:
    Think of a race track with multiple lanes. On some lanes there are obstacles that force a sprinter to switch to another lane. A single sprinter (thread) won’t have any problems here. He can switch lanes freely without worrying about running into other sprinters beside him.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s