Oct

26

Reasons to Choose .NET 3.5 Over 2.0

Posted by Sara

I think most of you know that since moving back to the states, I’ve primarily been developing with ASP.NET 2.0 and only use PHP outside of work. I wish we could use .NET 3.5, but I work on Department of State projects and 3.5 hasn’t been approved for use yet so I’m stuck with 2.0 for now. In a couple of weeks though, I will be switching jobs and working on projects for the USDA (Dept. of Agriculture).

My team will be redeveloping an existing application that uses a combination of Coldfusion and Cobol and we will get to use .NET. We had a conference call on Thursday with the new team (they are in Kansas). They use Visual Studio 2008 TFS, but thought they were going to go with 2.0 instead of 3.5. I asked if there was anyway we could go with 3.5 instead since we will be starting from the ground-up and they said the decision was almost made to go with 2.0, but we could put a list of reasons to choose 3.5 together and they would present it to the decision making folks.

So, that night I rolled up my sleeves and got to researching and writing. I read a lot of .net blogs so I knew the basics of what made 3.5 so great, but really wanted to provide some good examples. I think I compiled a halfway decent list and a few blogs in particular really helped explain the benefits such as Mark’s C# Shortcuts and Scott Guthrie’s Summary on Visual Studio 2008 and .NET 3.5.

I do not know if this argument was persuasive yet and may not know for another couple of weeks. I am posting this so in case someone else needs to convince their boss or client to choose 3.5, this might prove helpful. If you know of any other reasons as well, I would love to hear them. This is written from the viewpoint of someone who doesn’t have any experience with the 3.5 framework. Thanks to my friends (Ben, Nancy, Doug, and Jenn) for helping review this and adding their own thoughts to it!

Introduction

Microsoft .Net 3.5 was released almost a year ago (November 19, 2007) and has been out long enough for any kinks in the system to have been worked out. While the 3.5 Framework was built on top of 2.0, it has some great features which make it easier to develop applications as well as facilitating a better end-user experience. Some of the enhancements to the 3.5 framework are:

  • Support for LINQ
  • New Data Controls
  • Cleaner Coding via Language Improvements
  • Built-in ASP.NET AJAX support

LINQ

One of the enhancements we are most excited about is LINQ, which stands for Language Integrated Query. LINQ allows developers to build a query dynamically not only on databases, but also on objects and XML. We prefer to use stored procedures in our development and LINQ can also be used with the procedures.

LINQ to SQL

LINQ to SQL is an Object Relational Mapping implementation which allows developers to easily model a relational database and execute queries (to include inserts and updates). LINQ makes it very easy to query the database. Below is an example which shows how easily you can pull data from the database:

Easy way to Query Data using LINQ
//Create data context for LINQ
DataContext db = new DataContext(connectionString);
Table customers = db.GetTable();
//Query database
var custs = from c in customers select c;

LINQ to Dataset

In ASP.NET 2.0, neither the DataTable nor the DataSet implement IEnumerable or IQueryable, but LINQ to DataSet treats DataTables as enumerations of DataRow Objects and lets developers query DataSets and DataTables.

New Data Controls

In ASP.NET 2.0, the GridView, DataView, and FormView all have paging built in out of the box, but it has its limitations such as having the paging interface appear detached from the actual control itself. The DataPager control offered in 3.5, addresses these limitations by allowing the paging functionality to be independent of the control and appear anywhere on the web page.

The ListView is a new control which combines the best functionality of the DataGrid (editing features) and the Repeater (templating, control over markup) controls.

Cleaner Coding and Language Improvements

Improved HTML Markup

ASP.NET has never had a good reputation for generating clean HTML. While ASP.NET 2.0 provided more control over the HTML markup generated than 1.1, some of the controls still produced the same garbage, but with the new data controls in ASP.NET 3.5, the developer has more control over the HTML that is rendered which is a great thing for the end-users.

Automatic Properties

This improvement is best explained visually. Below is a nice “before and after” example but basically this would be an immense time saver especially when dealing in migration issues when many “supporting” methods and properties need to be re- created to facilitate platform migration.

In 2.0, the developer needed to declare a private property and then set Getters and Setters to access that property as in the example below:

Properties in the .NET 2.0 Framework
public string
{
     get { return _address; }
     set { _address = value; }
}

In 3.5, the C# compiler creates the Getters and Setters and the private field automatically. This is just an obvious time saver and makes code much cleaner for review and maintenance.

Automatic Properties in the .NET 3.5 Framework
public string Address {get; set;}

Object Initializers

In 2.0, when developers instantiate an object with a default constructor, they need to call the constructor, and assign values individually to the object’s properties:

Instantiating a class in the .NET 2.0 Framework
Employee emp = new Employee();
emp.FirstName = “Sara”;
emp.LastName = “Smith”;
emp.EmployeeID = “SI-12345”;

In 3.5, the C# compiler automatically generates the appropriate property setter code(s):

Object Initializers in the .NET 3.5 Framework
Employee emp = new Employee { FirstName=”Sara”, LastName=”Smith”};

