As a developer, what will you do (or will you be) when you are 40?

I received that question last night that makes me think a lot about it. It is not a simple question, its a big question that I rarely think about.

I think if some of you are being asked that question, you will have different answers. But let me guess, the most answers will be: “I want to become a manager”. Dont get me wrong, I have heard that saying from many people, most are my colleagues who are working on software outsourcing industry playing different roles: developer, business analyst, quality control.

Why do people prefer becoming a manager to a professional on the area they are working on? IMHO, it depends on the current situation of Vietnam. Vietnam is still a developing country and almost companies operating in software development earn money from building software for foreign countries – which is called outsourcing – because it has a benefit of low cost. Being part of outsourcing projects, as a developer, you have to constantly learn various technologies to meet technical specification. That’s good if you – a developer – are learning cutting edge technologies to build software but it’s also not so good that you are assigned to project which uses old technologies and all you have to do is to maintain and to enhance that legacy system. As an example, imagine your skill is .NET but the system have been built using VB6. Or you are very good at ASP.NET 3.5 but the system you are going to build uses ASP.NET 1.1 or even worse, standard ASP. As a business analyst, you have to learn various business domains to understand software requirement, some are good since you are having a chance to learn new business domain which might take a very long time to be available in Vietnam such as Healthcare, e-commerce,… but it is not so good that that knowledge cant be applied in Vietnam at the time we finished building that software.  As a quality control engineer, you have to learn from testing Windows application to Web application and even embedded system or mobile platform as well to master tools to perform automation/performance testing. What if one day you find that your learning ability reaches its limitation that you cannot learn any more or not as fast as you ever were able to?

This leaves you behind people/technologies and you will become not suitable for the job. The ‘solution’ to escape that situation is to become a manager! The other reason for the answer – I mean ‘to become a manager’ – is because vnes people still have an ‘old’ thinking from themselves or their parents that becoming a manager – or ‘boss’ – showing that they have a successful career, or life.

But my answer is: ‘I will be coding, if I cannot code anymore, its a disaster’. Why? the reason is simple, I love coding. Funny huh? Being a developer means you are writing code to get the computer does what you want it to do. However, let the computer does what you want it to do is not the last shot, you have to do it beautifully that someone calls it ‘the art of programming’ and you have to be continuously improving youself to become an ‘artist’. Have you ever felt excited when the software you build not only runs smoothly but also the code you write is easy to read, to understand and is extendable? Have you ever felt happy when someone reviewed your code and said: “Its a beautiful code I’ve ever seen. It applies many good practices out there”? If your answer is ‘Yes’ then you know why I love to be a programmer – and I will when I am 40.

I once worked on a project which my client was a group of technical guys (5 ones, as I recalled) who were very passionate on coding. Some of them were almost over 40, one of them was over 50. What really inspired me was they loved coding crazily. Working with them made me love programming and becoming a professional programmer much more. Well, you might say since they live in a modern country and that their job is more respected, and well paid, compared to in Vietnam that makes them not worry about changing their career path to become a manager. I totally agree and respect your opinion. But please, follow your heart, do what you love to do, live your life, not others.

But if you still want to become a manager, please think about this a bit: skills to manage a software project still need to constantly be improved. It’s  obvious that the software world is changing too fast, not only technical people have to learn new technologies day by day but managers also need to learn new development process and methodologies as well how to apply it effectively, learn how to work with the team of members who are passionate, highly self-respected, learn how to inspire and encourage them, show how you recognize and appreciate their effort. This not only makes an effectively team, but also brings great successes.

Fishing Trip 06/2010

We went fishing last weekend after more than a month to me and three months to my fishing mate. The place was still in Thanh Phu – Ben Tre. The weather was good and there was a light rain in the late afternoon on the 2nd day of the trip (although we expected the heavier rain to get rid of the heat). The thing I was impressed most was there were too much mosquitoes that really annoyed us. Anyway, the number of fishes we caught was worthy for all the effort we spent. Here are some photos taken from the trip.

Till next time

People Are Not Resources

I came across this article http://www.skorks.com/2010/04/the-most-annoying-habit-of-a-software-manager/ this morning which mentioned about the word “resources” that software managers often speak out to mean “people”. I used to work with these kind of managers, both directly and indirectly, and I can say that they always use this “vocabulary” when talking about ones they need for project that I myself felt _uncomfortable_ with that.

