Posts

Null vs. Void

Image
I'm moving some duplicate code from a codebehind file to a class file so I can reuse it. I'm tired and it's a bit late for my best programming so I'm trying to remember is the c# return type also null now. Or maybe no return type needs to be specified if a variable isn't returned (is that vb?). If null works in SQL and it works an an object value to compare against in c#, why can't null be a valid return type instead of void . What does void really say under the covers that is so different from null . Isn't void a carryover from c and c++. Perhaps it's older than that. Why do I need to remember yet another keyword that has no value. No, that's not a pun. I have too many numbers and words in my head that have to be pulled out at a moment's notice. Why add one more? Get rid of void. Just rip it right out.

Exception Handling for NetTiers

Image
I'm still cleaning up code. One of the things that has never worked in NetTiers is the Microsoft Enterprise Library Exception Handling. I would get an exception thrown in the NetTiers code and the line was an exception with no data. I would get the error on a SQL insert via the NetTiers layers but no information about what was wrong with the data. Since I'm using the Insert where the param is the base type such as    userService.Insert(newUser); I knew that datatyping from a C#/.Net perspective wasn't the problem. I knew it was at a SQL level but I didn't know what it could be. So I finally had to fix the .NetTiers ExceptionHandling. I'm not sure why doesn't work right off the bat like the rest of NetTiers but I also didn't care enough to investigate. Once I get the ExceptionHandling working, I don't ever touch so I haven't had to REALLY understand it. But now it has to work, it's hard to move forward without inserting data on this particular ...

Get the mop out: code cleanup

Image
Now that I have 90% of the v1 features for my pet project web site decided, and have a bullet-proof process for new tables, custom procs and other stuff NetTiers handles, I'm cleaning up the code. I'm ripping out any code I wrote to go against the SQL server that NetTiers handles for me. I'm cleaning up all gridview and codebehind to be consistent with naming and usage. I'm removing files that were tests to see how I wanted something to work. I'm removing links and cleaning up the masters. Wayne suggested I change a feature from random choice to numeric order choice so that a progression was predectible. I've been fighting it but he finally gave me a business logic reason. Ok, so now I'm changing SQL table column data types. That dominos into all sorts of changes. Once all this gets back to working, I'll start on the visual design. I haven't written themes and skins so I'm going to try to grab a working set that is close to my overall design. I...

New Code to AJAX

Image
My pet project is a new website. I'm working on the search page which searches through several NetTiers Services in the Component layer. It took me a few hours to figure out exactly what I wanted to do here. Do I user an Object Data Source? User StringBuilder to return an HTML table? What should the gridview link to once the search has been performed? Then I thought, I know I'm just going to AJAX this code. Am I just wasting my time? I just want to get v1 out the door. AJAX can wait to v2 but then I think none of this code would be used via AJAX except the NetTiers stuff. Do you design new websites via AJAX right off the bat? I haven't done enough AJAX to be able to think AJAX as a first pass on the design.

So You Want Your Own Business Website (SYWYOW): Comparing apples to apples

Image
Wayne and I are remodeling our kitchen. In the process, we are shopping for cabinets. We want quality cabinets in the look that goes with our craftsman home. The high-end price is twice as much as the next quote down in dollar value. While we aren't comparing apples to apples, we are trying to. I keep comparing our kitchen remodel and new-construction backporch to a web site. I know nothing about cabinets and most web site clients know nothing about quality web sites. One of the cabinet salesman said the cabinets were guaranteed for life. No software manufacturer would ever say that. Some pointed questions reveled that only certain things were guaranteed. What should a non-technical client expect from your final product? They won't ask all the questions you know they should. So lets work on some quality questions: 1) What error detection, communication, and recovery is provided? No one expects it to break so they won't ask this unless they have been burne...

Codaholic by night

Image
If you have a full-time job programming, you might do something else in your spare time. However, I don't have that situation. I get my fill from 7pm to 10pm at night due to my current situation. I left a non-programming meeting last night and rushed home to start up VS and keep going on my project. I was thrilled to still have a couple of hours left before I had to stop. Then hubby starts watching HULU.com . Arghh! We sit next to each other in our office so this was not as conducive to programming as say...a jackhammer might be. Tonight I'm in the other room while he hulu's on.

NetTiers Find method

Image
NetTiers will build methods for normal CRUD as well as anything they can determine. For example, if you have a table with 1PK and 2FKs, the template with build a method for select where the IN params are the two FKs. Great! I probably need that. But things get a little weird when I need to search. For example, I have a user's table and I want to be able to return results for all users that are like a searchterm. How about all user's like Dina. In T-SQL, I usually would have a where clause " UserName like '%@UserName%'. Works for me. NetTiers has a Find method for each table. When creating a find proc, it's hard to determine which columns you would want to search through. NetTiers discovery does a bit of assuming that the first column (after the PK/FK columns) is THE main data column (such as a name). But that takes some forethought in terms of table creation. The NetTiers find method comes in two varieties: one with sql params in the NetTiers format and one wi...