Amazon.com Widgets January 2011

Book Review: Fall of Giants by Ken Follett

By Nick at January 29, 2011 11:37
Filed Under: Book Review

I haven’t done a quick review on a book for a while, but it hasn’t been because I wasn’t reading.  I’ve actually been re-reading two of my favorite books by Ken Follett, The Pillars of the Earth and World Without End .  I’m a big historical fiction guy, and historical fiction doesn’t get much better than these two.  They are excellent and educational reading – the latter begin one of the main reasons I like historical fiction.  I know more about medieval life and building cathedrals than I ever thought I would after reading these two.

But that’s not the book I’m reviewing now.  I mention them because the response of the literary community to Follett’s release of the above books was “shock and surprise”.  I guess that is because they quite different from the spy/thrillers that he had written before.  The response couldn’t have been because they didn’t think Follett had it in him, because clearly he does.

So Fall of Giants should come as no surprise.  It’s a great read and masterfully done -- exactly the kind of book I love to read – sweeping epic tales of five different families from five very different places and backgrounds that interrelate with each other as they are “swept up” in the tumultuous events in Europe before, during and after the First World War.  Along the way you see familiar events unfold – the Russian Revolution, the Battles at Marne and Somme, and something I wasn’t really aware of, the direct military support of the Russian White army after the end of the “Great War”.  The characters are richly drawn and the cross paths with real historical characters like Woodrow Wilson, Lenin, Trotsky, and David Lloyd George.  Along the way we see coal miners struggle for better working conditions, women fight for the vote, and the Russians overthrow the Tsar. 

Follett clearly has moved beyond being a “mere” suspense novelist, and I for one am very happy about that.  Fall of Giants is the first in a trilogy, with the second book covering the Depression and The Second World War, and the third dealing with the Cold War.  I for one am anxiously awaiting the next book in the series, due in 2012.

Flotsam and Jetsam #22

By Nick at January 28, 2011 04:35
Filed Under: Flotsam and Jetsam, Delphi, Tech Stuff
  • SDTimes has an interesting article about a “Delphi Starter Edition”.  It appears that the Starter version will limit the revenue of a user to $1000 in overall revenue, as well as limiting all database access.  They are going to be priced at $199.  It also seems like there can only be five of them in any given organization.  Folks in the community are discovering that the Starter Edition will be available February 1.  And now Tim Del Chiaro has confirmed it in his blog.
  • We recently changed the name of our “Inside Sales Representatives” to be “Account Relationship Managers”.   This lead to the following statement in our weekly Manager’s Meeting: “Well, that’s really in the hands of the ARMs”.  Heh Heh.
  • I want a Rovio.
  • I just realized that I have a Windows key on my keyboard and that I don’t think I’ve ever used it once. Now, I know that the key has been there for a long time, but I just now realized that I simply never press it. Maybe I should be.  Do you guys actually ever hit the Windows key?
  • Today marks the the 25th year after the Challenger explosion, and I heard them on the Radio talking about it, saying “Do you remember where you were"?”   I remember it as clear as day. I was standing in the front office at Pasadena High School, where I was a Latin and English teacher.  Our principal, Tom Hancock, came out of his office with an ashen look on his face and said “Challenger just exploded”.  It hit our area particularly hard, as Pasadena is a suburb of Houston, with a major NASA facility nearby (The famous “Houston Control”), and the astronauts had lived and trained in the area.  That moment is a very start memory for me.

Flotsam and Jetsam #21

By Nick at January 21, 2011 08:58
Filed Under: Flotsam and Jetsam, Delphi

What is the Next Layer?

By Nick at January 18, 2011 22:44
Filed Under: Delphi, Software Development, TechBiz

The software of today is really made up of a rather long series of layers, with each layer reducing the complexity and increasing the capabilities of software developers.

The first developers literally programmed in ones and zeros.  They had nothing more than that – pure binary. Heck, in the beginning, the notion of “programming” didn’t even really involve software, but rather the manipulation of hardware – actually flipping switches to physically alter the bit settings on the device. 

But soon enough, along came an assembler, which is basically a layer of abstraction over binary code.  Then Grace Murray Hopper invented the notion of a compiler, and this brought about human readable languages. (Some argue that assembly is human readable – I guess I mean “readable my mere mortals”). 

But of course, every language has to have an operating system to code against.  Once we had that idea down – that of writing a human-readable language against the operating system (OS) - we wrote Application Programming Interfaces (APIs) to make calling into the OS easier.  Instead of coding against interrupts in DOS, we had a neat, fairly easy to use thing like the Windows API. 