My point of view is that we are working on software industry and we are (high) skilled so we need to be (well-)respected, not as machines or things in other industries to be called “resources”. Well, managers can say that it is the common word used in management to mention “people” just as Singleton in Design Pattern, but I still feel uncomfortable with that. Is the word “people” too expensive for them to buy?

As well the term “resource utilization” that is used and practiced rigidly in those daily working really killed the inspiration/loyalty of mine while working with those managers. I don’t mean that we, the workers, against that utilization because we need job and they need us to get the job done. But should they use the word “people utilization” in place of “resource utilization”? No? The solution for this is may be speaking these words in the meeting room where there are only them, managers, or they annoy their supposed-to-be low level citizen like me.

Its so sad that those managers I mentioned above wont ever be aware of this because I believe they dont have a reading/learning habit and they tend to think that they dont need to improve their management skill. They are always so confident to say: I need resources, give me some then I will utilize them effectively! Read the rest of this entry

[Bookmark] First and Second Level caching in NHibernate

Found a very good post about “NHibernate first and second level cache”. I myself find the helpful explanation about the different between Session.Get(id) and Session.Load(id)  because I must admit that I was not aware of this until I read this post 🙂

Read it through at: http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/11/09/first-and-second-level-caching-in-nhibernate.aspx

NoSQL with MongoDB, NoRM and ASP.NET MVC

Thought I should keep watching this new trend: Document Databases. Just found a good introduction series about MongoDB, NoRM and ASP.NET MVC:

Part 1 – http://weblogs.asp.net/shijuvarghese/archive/2010/04/16/nosql-with-mongodb-norm-and-asp-net-mvc.aspx

Part 2 – http://weblogs.asp.net/shijuvarghese/archive/2010/04/21/nosql-with-mongodb-norm-and-asp-net-mvc-part-2.aspx

Focusing on the controller’s responsibility

This morning I came across an interesting article about Controller responsibility: http://mhinze.com/focusing-on-the-controllers-responsibility/

This is the excerpt:

A heavyweight controller

public RedirectToRouteResult Ship(int orderId)
{
   User user = _userSession.GetCurrentUser();
   Order order = _repository.GetById(orderId);

   if (order.IsAuthorized)
   {
      ShippingStatus status = _shippingService.Ship(order);

      if (!string.IsNullOrEmpty(user.EmailAddress))
      {
         Message message = _messageBuilder
            .BuildShippedMessage(order, user);

         _emailSender.Send(message);
      }

      if (status.Successful)
      {
         return RedirectToAction("Shipped", "Order", new {orderId});
      }
   }
   return RedirectToAction("NotShipped", "Order", new {orderId});
}

According to the author, that controller does a lot of things, so he suggests a refactoring techniques called “Refactor Architecture by Tiers. It directs the software designer to move processing logic out of the presentation tier into the business tier.”

Here is how the controller is refactored by moving the logic for shipping an order to an OrderShippingService, our action is much simpler.

A simpler action after refactoring architecture by tiers
public RedirectToRouteResult Ship(int orderId)
{
   var status = _orderShippingService.Ship(orderId);
   if (status.Successful)
   {
      return RedirectToAction("Shipped", "Order", new {orderId});
   }
   return RedirectToAction("NotShipped", "Order", new {orderId});
}

I must admit that I have implemented that so-called _heavyweight_ controller when developing website using ASP.NET MVC and I rather call it a ‘fat’ controller which violates Single Responsibility Principal since it does a lot of things. My solution is somewhat familiar with the author: moved the logic to Service or Business layer. This will keep the controller ‘thin’ and concentrates on its responsibility: a coordinator between View and Model which intercepts user request, asking  business layer to perform business logic, pull data from Model and choose a right View to return to client.

And it takes time, even blood, to absorb.

Lesson learned from building Bua An VIET Website

There are many things worth noting after finishing the phase 1 of Bua An VIET:

– This is the first time I built a website using ASP.NET MVC (1.0), although I have some experiences with ASP.NET Web Forms, there still are too many things to learn, especially, implement custom model binder to fetch complex object graph, how to do ajax with jQuery, how routing works and how to make it works as expected via routing configuration.

– Working with NHibernate has been more and more of pleasure. Fluent NHibernate is handy and it saves me time to debug mapping error. S#arp Architect is a great open source web framework to be employed. I really like the way that NHibernate Session is managed, although I am not applying Repository pattern like its reference implementation (Northwind sample).

jQuery is awesome.

