Amazon.com Widgets Nick Hodges | A man's got to know his limitations

Flotsam and Jetsam #23

By Nick at February 01, 2011 17:15
Filed Under: Delphi, Flotsam and Jetsam
  • Do you have TestComplete skills?  Do you know someone who has TestComplete skills? If so, we want to hire you. (Well, we don't necessarily want to hire you if you merely know someone with TestComplete skills, but you get the idea.  Money mouth)
  • StackOverflow Question of the Week:  What are the pros and cons of using interfaces in Delphi? Lot’s of good discussion and some nice answers.
  • THTMLWriter Update: I have finished and checked changes to fully support the <table> tag and its subordinate tags, including ensuring that they aren’t used out of order.  I have but three tags left (<dd>, <dl>, <dt>), and then I think I will be “done” in that I’ll declare it to be a “1.0” release.  At that point I’ll “freeze” the interface and won’t make any more changes to it.  Any subsequent additions will require a new interface at that point.  Your feedback gratefully accepted.  In addition, the IHTMLWriter interface now descends from ILoadSave to remove the duplication.
  • I hereby officially declare Hodges’ Law: “The first person in an argument to compare the software development process to building automobiles loses that argument.”
  • Danny Thorpe pointed me to this interesting article talking about using existing Wi-Fi connections to expand the coverage of a given network.  I’ve often wondered about this – that is, why don’t cell networks make it easy for people to expand their networks?  I’d be willing to bet that if you go to the mall, the Sprint Store (or the Verizon store, or the AT&T Store or the T-Mobile store) all have some sort of repeater or other type of device that ensure that their store has a five-bar signal.  (Who would buy a phone at the store where there is a weak phone signal?)   Why not put those all over the place?  Why not install them in office buildings, malls, airports, etc., where people are? Why not sell them (give them) to people to install in their homes?  Or why not make the phone able to call over any given WiFi network, allowing the phone to work even where there is no cell tower at all?  It seems to me that this is an unexplored and unexploited feature for cell network providers, and something that could drastically increase the already high value of a cell phone. Heck, I’d be willing to share some of my bandwidth with my neighbors to increase and improve the coverage in my neighborhood.
  • Another great argument about why unit-testing is so cool and powerful from Uncle Bob.

Book Review: Fall of Giants by Ken Follett

By Nick at January 29, 2011 20: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 13: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 17:58
Filed Under: Flotsam and Jetsam, Delphi

What is the Next Layer?

By Nick at January 19, 2011 07: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 16, 2011 05: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 14, 2011 05: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 12:58
Filed Under: Flotsam and Jetsam

Even More Changes to HTMLWriter

By Nick at January 09, 2011 14: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 12: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 04, 2011 06: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!

Flotsam and Jetsam #18

By Nick at December 30, 2010 11:30
Filed Under: Flotsam and Jetsam
  • Cool Thing Done with Delphi of the Week:  Now this is the kind of thing where Delphi can really shine – connecting to hardware.  I’m sure some of you got an XBox 360 Kinect controller for Christmas, and if so, you can now write a Delphi app to use it.  Simon Stuart (aka LaKraven) continued his string of writing Delphi interfaces to interesting things (he started with TTwitter, or maybe even something before that that I don’t know about!)  by writing TKinect, a component to connect to, well, a Kinect controller.  Smile  And then the folks at the IT Security Lab made some really cool demos.  The 3D stuff is particularly cool. Definitely worth a look, just for the coolness factor. 
  • As a general rule, I find most everything Seth Godin says to be interesting, but I thought that this post was particularly interesting.  Made me thing “Grow where you are planted”. And it made me think that your job doesn’t have to be that which it is “supposed” to be.  For instance, being a waiter might seem mundane, but you can make it an opportunity to learn how to delight people, as Godin deftly points out. 
  • Great list -- 29 tech phrases you should be punched in the face for using.  And just for the record, I only type “LOL” when I actually do LOL.  Winking smile  (And while we are at it, here’s another great list.)
  • I ran across an interesting coding technique called “Spartan Programming”.  I agree with much, but not all, of the tenants.  I’m definitely in favor of limiting scope as much as possible, creating small interfaces, limiting horizontal and vertical complexity, and minimizing coupling,  But I can’t say I’m a fan of limiting the size of variable names or limiting character count in general.  In that area, I think it pays to be clear and verbose.  I do agree, though, that routines should be short and sweet.  In any event, interesting ideas.
  • Cool Delphi Code of the Week:  TKBDynamic in the kblib project on GoogleCode.  This is a small but really useful library that lets you easily write records to streams, even if the records have relatively complex structures.  Pretty cool – and it isn’t even yet taking advantage of the new RTTI.

Using Your BitTorrent Powers for Good, not Evil

By Nick at December 27, 2010 21:10
Filed Under: Tech Stuff

I’m a big fan of the BitTorrent Protocol.  It’s an amazingly simple yet clever protocol for easily and efficiently moving bits around on the internet.  By grabbing small chunks of a given file from multiple peer computers anywhere in the world, it can quickly and efficiently move files from one place to another. 

Sadly, BitTorrent has a bad reputation, as it is commonly used to move pirated software, music, movies, and TV shows around in violation of any number of copyright laws.  But the fact that it is used for nefarious purposes doesn’t make BitTorrent itself evil or illegal, anymore than cars are illegal for being used as bank robbery getaway vehicles.  It’s a shame that many companies and other organizations feel that they can’t avail themselves of BitTorrent because of its bad reputation.

In fact, there are plenty of legitimate uses for BitTorrent.  Many companies do use it to distribute their software.  For instance, Ubuntu provides torrents for their Linux distributions.  It’s a nice way to make large files available to customers fast and free – there’s no bandwidth limit or any fee associated with BitTorrent.  But be advised of one thing – once a torrent is out in the wild, there is no getting it back. It is totally roaming free out on the Interwebs.

Below is a screenshot of my µTorrent client, showing the torrents that I’m serving up from a server at my house.  Those Ubuntu files are quite popular, and because there are so many “seeders” (that is, other people making the file available for downloading), I was able  to download many of those files at rates over 2MB per second meaning I was downloading 650MB files in a matter of minutes.

Torrent

In addition to the Ubuntu files, I also went to ClearBits.net and downloaded a number of legal, free-and-clear torrents. I leave my client running 24 hours a day, and gladly give up some of my upstream bandwidth to support the good folks at Ubuntu and the furthering of the distribution of fine literature via completely legal torrents.  I like to think of it as a small contribution back to the community and doing my part to contribute to the legal side of BitTorrent.

So if you haven’t checked out BitTorrent, give it a look.  There are plenty of legitimate uses for it out there, and there’s no reason you can’t be using it  to distribute your software -- and maybe even providing a bit of bandwidth to the world. 

This Wild Year of 2010

By Nick at December 26, 2010 13:28
Filed Under: General, Personal

This year of 2010 ended up pretty dang good, considering I got fired from my job about half way through it.   For that, I am very thankful.  I’m really quite happy in my new job, my new house, and  my new state.  Things are going well all around. This wasn’t something I fully expected, and so it is an especially nice place to find myself.

In addition, many of you sent words of encouragement and support throughout the year, and for that I’m grateful. 

So all in all, 2010 was a pretty good year. Here’s hoping that 2011 is an even better year for all of us.

Flotsam and Jetsam #17

By Nick at December 15, 2010 17:24
Filed Under: Flotsam and Jetsam, Delphi

My Book

A Pithy Quote for You

"Golf is a game of luck. The more I practice, the luckier I get."    –  Ben Hogan

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.

Month List