Collection Initializers

When developers need to add a series of objects to a Collection in 2.0, it is necessary to add each object one by one to the collection. In 3.5 however, the C# compiler supports collection initializers which allows us to add as many objects as we want during the initialization process rather than adding them individually:

Collection Initializers in the .NET 3.5 Framework
List employees = new List {
  new Employee { FirstName=”Sara”, LastName=”Smith”},
  new Employee { FirstName=”Ben”, LastName=”Jones”}
};

Type Inference

This is something developers are used to seeing in JavaScript, but in 3.5, the C# compiler can infer what type of variable is being created simply by looking at the value being assigned. This type of intuitive functionality becomes a great “on the fly” feature

Type Inference in the .NET 3.5 Framework
var message = “Choose .NET 3.5!”;

Built-In ASP.Net AJAX

AJAX provides end-users with a rich, interactive, user-experience. .NET 2.0 required a separate download to work with ASP.NET AJAX, but 3.5 has this functionality built-in along with extra improvements. Visual Studio 2008 is optimized to work with the 3.5 framework.

Conclusion

As developers, the .Net 3.5 Framework provides us with a more concise and efficient way to work with objects and collections as well as working with data. With new controls like the ListView and DataPager, we have complete control over the markup sent to the browser, while still providing data paging and data manipulation capabilities. Using .Net 3.5 instead of 2.0 will allow us to build better applications, and build them quickly thus making the foundation for future releases and maintenance much more accommodating. .NET 3.5 has been thoroughly tested and is recommended for any new projects.

For projects still in their infancy and their future is not set in stone, taking the pro-active leap to incorporate a technology whose future is virtually guaranteed is the type of forward thinking decision which can only benefit all parties concerned. Since much of the product support is provided by the development community, as developers continue to move to 3.5, support for 2.0 will dwindle. We recommend using it over 2.0 because in the long run an application written in 3.5 will require less rewrites and make for a better final product for the user.

Oct

15

Job Hunting Sucks

Posted by Sara

I may or may not be looking for a new job soon. Let me explain.

I work for a government contractor and our contracts with the government last for a certain amount of time and then we either have to rebid or they can get extended. The contract I work on looks like it won’t get renewed and will get recompeted by small businesses (my company is not considered a small business). The contract expires in December but it looks like we may have a 120 day extension, but nothing in writing yet which makes me uncomfortable.

This is the way it is with gvmt. contractors so it is really no big shock it just kind of sucks. I love the work I do and I really love the people I work with. Now, I have only been with the job for 9 months now, so the expectation is that I would see the job until the end and then the company would put me on another contract. Some of the people who have been there longer would be pulled off first and put onto other contracts. One of my concerns is if other people are pulled off, will the people who are left on the contract (like myself) have the support we need to be successful in our job.

The other major concern is I may not like the job that I am being moved to. When I accepted this job, I had two other offers on the table but I chose this because of the type of work and my first impressions of the people. When I am looking for a job, I am as much interviewing them as they are interviewing me. By just being placed in another position, it takes the choice away from me which I don’t like.

So in the meantime, I am updating my resume and starting to bookmark jobs. I won’t know more for a couple of weeks which is driving me crazy. I can handle any situation as long as I know what it is. It’s the unknowing that really sucks.

Dec

26

The Job Search So Far

Posted by Sara

The job search process has been pretty interesting so far. I am fortunate that I have experience in both PHP and .Net so that widens the job possibilities. Some of the position descriptions have got to be written by people who aren’t directly involved in the position. They can be very cryptic that you have no idea what the job is you are reading about:

  • Maintain a broad and continuous assessment of the organization’s information environment
  • Take on moderately complex projects
  • Refine the architecture based on changes in business strategy and technological advances to suit the corporate strategies
  • Articulate architectural decisions clearly to the client
  • Ensures that all business models are integrated into the IT architecture
  • Coordinates the information architecture with the other organization’s technical architectures and data architects

Those are the essential duties and responsibilities for a programming job. I am the type of person who tailors a resume to each job and writes a unique cover letter, well for this job, I didn’t bother applying because it tells me absolutely nothing about the position.

Sometimes I think when people are on the hiring end, they assume they don’t have to show their best side too. Well, I know personally, even when I am being interviewed, I am interviewing the company. I know I have to show up and be ready to sell myself, but the employer also has to do the same. I’ve had 5 interviews so far. A couple of the jobs paid extremely well, but the work sounded absolutely boring. I had 3 interviews with one company and had a video conference scheduled for Thursday (dec. 20) which ideally would have been the last interview but they never called. Come to find out they decided that since I didn’t have 10 years experience, they weren’t interested in me for the job. Seriously, WTF? You can easily read my resume and see that I have just over 5 years experience. I guess I think, don’t waste my time if you could have made that disqualifying decision before the first call was ever made. Maybe I’m being idealistic but I want the interviewer to be just as interested in me as I am in them. This would give insight as to how they would be as an employer.

