Tuesday, March 25, 2008

Hey Dude, Nice Function Name

I'm just as guilty as the next programmer. Going through some code I wrote a few releases back in a bit of a rush and here's a nice little function:


procedure FixStuff(const Project: IProject; const FileName, CoClassName: string);

Nice!

I think I'll at least rename it to FixComStuff. Fortunately FixStuff doesn't even compete with DoThings. Too bad there wasn't a comment:

{ Don't know why this works. Don't touch it }.

Buying a Mac

Everyone seems to be looking at buying a Mac lately. Well either that or they hate em'. Even Allen Bauer picked one up. He walked into my office about a month ago with a big grin on his face and said "I did it!"

Like many of you I'm tech support for my entire family, friends, extended friends, friends of family and friends of friends. Recently many of them have been upgrading their computers. My old hand-me-downs are starting to get pretty darn old I guess. My dad, for example, just bought the low end iMac. He went back and forth between Dell and Mac more times than I can count but once his best friend showed him his iMac my dad was almost sold. I say almost because it still took a few months, many trips to the Apple store and lots of reading before he made the plunge. Now he's up late at night video chatting with friends on the other side of the globe and his only regret is that he didn't buy it sooner.

One of my Dad's biggest problems was moving to the Mac is the lack of Quicken. Sure there is a Quicken-like piece of software sold called Quicken, but it leaves much to be desired. Even QuickBooks isn't as good as the Windows version. I've been using QuickBooks and iBank for a while now and they work but they arn't that good. I think the reason there isn't better personal finance software out there (even for Windows) is because nobody does it. They all do it online (which really isn't personal finance in most cases) or they just don't balance their checkbook. Makes me wonder.

Oh, and to answer Allen's burning question as to why Macs are so entrenched in school; they aren't. In the graphics professions the reason they have standardized on the Mac platform is because the fonts are completely different on Windows and Mac and the Mac works better, and in some cases they are just used to the Mac. I realized this when the Missus did work at home on our Windows version of Illustrator and brought it to her Mac at work and had to change out each font and adjust the location for it to look right. Mac renders the display to look as it will print. Windows renders the display as it will look on the monitor. Make a long story short, they look different.

I personally like Mac at home because I work all day with Windows and when I use a computer on my personal time I don't want it to be work. Also the color profiling is awesome on the Mac and I really like the hardware.

Friday, March 21, 2008

Easter

When I found out Easter was so early I thought "isn't this an April holiday?" Then I remembered it was some crazy full moon after the equinox thing. Here's wikipedia's description of when Easter is:

"...Easter is the first Sunday after the first fourteenth day of the moon (the Paschal Full Moon) that is on or after the ecclesiastical vernal equinox."

I'd sure hate to calculate Easter programatically but here's a link to a simple Delphi function to calculate it:

http://delphi.about.com/cs/adptips2002/a/bltip0302_2.htm

The Comment You Don't Want to See

Have you ever been looking through some code trying to figure out what it does and see something like this:


{ this is a bit of a hack }

This is (one of) the most unhelpful comments a person could write. Please don't do things like this in your code. Just describe why it's a hack and describe what should be done.

Thursday, March 20, 2008

Where's Chris?

I've received some emails asking if I was still alive on the account that I haven't blogged much over the last few months. Yes, I'm still alive thank you for your concern. With it being tax season, my daughter getting 8 teeth over the last month hence no sleep, and various other events, things have just gotten rather busy. I have written up a few posts but unfortunately they can't be published until after Tiburon is released.

As you've probably noticed I haven't updated the photo of the month in a while either and that's because I haven't been doing any wildlife or nature photography lately. But you can see one of my photos in the Spring issue of Nature Photographer which is currently in stores.


Copyright © 2007 Chris Bensen. All rights reserved.


When adding this photo to this post I was just reminded of why I post my photos so small. Many people have asked for me to post them larger and the simple reason I don't post them larger is they get stolen.

Monday, March 3, 2008

CodeGear COM Contractor Needed

There is a job opening for a COM QA contractor available at CodeGear working on Delphi and C++. If you are interested contact me and I'll forward your information to the hiring manager.

Thursday, February 14, 2008

Happy Birthday Delphi



Today Delphi is a teenager. Delphi was officially launched February 14th 1995. Happy 13 Delphi!

Monday, February 4, 2008

February Photo of the Month


Copyright © 2008 Chris Bensen. All rights reserved.


This photo was taken this winter in Tahoe during a break in the last big storm we had.

Friday, February 1, 2008

CodeGear™ Software Development Tools To Be Installed on up to 1 Million PC’s in Russian School System

The press release just went out, "Russian Federal Agency of Education Standardizes on CodeGear Products for Teaching Software Programming". Here is an InfoWorld article.

Tuesday, January 29, 2008

There Will Not be a Compiler Switch for Unicode

There have been a lot of questions about a compiler switch to change what type string maps to. Just to avoid any confusion the title of this post say's it all, but here are a few more specifics. String will map to UnicodeString. If you need AnsiString you still can use it, but string will not map to AnsiString.

If you think about it a switch isn't a viable solution. If there were a switch there would be three primary ways of doing it:

1. All generated files would contain both ANSI and unicode code doubling the size of each file.

2. All source files would be compiled twice to generate ANSI and unicode versions of all generated files.

3. The string type would have a run-time switch for ANSI or unicode.

Each of these options has advantages and disadvantages but the fact is each of these options add complexity. The simplest solution is ANSI or unicode. I personally choose unicode.

Wednesday, January 23, 2008

Unicode: SizeOf(Char) and Sizeof(Byte)

New to Tiburon SizeOf(Char) will not equal Sizeof(Byte). This means that any pointer arithmetic currently being done by casting something to a PChar should be changed to use a PByte. This is a change in the language because all current versions don't allow pointer arithmetic on PByte and of course because Char will be mapped to WideChar instead of AnsiChar.

So if you are going through your code now to get it ready for unicode, I suggest adding {$IFDEF UNICODE} or something equivalent around the code that is ANSI only so you can test it and mark it to be looked at later.

I'm thinking of creating a unicode FAQ where I gather up all the unicode information into one location. Would that be useful for everyone?

Tuesday, January 22, 2008

Ads

It was brought to my attention that my recent test of placing ads between posts while my revenue increased was annoying. So I've now changed the colors. I like messing around with the ads for various reasons so please humor me. If you find them really annoying just drop my a polite email or comment. I don't mind changing them but I find it really interesting how placement can affect the revenue they generate.