Posts
2
Comments
2
Trackbacks
0
Thursday, November 05, 2009
tblNote to self

The code snippet:

   1:  var notes = from tblNote in notedb.tblNotes
   2:              where tblNote.tblUser.UserId == 1
   3:              select tblNote;

would likely look better:

   1:  var notes = from Note in notedb.Notes 
   2:              where Note.User.UserId == 1 
   3:              select Note;

Moral of the story: setup your entities carefully when generating from a database.  Also, don’t name the model the same thing you would like to name one of the tables (in this example Note). 

Hungarian notation is considered bad form in .NET API code.  So avoid using it for any public properties or members.

I prefer to use a system prefix, so in practice my tables look like:

SecurityUsers
SecurityActions
SecurityPermissions

or

tblSecurityUsers

in the case of the afore mentioned Hungarian Notation shop.

A few references for when and where to use Hungarian.

Online Guidelines
Guidelines Book

I like the book because it gives a lot more background information regarding why decisions were made and how they evolved since .NET 1.0, essential recounting mistakes that were made.

In a final whimsical aside about this, there is a relatively new practice within .NET 3.5 for the team to use the prefix “Is” in front of boolean types.  I know it’s more readable than “bl” or “bool” or true type hints, but how is it any different.  It still throws off intellisense and steps back towards Hungarian for the same reason: To quickly locate all properties of a given type.

 

 

 

Disclaimer: I have been working at a place that uses Hungarian notation in their database.  Hungarian notation in a production database is a questionable activity itself.  Interestingly I cut my teeth in C, and Hungarian was a very common practice due to the lack of out-of-the-box intellisense in IDEs used by any self respecting C programmer at the time, such as vi or emacs.

posted @ Thursday, November 05, 2009 8:40 AM | Feedback (1)
Monday, November 02, 2009
My New Blog!
 

I'm adding yet another new blog to the tremendous masses of unread content on the net. 

First, a little about me, I'm a developer in the Memphis area with a passion for technology, particularly of the software variety.  I'm fascinated with the interesting ways we can encode our thoughts, desires, and responsibility into a discrete series of 0s and 1s.  This carefully crafted symphony of digital information carries value, human interest, and a tremendous potential for power.

I started developing later that some others, at the age of 14 I began hacking at the backend of video-games (usually implementing cheats) and writing webpages back when GeoCities (RIP) was the pinnacle of web prowess.  At that point I decided to go into computer science in college, but it wasn't really a decision, more of a continuation of a hobby.

I was lucky enough to have a couple years of paid development under my belt by the time I left college and was able to land a nice job programming in C++/MFC as well as managing a few student programmers.  We had a lot of success and won 2 extensions to our contracted project.  At that point I decided to get a Master's of Science in computer science.

The tertiary education is really what fundamentally changed my approach to my job, and put me in the mindset of both a professional and eternal student.  There is no man that knows enough about anything, and its part of the responsibility of a professional to seek a way to excel against any challenge by seeking and implementing creative solutions.  Being exposed to an extreme breadth of technology, techniques, and ways of thinking is one of the assets I have been lucky enough to attain.

Finally in my professional career as a fully .NET developer I have a lot of fun with Microsoft.  They invest a lot of time and money into developing the skills of programmers without us having to invest a dime, with free webcasts, tutorials, and support of a massive user community. 

I have developed thousands of lines of code both in and before .NET in WinForms, WebForms, to a lesser extent System.Windows (WPF), and more than my share of libraries/APIs.

Well that's it; my blog is born.... now I need a clever name.

posted @ Monday, November 02, 2009 8:05 PM | Feedback (1)