But naturally, we weren’t happy there.  We needed another layer!  So along came things like the VCL and MFC.  They were layers on top of the OS’s Windows API making it easier to write Windows programs.  (Of course, if MFC makes it easier, I’m not sure what word to use to describe what the VCL does for Windows programming.  Winking smile)

But that wasn’t good enough for us, now, was it.  We needed yet another layer.  So along came things like Java as a cross-platform layer, and for Windows, we now have .Net.  At its base level, .Net is another level of abstraction on top of the Windows API.

So (crudely put) we have .Net on top of the Win32 API on top of the OS on top of Assembler on top of binary code on top of physical switches.  Layer after layer. As a result, we have managed to tame the immense complexity of the computers that we have today.  Without all these layers, we’d never be able to write the software that we use today.

So the question that pops into my mind is this:  What is the layer that we are going to put over things like .Net and the VCL?

I myself have no idea, despite having thought about it quite a bit.  I’m guessing that it will be something that we haven’t even really conceived of yet – or something that only people way smarter than you and I are thinking about today.

Nevertheless, I bet you have an idea.  What is it?

1000 Tweets

By Nick at January 15, 2011 20:45
Filed Under: Delphi, General, Personal

Hard to believe that it has been 1000 tweets for me.  Here’s my first one.

1000tweets

Flotsam and Jetsam #20

By Nick at January 13, 2011 20:25
Filed Under: Delphi, Flotsam and Jetsam, Unit Testing
  • My Dad got me this clock for Christmas and I now have it hanging on my wall at the office here at the World-wide Headquarters of Gateway Ticketing.  It is definitely an eye catcher and a conversation starter.  I was able to figure out some of the numbers (12, 6, 7, 8, and 11), but the rest I had to get from a blog post that explains them all. 
  • I happy and honored to say that the Delphi Feed for my blog is now part of DelphiFeeds. Hopefully this will mean that these amazing pearls of wisdom will benefit a broader audience than just you fine people.
  • We here at Gateway are in the process of migrating to Mercurial for our source control (I’ve probably mentioned that before….) and we are considering using bitbucket.org to host our repository.  Thus, I’ve created a small Delphi project there called DelphiClean. It’s not much right now, but it is serving the purpose of letting me see how things work on BitBucket.  I will update it in the future, particularly with the ability to provide a custom list of extensions to be “cleaned”.
  • Now that Delphi has cool language features like Generics and Anonymous Methods, there is a lot of very cool code being written. Combine that with the ease of sharing code on places like GoogleCode, BitBucket, SourceForge, etc., and it ‘s a pretty cool time to be a developer.  The indefatigable Alex Ciobanu is a guy who is producing some amazing code.  Alex create the DeHL project, and now he’s created out of that a project called Collections.  Well worth a look.  The fun part is that Alex creates a full suite of unit tests for his code, so you can use it with confidence, and if you find a bug, you can write a failing unit test for him, and he can fix it, incorporate the now passing test, and we’ll all know if that bug appears again.  (There’s my daily pitch for unit testing….) In any event, Alex’s code is quite remarkable, and he’s a valuable member of the Delphi RTL team.  Here’s hoping some of this great code finds its way into the RTL.
  • Danny Magin posts about the Developer Solutions Conference.  I wish I could go – alas, duty calls – but you can. (I’m particularly interested in the Android development stuff.  Alas)  Plus, it’s in Vegas, baby!

Flotsam and Jetsam #19

By Nick at January 11, 2011 03:58
Filed Under: Flotsam and Jetsam

Even More Changes to HTMLWriter

By Nick at January 09, 2011 05:19
Filed Under: Delphi, Software Development, Unit Testing

Okay, so if you are actually using THTMLWriter, I’m sorry – but I made another pretty major change to it, one that will require you to again make changes to any existing code that you have.  Such are the perils of using pre-1.0 software I suppose.

These changes are made at the suggestion of a number of you fine people, and I’m grateful for your wisdom and for taking the time to critique my work and make such good suggestions. 

Interface Only Access

If you have an interface you want people to use, then you should provide a way for them to use it.  In fact, the really cool thing to do is to make it so that it is the only way to do it.  One iron-clad rule of interfaces is that you should never mix interfaces and instances of the classes that implement them.  The interface is the important thing, not how the interface is implemented. 

An interface is a “promise” of a specific service, and a consumer of an interface shouldn’t care about the implementation details of an interface.  Indeed, that is one of the main advantages of interfaces – that you can “switch out” what you use to actually implement the interface.  If one of you guys things my implementation sucks and want to create a new one, you can simply create a class that implements IHTMLWriter and use that instead without changing any of the code that you have using IHTMLWriter.

So What Did I Do This Time?