So far I have a couple of options but I am waiting until next week to decide anything. What it’s going to come down to is this

  • Will I make enough to pay the bills and maintain our current lifestyle? - Yes, I have a bottom dollar figure that I need to work with. Surprisingly the jobs I am applying range from this dollar figure to 40k plus. The biggest difference in what they pay is the size of the company, whether an active security clearance is required (appears to add 15k-20k to your net worth), and if they are a private or publicly funded company.
  • Am I excited about the job? - This is very important to me. I enjoy working in general but I really want to be excited about what I do. It makes it all worth it! There is one job that has put an offer on the table but the job just doesn’t sound that great. Now I spoke to someone recently about a different job opportunity and that job sounded really cool. The 2nd job pays 30k less (and I don’t have an offer at this point) but I would lean more towards that one than the first just because I think I would enjoy the job much more.
  • How’s the quality of life? - Something else that is important to me. I am at a stage in my life where I’m not trying to make as much as I can make. I am instead focused on the quality of life (quality of the job plays a role in this) the job provides me. I’ve been working from home for the last 3.5 years so it will be an adjustment to get back to an office environment. But does the position offer good benefits (time off, flex time, telecommute opportunities, etc.) For example, if my son got sick today and had to go home, I would pick him up and I would still be able to get my work done. Would a job allow me to do this or would I need to take it as a day off?
  • What are the advancement opportunities? - I’m not looking for a job to pay the bills, I want something that will provide opportunity and growth!

What do you look for in a job?

Dec

21

I’m Back on the Market

Posted by Sara

Well, I’m back on the job market. In my last post about entrepreneurship, I mentioned that I may have to get a “real” job versus what I’ve been doing for the last year and a half. By real job I mean, actually showing my face in a public office. Grooming would be involved. Daily grooming at that.

I haven’t sent out so many resumes since 2003! We are moving to Washington, DC and to say that the jobs are plentiful would be an understatement. The process so far has been interesting. I daily check CraigsList, The Washington Post, and many more. Because there are so many jobs out there, I can be picky and choosy and apply to only the ones that sound interesting. I’ve been in the position before where you apply for anything you qualify for just because it pays the bills and you don’t care if you enjoy it. Fortunately, I’m not in that position right now.

When we first found out we were moving a couple of weeks ago, there was a mix of excitement and regret. I was stoked to be going back to the states but what about all I have tried to accomplish over the last year and a half? I’ve created something I can be proud of definitely and it’s not something I will just stop doing. I will quit working on client’s sites but will continue to grow my own. The web is my passion and luckily I have a really understanding family who support me in that. Because we are moving to a place with a higher cost of living, I can’t continue to do it as I have been because I don’t make enough to sustain the life we want to live in DC. So, instead of seeing it as a setback or seeing it as failure, I see it as an opportunity. I will get to work on projects I never would have before. I am applying to jobs where there is a possibility to learn more skills. I think the thing I am looking forward to the most is working with new people. I have always learned the most from the people I work with. It’s great to surround yourself with people who may have different outlooks or perspectives than you; it challenges your way of thinking and shows you other options.

So, where does this leave all of my personal projects? Well, it’s really no different than how it is now. Right now my full-time job is to work on clients sites. The job will replace this. I built up my personal sites in my free time which will continue. And heck, if the salary is good enough, it may actually let me hire someone to help me out on some of the ideas I have for my sites that I don’t always have time to implement! Unfortunately there is never a shortage of ideas and an overabundance of time.

Dec

12

Computer Science Majors and Real-world Programming

Posted by Sara

I was just reading a question on Slashdot where someone is looking for Advice For Programmers Right Out of School.

“I recently graduated from school with a CS degree, and several of my classes were very theoretical in nature. There was some programming, but it seems not as much as in other schools. I’m currently working at a company where I’m doing primarily c/c++ app development on unix. But as I read slashdot, and other tech sites / articles, and realize for some of the software being written nowadays, I would have absolutely NO IDEA how to even begin writing it. I remember first time I saw them, I thought console emulators were really cool. After my education, I have no idea how someone would begin writing one. With the work I’m doing now, it doesn’t seem I’m going to be using (or creating) any of the really cool technology I hear about. How did everyone here begin learning / teaching themselves about different aspects of programming, that they initially had no clue about? How did you improve? Programming on your own? Through work?”

I think when people go into the computer science program, you often think you will come out knowing how to write these grand applications, but that just isn’t the case. I went to two different schools and studied computer science at both and the programs were very similar; just the language of choice was different — one was c++ and one was Java. But the core curriculum focused on teaching theory and good practices and then you were given programming assignments to demonstrate your comprehension of what you learned.

Most bachelor level computer science programs teach you the fundamentals, essentially giving you tools for your toolbox. Once you graduate, it is up to you to use those tools and gain experience building your masterpieces.

As far as learning new technologies and languages… buy a good book, search the web, sit down in front of your computer and try it out. ou can’t wait for things to fall in your lap; you need to make it happen.