Tuesday, June 27, 2006

A buggy lesson


Two nights ago I was laying in my bed just about to fall asleep when I thought I heard a bug trying to fly in my ear. I jumped out of bed, turned the light on and couldn't find him. Finally I went back to bed after not finding the bug and just as I was approaching dreamland, I thought I heard the bug again. This happened several times during the night.

At some point, I started questioning my sanity. I thought maybe my brain was making up sounds that weren't there. Or, maybe my years of loud music had caught up with me and this was some sort of hearing damage.

(There is a coding point to this...) In the morning, I had two gigantic goose egg bites on my right arm. AHA! there was a bug.

At this point, I knew there was a bug and I had to find it. To make a long story short, two nights later and 6 bites total and I caught the bugger!

The moral of this story:
1. When writing programs never give up on a bug.
2. If you can't reproduce it or find evidence of the bug, don't let it drive you insane because it can. Take some time away from it and go back later. In time, you'll be able to isolate it.
3. Where there is one bug, there are usually two. Remember that unit testing can help but the test can only check logic that you coded for. Review your code change at another time you may spot others. (Yes, there were two mosquitos! I found one on the same wall 5 minutes later!!)

Happy Coding!!

Thursday, June 22, 2006

My Geometry Editor


I've been working on my own geometry editor now for about a year. Its written in C# vs.2005. I should be ready to push out a beta version of it in a few months. The image is one I did on the weekend.

Development has really slowed since my second son Bryce was born in February. I'm just starting to get some work done on it now. I've been working on the rotation gizmo for the last few days. I have it working pretty well now.

What I'm looking for are beta testers or hobbyists who would like to use it on a project. It will output .X files but I can create other outputs as well if needed. Please post a reply if you're interested and describe the project you would like to work on. Its okay for low poly objects but not so great for organic objects yet. It has pretty limited tools. I'll keep posting my progress as I go.

Wednesday, June 21, 2006

Table vs CSS layout for forms

Separating layout elements from your information is an essential element in web design. But when it comes to form design, sometimes its quicker to use the tables.

For example, I've done the last three web forms (10-30 fields) using CSS layout. They look good, but they took twice as long to write all the css to align the items in different patterns. What am I saving here? Were the styles reusable? Not really.

Lets face it we aren't going to be changing the entire look of our input forms. The page itself? Maybe.

Even in Eric Meyers CSS book he used tables for the input forms examples.

So in conclusion:
Styles for layout: Good.
Styles for forms: Think about designing around the table.

Jas

Docking in VS.NET 2005

I was looking for a quick way to solve a docking issue in dotnet and I stumbled across this blogsite on cranky programming.

http://crankydotnet.blogspot.com

The title is "Is anyone doing anything HARD with .NET?
I thought he was right on the money. I would say the answer is "We are NOW!"

VS.NET 2005 promised to make our life easier and that actual code is greatly reduced. But, what they don't tell you is the saved coding time is reallocated to trying to tweak their controls to do what you want. And they make it look so easy in the demos...

I've reported 3 bugs I've found already with VS.NET 2005. The above link has some more. It makes me want to jump ship to the Java camp, but that's not what pays the bills.

The items I found were:

1. ASP.NET: If you comment out a control in the html view of a web form and create a new control with the name of the old one, the compiler still picks up the commented control and lists an error. On Microsoft's website it says its designed this way.

2. ASP.NET: The Textbox control "MaxLength" property does not work if "Multiline" is set to true. Again, by design..... Yeah right.

Bug workarounds:
1. VB.NET: If your design view for a form refuses to display, showing a list of variables missing you know are in place, simply hit F7, go to anyword hit spacebar and then backspace and hit F7 to return to designer. It amazingly figures out that the missing variables DO exist.

Hope this helps someone.