The Technology Age Gap

The age gap between the pre – 2010 children and the post – 2010 children may seem like a joke but technology has jumped dramatically since 2010 and there is definitely a learning curve on each side of the gap.  To give full disclosure I am writing this from a pure observation standpoint and have done no scientific study.  The specific area that I have seen this observation is with UI design and interface design.

I have two children Waldo that was born pre 2010 and Thad that has been born post 2010 with a three-year age difference (by the way that is not my children’s names.  I mean who would name their child Waldo or Thad?).  Both children have grown up with technology with both having been given a laptop at approximately two and one-half years of age but with one large difference being that Thad has also had access to tablets and smart phones from the age of one. 

When Waldo was born, the BlackBerry was king and the iPhone was still a twinkle in the developer’s eye, so the touch devices were not available to Waldo until he had already been accustomed to using the mouse and keyboard.  Waldo’s first computer was running Windows XP and he could zip around that just after he was two and one-half.  As Waldo became older he would play with our Android phones and tablets but he seems clunky with the touchscreen but when he uses the mouse or touchpad there is no hesitation.

While Waldo is comfortable with the keyboard and mouse, the exact opposite is true for Thad.  Thad has trouble using the mouse and touchpad on his laptop but he navigates the touchscreen with expertise.  Amazingly, Thad can use multiple operating systems including Windows 8 and Android with the touchscreen both without issue.

Here is what I have found very interesting, after updating Waldo’s laptop to Windows 8.1 he seemed to be able to navigate the Windows 8.1 RT tablet with much greater ease catching up to Thad’s abilities.  I know that the gap that they are experiencing today will be overcome with a few years of using their computers but it is just something that I have found interesting as I have watched them grow through the years.

So while this is an interesting observation, does this so-called age gap really mean anything?  The short answer is yes, it should make an influence for developers when creating a new application.  When a developer is approaching a new application there can sometimes be an attraction to use the latest and greatest of technology such as making the application for touch devices but there needs to be consideration to make the application comfortable for keyboard and mouse users as well.  Beyond the age gaps for young people there is the age gap between the x and y generations who may be more accustomed to keyboard input than even using the mouse (DOS anyone?). 

So here is the challenge, make an application that works well for touch, is comfortable for keyboard and mouse, and works with just the keyboard.  Yea, we will get right on that.  In reality this will never happen but there needs to be consideration for these crossover people, just as Microsoft has done with the update from Windows 8 to Windows 8.1 Update (the desktop version update).  With Windows 8.1 Update Microsoft brought back the Right-Click to interact with the Metro-Style start menu, bridging much of the gap.

So there you have it, a small generation gap that should have an impact on development style.

 

The benefits of Early Returns

Returning early in a method is something that we have debated quite a bit at work, and what I see is that there reasons to return early and times to have a single return.  There are two reasons to return early one which prevents code from executing when it does not need to execute and the other is to make code more readable.  As for having a single return the main reason is for code readability but from a different aspect than returning early.

So to demonstrate the point I have included the same method written with return early and on with a single return here.

In this comparison I have simple code that is checking if a SMTP mail message is valid.  I am checking that the message is not null, there is at least one From address, one To address, and something in the body.  This might be a bit of an extreme example but it does work to illustrate the point that early returns can make the code more readable.  With regard to efficiency the early returns make the code more efficient in that there is no need to continue execution if one of the early message checks fail.  Using this example, if the From address is not valid (not containing an @ symbol) then the code will return a false immediately rather than continue checking running the code.

Something to note with this comparison, the method using the early returns has a total of 27 lines whereas the method using the single return has 46 lines.  So unless you are being paid by the line of code when writing methods such as this, it is better to have early returns.

One additional note, if you code looks like this….

you need to do something else because this is just bad (I was emailed this code and I am not sure of its original source).

What is the point of out of the box SharePoint?

SharePoint is a powerful platform, but is SharePoint really anything without custom coding and is an out of the box solution worth the trouble?  The short answer is if you want a web based file share out of the box is fine…but if you need anything else, then plan on coding and jumping through a few hoops.

So what do you get out of the box?

  • File sharing

  • Basic (very basic) versioning control

  • Change the background and the color

So when does coding being?  It begins when you want to change the “SharePoint” word or logo at the top left of the screen.  When it comes to SharePoint the thought of it as a CMS needs to go away and it needs to be thought of as a platform for development. 

SharePoint demonstrates its extensibility and need for custom development when it comes to utilizing functionality that is promised in the out of the box functionality but is not delivered.  One area that this is very apparent is with version control and retention policies.  Version control works well out of the box but it does not do anything with retention policies meaning that if you need to maintain the current version’s retention policy independent from the historical version’s retention policy custom code will be needed.

To accomplish this functionality there are five requirements.

  1. A document library to hold the current documents.

  2. A content type that can be used for the record with applicable metadata.

  3. A record center with a record library to capture the versions.

  4. The record center must be setup as a Send To location for the SharePoint farm.

  5. Some code with an event receiver to capture the versions.

Using this methodology when a user begins the process to update a document the current version is immediately sent to the event receiver and based on the logic within there is a determination whether or not to archive.  The document is then sent to Send To location (the record center) which will handle the routing to the correct record library.  The record library can have whatever retention policies required by the documents applied.

Functionally there is only a few lines of code that are required for this to function:

  1. public override void ItemUpdating(SPItemEventProperties properties)
  2. {
  3. SPFile file = properties.ListItem.File;
  4. string strOut = "";
  5. OfficialFileResult retVal = file.SendToOfficialFile(out strOut);
  6. string value = retVal.ToString();
  7. }

However there is a bit more code that is required to make this a fully functioning option.  Click Here to see the full code (not including the installer for the feature).

My New Blogging Site :)

So this is my new blogging site.  I have built it from scratch using Drupal, a few existing modules, and a little of my own code.  While there is a temptation to utilize an OOTB solution such as Wordpress or a Drupal distributions (Drupal Commons, Open Atrium, or one of the others) it does not allow you to customize everything on the site.  There are aspects of this site that could not be done as I would like if I did not use the methodologies that I did to create the site.  This is my first of hopefully a lot of blog posts on a varying array of topics (which will be tagged and categorized by topic).

So just to give a tour of what is under the hood of this site (not a full list but some of the more notable modals and stuff)...

  • Drupal Aquia
  • ckEditor
  • Taxonomy
  • Taxonomy Menu
  • Views
  • Administration Menu (because the default one is awful)
  • ColorBox with ColorBox node
  • Oh and it is running in Microsoft Azure with a MS SQL backend :)

So I have not turned on commenting on yet... I may in the future but until then read away, and I will update as I go.