– It took me a lot of time to deal with CSS because of lacking deep understanding on it or my knowledge is outdated. Knowing many resources of CSS and jQuery helped me out, but it still took me time.

– I must admit that building web development requires good graphic design skill, and I don’t have one. Wandering over internet to choose a right template is a way to do, but it is also time consuming and when I want to change the layout/template with a new one, I nearly have to start over with another messy html and CSS.

– A number of design patterns and design principals have been being applied. This is where I learnt a lot. Some of design pattern which I always think it must be applied and/or some principals I always think it is true have becomes not suitable and/or over complicated, at least to me. I learnt the fact that “Theory  is  just pink, and trees are always green”

– We are planning to add more features to the site, also an upgrade to ASP.NET MVC 2 is planned. This will bring more useful information to the user and more fun to me.

A .NET Developer Guide to: MongoDB and NoRM

Document databases seems to be a new trend compared to relational database which has been employed years ago. So beside a previous post/bookmark about document database, there is another one mentioning about this, read more on it at “A .NET Developer Guide to: MongoDB and NoRM

Document Databases

This post from Ayende is about Document Databases (DocDBs). The post give an introduction/explanation on what document database is, how it stores data using key/value, how the data “relates” to other compared to how a table relates to another in RDBMS. How to persist/retrieve data from document database. Some variants as CouchdB, MongoDB and Raven are also mentioned in the post.

Read the post at: http://ayende.com/Blog/archive/2010/04/11/that-no-sql-thing-ndash-document-databases.aspx

Macro To Collapse Expanded Projects In Solution Explorer

If you’ve ever worked on a solution which has too many projects, you would find it took a lot of time to ‘manually’ collapse expanded projects once opening the solution on Visual Studio’s Solution Explorer.

Here is a macro which does that for you. Just open VS, create a VS Macro Project by going to Tools > Macros > New Macro Project. VS will create a new macro project named MacroProject1 and show that project in Macro Explorer. Under MacroProject1, there is a module named Module1. Right click on Module1 and select Edit, VS then brings out Module Editor. Copy and paste this piece of code for the module:

Imports System

Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics

Public Module CollapseSelectedNode

Sub CollapseSelected()
‘ Get the the Solution Explorer tree
Dim UIHSolutionExplorer As UIHierarchy
UIHSolutionExplorer = DTE.Windows.Item(Constants.vsext_wk_SProjectWindow).Object()

‘ Check if there is any open solution
If (UIHSolutionExplorer.UIHierarchyItems.Count > 0) Then

‘ Get the selected node
Dim UIHSolutionRootNode As UIHierarchyItem
UIHSolutionRootNode = UIHSolutionExplorer.SelectedItems(0)

UIHSolutionRootNode.DTE.SuppressUI = True

‘ Collapse each project node
Dim UIHItem As UIHierarchyItem
For Each UIHItem In UIHSolutionRootNode.UIHierarchyItems
If UIHItem.UIHierarchyItems.Count > 0 And UIHItem.UIHierarchyItems.Expanded Then
‘ As of a Bug in VS 2005 you have to use the following lines
‘ instead of using UIHItem.UIHierarchyItems.Expended = False
UIHItem.Select(vsUISelectionType.vsUISelectionTypeSelect)
UIHSolutionExplorer.DoDefaultAction()
End If
Next

UIHSolutionRootNode.Select(vsUISelectionType.vsUISelectionTypeSelect)
UIHSolutionRootNode.DTE.SuppressUI = False
End If
End Sub
End
Module

Your module editor might look like below:

Macro Editor

Press Ctrl + S to save the module. Now it’s time to bind shortcut keys to execute the module once pressed. Go to Tools > Options, expand ‘Environment’ node then select ‘Keyboard’ subnode. Enter the fully qualified name of the macro you just created in ‘Show command containing’ text box, i.e. Macros.MacroProject1.CollapseSelectedNode.CollapseSelected. Place mouse cursor in ‘Press shortcut key’ text box then press Ctrl + Alt + / (you can choose other combination of keys if you want to).  Your screen might look like below:


Shortcut keyboard binding to macro

Click OK to bind the shortcut keys to the macro. Now, it’s time to test the macro by opening any .NET solution, expand some projects under that solution then press ‘Ctrl + Alt + /’ you will see all the expanded projects are collapsed.

Enjoy!

Reference: http://weblogs.asp.net/israelio/archive/2007/09/06/visual-studio-collapse-selected-node.aspx