The amazing adventures of Doug Hughes

Archive for April, 2005

Revisiting PbD

Not to brag, but yesterday I was happy to hear that I was the fourth highest ranked speaker at the Powered by Detroit conference with a total score of 3.82 out of 5. The three who beat me out: Ben Forta, Greg Rewis, and Angela Buraglia. Given the caliber of those speakers and that two of the three we the keynote speakers, I take that as a very big compliment. I regret having missed Angela’s presentation.

I’ve had a couple requests for me to post my presentation on my blog. I just got the green light from Cornel Ivanescu (the organizer of Powered by Detroit) to do so. As a result, you can download the presentation now.

The presentation really focuses on the nuts and bolts of writing CFCs. I cover all the basics as well as some practical advice on writing CFCs. I do not cover very much OOP or design patterns or any of the traditionally scary stuff.

As a note, if you’re going to give this particular presentation then you will want to know that it really disserves about two hours. I tried to crop it down to 1 hour and it was still 2 hours long. There’s a set of ColdFusion example files and a PowerPoint file. The speaker’s notes in the PowerPoint guide you though which examples to show.

And, as a reminder, I’ve gone solo. If you or your company need or want onsite training for virtually any ColdFusion topic please drop me a line. I’m happy to help.

Remember, Structs are Passed By Reference, Not By Value!

This morning I ran into an amusing “bug”. I had an array of structures. Any time I altered one of the structure in the array, ALL of the structures in the array were being updated. Arrgh!

Luckily, it didn’t take me too terribly long to figure out the problem. I’ll show you the culprit now:

<cfset myArray = ArrayNew(1) />
<cfset ArraySet(myArray, 1, 10, StructNew()) />

Now, you may be asking yourself, “What’s wrong with that?” That’s a great question!! (If you’re not asking it then I assume you see the problem. Give yourself a cookie!)

The problem is that structures are passed by reference. The ArraySet method is setting each of the elements, 1 though 10, not to a new structure, but the Structure created when you execute the StructNew().

In other words, ColdFusion evaluates the values of each of the arguments being passed into ArraySet before ArraySet is called. That means your structure is created beforehand too. Thus, when ArraySet is called, because StructNew() returns a struct, a reference to the newly created structure is passed in. ArraySet then loops from through the indexes you specified and sets the value of each of them to the reference to the structure. Now, any time you change anything in any structure in the array every reference reflects the change.

This is not a bug in ColdFusion. ColdFusion is doing exactly what I told it to. My solution to the problem is either to loop over the array myself and create a structure on each iteration or to use a simple value is the initial value in the array and create a structure when it’s needed.

Keep On Movin' On

On Monday April 18th I submitted my resignation to my current employer. My wife and I decided it was time to venture out into the vast and uncharted oceans of self employment.

This is not actually my first time being self employed. I’ve been in business with Alagad since 1996. Through out most of college I was self employed and did quite well for my self.

Upon graduating from college it seemed more economically beneficial to work for someone else and I took the first job I was offered. Since then, I’ve spent many years working for other people. Though I always yearned to again be self employed, my time as a traditional employee was incalculably valuable. I can not begin to summarize the lessons I’ve learned.

The wonderful thing about loving what you do is that work becomes more than just a job. For me it became a passion and (to the annoyance of my wife) a hobby. Because of this passion for what I do, I spent more than 6 years working early mornings, nights and weekends. I’ve always maintained at least a few side jobs though Alagad and spent time developing products such as the Alagad Image Component.

Over the past half year I’ve become increasingly disenchanted with my current employer. As I began exploring other employers I ran into a seemingly insurmountable problem: The companies I wanted to work for required me to sign over all intellectual property I conceived of or created while employed by them. In a nutshell, they wanted me to give up Alagad. There were three problems with this:

  1. My salary combined with my income from Alagad was a more than any of the employers wanted to pay. From my perspective, they wanted me to pay (in terms of lost income) for the privilege of working for them.
  2. Giving up Alagad would be like giving up my child. I don’t have the capability to do that at the moment.
  3. I believe that some of my ideas are worth millions, maybe more. I can’t simply give up all that value for a false sense of security.

So, after much deliberation and consideration, my wife and I agreed that it was time to step out on my own and take Alagad to the next level.

Over the next year I will be attempting to grow the contracting side of Alagad with contracts of all sizes. I will also develop additional products and services for a range of markets. Lastly, I may occasionally run on-site training for companies of all sizes.

If you or anyone you know are in need of some top notch (but affordable) contracting services please feel free to contact me.

Also, if you have any suggestions for products or services I would be very interested in hearing about them. If I take them to market I’ll provide it to you free of charge for life!

And so, here goes nothing

PBD Peanut Butter and Detroit?

I’ve been working feverously, as of late, to get everything in order for my impending trip to Major Metropolitan Detroit where I will be presenting on ColdFusion Components at the Powered by Detroit conference. Subsequent to the conference, I will be vacationing and visiting familial relations in mid Michigan.

The Powered by Detroit conference has been partitioned into three tracks, Foundations, Design and Server-Side. My presentation, "CFC Crash Course – An Introduction to CF Components," is first one Saturday morning (at 9am!) on the Server-Side track. The PBD website has the following description of my presentation:

CFC Crash Course is a headfirst dive into the world of ColdFusion Components. The course covers a wide range of information on CFCs starting from what a CFC is to how to write and use one. Also covered are some best practices, tips and practical information for working with CFCs.

This is my first time presenting at a conference like this and I’m really quite excited! I have spoken at a few ColdFusion and Macromedia User Groups, but never anything of this caliber. I’m hoping that despite its 9am schedule, there’s a good turn out . Maybe there will even be hecklers! (But don’t get any ideas!)

If you happen to sit in on it, please be sure to ask questions. There’s nothing quite as unnerving as standing in front of a completely silent room! (Do they really get it all?!)

Beyond me blathering about CFCs, there will be a number of recognizable names in the ColdFusion and Flash communities wandering around. Out of fear of offending anyone, and out of the desire not to list all the names, I’m simply going to refer you to the speakers page on the Powered By Detroit website. Let it suffice to say that there will be a high concentration of very smart and talented people. (Let’s hope the conference isn’t hit by a meteorite or the whole Internet will be set back a few months!)

Lastly, I’m burning about 50 to 75 CDs of the Alagad Image Component and will be handing them out to participants. If you want to get your very own (demo) copy, track me down and I’ll hook you up. I’ll have a laptop with me and will give demonstrations and answer questions if requested.

Lastly lastly, an associate of mine has asked me to see if I can find a highly tallented web developer with lots of experience with Dreamweaver, Contribute and ColdFusion who doesn’t mind being paid lots of money to work from home. If this is you, track me down!

If you’ve not yet bought your tickets you’d better get moving! You’ve only got a few days left! Go register now!

Tag Cloud