Okay, so here’s what I did.

  • I created three standalone functions that return a reference to the IHTMLWriter interface.  They correspond to the three constructors that are included in the THTMLWriterclass.  This is the only way to “get at” the IHTMLWriter interface. 
  • I “hid” the entire THTMLWriterclass in the implementation section of the uHTMLWriter.pas unit.  Now, you can’t even get at the class even if you wanted to.  You must deal exclusively with the interface. 
  • I put the two interfaces I created – IHTMLWriter and ILoadSave -- in their own units.  This way, they aren’t coupled together and can be used separately if desired. 
  • I put all the /// comments in the interface unit instead of on the class. 
  • I had to make changes to the tests to support the new way of grabbing an interface reference.  I made the names of the functions similar enough to the code you current have that it will just be a matter of deleting a few characters.  Of course, all the tests still pass.

What’s Left?

I have a few more things to implement – mostly support for some less common tags that go in specific places inside a <table> tag.  After I do that, I think then I’ll declare THTMLWriter to be an official 1.0 release.

Update on THTMLWriter

By Nick at January 06, 2011 03:56
Filed Under: Software Development, Delphi, Tech Stuff, Unit Testing

I’ve made a fairly significant change to THTMLWriter.  (Even if you aren’t a use of THTMLWriter, please keep reading, there’s a valuable lesson at the end.)

What Did I Do?

I created an interface – IHTMLWriter – which simply lists the public interface of the class – and then had THTMLWriter implement that interface.  Not a big deal.  The big deal is that now the Fluent Interface is done with the IHTMLWriter interface instead of the class itself.  This shouldn’t be a big deal if you are using the class – you merely need to change the variable declaration to IHTMLWriter, and remove any code that destroys/frees the class you may have created. 

Why did I do this?  Well, I have to confess that it was partly because I could.  But I also think that in general, interfaces are better to deal with, particularly with the fluent interface.  I’ve noticed that interfaces appear to be the typical way that such things are implemented.  In addition, an interface limits the scope available to the consumer of a class.  If  you can only use a class via the interface, I as the developer can decouple the implementation from the interface – something that is always good. Plus, if one of you fine people feels like there is a better way to crank out HTML, now you can do it, too, using the same interface. 

The Valuable Lesson

Here’s the part that you all need to read:  I was able to make this rather large change with a lot of confidence because I had a pretty extensive set of unit tests to back me up. 

The initial change – creating the IHTMLWriter interface and changing the class to implement and use it – broke everything.  No test would pass, and the test program did nothing but raise access violations.  So, of course, I went to work and fixed things up.  I had to change a little architecture, alter the way a few things were done, and generally fix things up. 

All of my debugging was done on the test project.  It provided a perfect, simple reproduction of the bugs.  The unit tests enabled me to easily step through simple examples and find the places where the bugs were and where things weren’t working right.  And eventually the tests all “turned green”. 

GoingGreen

And let me tell you, turning green is sweet!  First, it feels really good. I kept running the tests and watching that little green bar slide across because it felt great.  Why did it feel great?  Because I knew that my changes were complete and  because I had confidence that things were all working as they were supposed to.   The only way that was possible was because of the existence of the unit tests.  Without them, I’d never really ever be sure that things were back to normal and working.

Time Well Spent

So the unit tests allowed me to forge ahead with confidence, provided me with a useful and powerful vehicle for testing and debugging my changes, ensured that I would know when I was done, and enabled me to prove that things were working as they should – all while making a fairly substantial change to a fairly complex code library. 

And some people say they don’t have the time to write unit tests.  I say you don’t have the time not to.

The Developer Solutions Conference

By Nick at January 03, 2011 21:57
Filed Under: Delphi, Software Development, TechBiz

Hey, I want to give a shout out to the folks at RemObjects and Developer Experts and their upcoming conference focused on Delphi – the Developer Solutions Conference. It’s taking place February 8 –10 at the MGM Grand in Las Vegas. Now, I can only assume that the vast majority of you are always looking for an excuse to go to Vegas, and now you a have one. 

Sadly, I won’t be able to attend, as the conference is falling right around the time of a major release for us.  I really would like to be there.  I always love hanging around with Delphi Geeks, and so I hate missing this opportunity. 

More information:

If you are looking for a stimulating conference and even better, a reason to go to Vegas, why, you should register and go!

My Book

A Pithy Quote for You

"There are no such things as limits to growth, because there are no limits to the human capacity for intelligence, imagination, and wonder"    –  Ronald Reagan

Amazon Gift Cards

General Disclaimer

The views I express here are entirely my own and not necessarily those of any other rational person or organization.  However, I strongly recommend that you agree with pretty much everything I say because, well, I'm right.  Most of the time. Except when I'm not, in which case, you shouldn't agree with me.