All your clients should go on a diet

During the last few months my graduate supervisor and I have been doing a lot of demos to the major canadian telecommunications companies. In the demos we show different devices interacting with each other (which is something people love at demos). One of the things we get asked fairly often is: “How long did it take to build each one of these applications?” and our usual answer is about less than a day. This usually shocks people.

How can this be done? Simple, we use thin clients and the cloud (or some robust and scalable servers).  By having outsourced the client logic to the cloud it is possible to build thin clients.  The thin clients just do a few data calls (or get their data pushed into them) to exchange information.

Of course, this requires extra effort at front when building the server logic but it saves A LOT of work later.

Just as a note, in all cases many client side optimizations should not be overlooked. As an example, client side caching is a good thing when possible.

Don’t copy-and-paste code. Don’t use debug driven development!

Don’t copy-and-paste code. Don’t use debug driven development!

I see a common copy-and-paste trend specially with junior developers. Many of them just copy-and-paste random internet code into their projects. After a while I ask them about their implementation… very few understand what they copy-and-paste and the implications of that implementation!

I inquired further and it was clear that many used debug driven development to get the copy-and-paste code to work. Debug driven development is basically 90% random changes and 10% thinking. This is a popular trend within .NET developers with visual studio because the IDE is amazing…very little planning is required to get things to work.

After a few weeks of seeing this trend I did the following:

If they asked me a question that I believe is due to copy-and-paste or debug driven development I reply with the following questions

  1. Did you google the problem? (some  of them didn’t google the problem!)
  2. Did you copy and paste code? Is that code giving you the error? If you did copy and paste, what does the code do?
  3. What are 2 different approaches to this implementation and why did you choose this implementation?

After answering the questions above, they were able to solve the problems themselves. That makes them happy and it makes me happy!