The most popular programming languages are rapidly changing

Interesting post on Quartz:  The most popular programming languages are rapidly changing

While it is an interesting post, a number of questions came to mind on reading it:

  1. While StackOverflow is indeed a dominant system for developers seeking and sharing information, I wonder if its demographics is really representative of the entire software/technology industry.
  2. The dominance of JavaScript is hardly surprising, since if you want to do anything in the browser, you really have no choice (and choice is always a bad thing, right?).
  3. Is SQL a “programming language”? I never thought so. You cannot “build a system” in SQL – SQL may be a major part of a large number of systems, but you need a programming language to make use of it.
  4. NodeJS and AngularJS are not programming languages. They are frameworks for JavaScript. Making these two their own categories makes no sense, anymore than it would make sense to have separate categories for Python and Django and Tornado. It might make sense to have separate categories for server-side versus client-side Javascript, but not specific frameworks.
  5. Merging together the JavaScript, NodeJS and AngularJS would give a more clear indication of the use of Javascript – rather than showing a decline in JavaScript usage over the last three years.

5 Steps to Faster Mobile Web App Development

New Brunswick start-up Agora Mobile has developed a revolutionary platform for the visual development of mobile web applications.

As we move closer to launch, we are beginning a private beta targeting developers (and other forward-thinking sorts). To kick off this beta, we are beginning a series of webinars which introduce the platform and concepts. The first webinar is this Thursday (June 26).

Register for the webinar at http://developers.vizwik.com – and as a bonus you will become part of the private beta!

6 Technologies From My First Job

I was sitting around on New Year’s Eve playing Zork, and I got to reminiscing about technologies I have used which either no longer exist or have passed into no usage. Thinking back to my first summer job where I actually got paid to program (actually, I was paid to do physics, but programming was a big part of it), here are six tools I used…

KIM-1

First, we used a KIM-1 microcomputer. This 6502-powered beast had a whole 1024 bytes of memory, and no persistent storage. We used this to control a Perturbed Angular Correlation Gamma Ray Spectroscopy experiment.

After the experiment ran for a while (collecting data in scalar registers), the KIM-1 would dump these registers out to a more “permanent” storage – in this case paper tape. This was great stuff to work with, frequently breaking, sometimes absorbing moisture and swelling.

The experiment would generally run for a couple of days, after which we would have to process the data – which meant uploading it to the mainframe. For the upload, I used a very old (even then) teletype machine, connected to a screaming 300 baud acoustic coupler.

Using this, we uploaded the data to the university mainframe, where I got to analyze it in one of my favourite languages of all time, APL!

Computing was different then!

Why I Love UX (or How to Piss Off an Entire Department!)

Last Friday, I tweeted something which was badly worded, and managed to piss off much of our UX team (not to mention a few UX people far and wide):

Pissing off UX

Now I ask you, how could that post possibly offend anyone (note sarcasm)?

So, I would like to clarify what I was thinking when I posted that (and again ran into the problem that most of my thoughts do not fit into 140 characters).

First, I had been reading a number of posts and other articles by so-called UX experts, thought leaders, and others (all off whom shall go nameless, as I do not need anymore flames – well, actually I enjoy flames, but am full at the moment). Like many fanatics, they have (in my humble opinion) some fairly radical beliefs that are not well grounded in the real world. These are the “UX people” to whom I was referring in my post. Yes, my choice of words was bad.

Secondly, I have a great deal of respect for the UX process. I even have a lot of respect for most of the UX people I know (even the ones with whom I disagree). Frequently it is the UX department with whom I have an issue. I have the same issue with Marketing (the department) versus Marketing (the process), and with Architecture (the department) versus Architecture (the process).

The comparison with architecture is particularly relevant, as I have had many arguments over the years in software organizations as to whether “architect” is a role or a job title – should there be an “architecture group” separate from the development team. My belief is a resounding NO! I tend to believe that “architect” is a role which and individual with the appropriate skills and training assumes on a specific project. On another project, that same person may be a senior developer. My concern with architects in a group by them selves is that I have frequently seen these groups (a) become extremely elitist; and (b) become too far removed from the reality of implementation, leading to architectures which are elegant, beautiful, and difficult to impossible to build on-time and on-budget. Often, the 99% philosophically correct, current-best-practice architecture is not necessary, when the 80% solution can actually be implemented on-time and on-budget.

I find that UX groups is some organizations, and UX thought-leaders in the world at large, are falling victim to much the same challenges I described for architecture. Too much separation between UX and implementation creates certain challenges.  And, there is often little willingness to deviate from the “philosophically correct vision” in favour of practical reality.

And as a final thought, I definitely do not have all the answers in these areas – I just have some very definite questions about how we (in the global sense) do things.

Microsoft: Get Your Shit Together on Touch Development

Testing Samples from Microsoft Surface Toolkit...

Image by John Bristowe via Flickr

I have been playing with multi-touch development for a while, both on Windows 7 with my 2740p and on the Microsoft Surface table (version 1, not the new one).

I have consistently had challenges using WPF4 multi-touch events on the 2740p, or using the Microsoft Surface Toolkit for Windows Touch Beta, and now with the newly released Surface 2 SDK.

With any of these tools, I have challenges getting the software to recognize touch events, and even more trouble getting the software to recognize 2 simultaneous touch points (the 2740p supports 2 touch points). A second touch point always cancels the first touch point.

What is funny (to me, anyway) is that the samples included with the machine in the Microsoft Touch Pack for Windows 7 work just fine on the 2740p. This indicates that it is something in the managed drivers used with WPF that is not working.

I am fairly certain that this is a driver issue. I had it working at one point after a lot of hacking and installing drivers different from the default updates. I guess an update somewhere (Windows Update, or HP Tools) has overwritten the driver I had setup to make it work.

Can I fix the drivers to make this work again? Absolutely! But that is not the point here.

This should just work!

How am I as a software developer, or as an ISV, supposed to recommend this platform to my customers, or build applications for it, when even getting it to run on different machines requires significant hacking of drivers?

If Microsoft wants to stop being seen as a joke in the multi-touch and/or tablet market, they really better find a way to get their shit together on this.

Danger! Do not implement SharePoint in your Organization! REDUX

This is a re-post of a column I wrote over on Legal IT Professionals a couple of years ago. Just posting it here so that I have a local version.

This column I want to deliver a warning to all of you out there – do not implement SharePoint in your organization! If you ignore this warning, and implement SharePoint anyway, beware. You run the risk of any number of problems, including:

  • User dissatisfaction
  • Maintainability and support issues
  • Data silos, making information hard to find, hard to share, and hard to maintain
  • Lots of rework
  • General chaos
  • Projects that take 10 times longer than you had planned, if they finish at all.

I do a lot of work helping organizations build solutions using SharePoint – is that all a lie?

Not at all. The problem here is the way you think about your projects. If you are consistently talking about “implementing SharePoint” you are going in the wrong direction. If you are talking about implementing any platform, you are setting up for failure. Many of the problems we run into with SharePoint and other platforms arise from focusing on the technologies.

SharePoint is a technology. It is a platform. It is a pretty good platform, in my opinion. Not without its problems, but a pretty good platform.

So what should you be focused on? The answer is obvious, isn’t it? The focus should be on implementing solutions to real business problems, bringing real business value. That was obvious to everyone, wasn’t it? If this is obvious, then why do I still have conversations with potential clients who come to me saying “Help us implement SharePoint”, when they cannot clearly articulate why they want to implement it? Sure, they can spout a lot of vague statements about documents, collaboration, communication, workflow, etc. but where are the clear statements about how this is all going to help their firm?

I think there are a number of reasons this happens. Firstly, maybe I am just talking to the wrong people (too many techies!). However, I have these discussions with many business people as well. Microsoft’s marketing is also a problem (though it is not Microsoft’s fault). People see Microsoft’s SharePoint marketing information, but they typically only pay very superficial attention. They see all these demos of interesting solutions that seem like they must be useful in their world. Then they go to their IT department (or decision makers) and say “Hey we need to implement SharePoint!”

Even worse, they go rogue and implement SharePoint on a small scale within their groups or departments. Then the IT group has to manage all of these emergent SharePoint deployments, so there is a decision to “implement SharePoint” firm wide.

Finally, there are those firms (hopefully very few these days) who really do not understand that they should not be thinking in terms of the technology.

So when is SharePoint not dangerous? Well, that is driven by how you got to “SharePoint” in the first place. I am not going to go into much detail here, because most of this should be pretty well engrained process (if not, call me – I can help ), but here are the big steps:

  • Identify clear business objectives/problems to be solved
  • Is SharePoint the right technology choice to solve them?
  • Don’t try to do everything at once – build a foundation and grow from there
  • Pick initial projects with high impact/visibility
  • Determine specific ROI goals, success metrics, etc. so that you know if you are meeting your goals
  • Make sure to consider the “human” side of things – introducing a platform that touches business processes and how people work requires detailed planning as to how to introduce it.
  • Get help! Hire it, rent it, grow it – whatever you have to do, get help. SharePoint is a big platform that does a lot of things, and if you do not know the platform well, you will end up building things that already exist. Also, as with most platforms, there are 6 different ways to do almost anything – some of them are better than others.

The first step, though – change your thinking and your terminology – and stop talking about “implementing SharePoint”!

Make Your SharePoint 2010 Master Page Extensible with Delegate Controls

I have been playing a lot the last little while with SharePoint 2010 Delegate Controls. I have known about them for a ling time, but have never really delved into them all that much.

Most of the examples I have looked at, and the usage ideas I have seen, involve using the existing delegate controls in V4.master to do things like:

  • Modify the Welcome Menu
  • Customize the Global Navigation
  • Add useful code to the page header

Last week, I used a delegate control for something a little different.

For a project I am working on, the client wanted some functionality displayed just below the Quick Launch, on every page in the site collection. I know there are lots of ways to do this (put a user control on the master page, put a web part on the master page, or just put links on the master page, since that’s all the content was in this case).

But then I thought of a little bit more elegant (to me) solution. Rather than explicitly putting the content on the master page, I added a delegate control of my own to the page, and placed it just below the Quick Launch, as shown below.

image

Several things to note here:

  • I gave it a ControlID specific to my application;
  • I set AllowMultipleControls to true, which will be useful later
  • I included default content in the <Template_Controls> element, so that I could see it change when I activate a Feature with an appropriate control.
  • Next, I implemented a Feature in Visual Studio 2010, with a control to replace the default content. The details of how to do this are covered in other places (such as here), but to summarize:
  • I created an empty Visual Studio 2010 project;
  • I created a user control inside the project (this automatically mapped the ControlTemplates folder for me). It is a very simple user control, and simply displays “Hello, Delegate!”
  • I created an appropriate elements.xml file to map my control to the Delegate Control’s ControlID.

So, here we see the how the delegate looks before I deploy my feature:

image

After I deploy my Feature, we see that the default content is replaced with the Feature’s control’s output:

image

But wait, there’s more! Remember that I set AllowMultipleControls to true? That allows me to deploy multiple features with controls that map to my ControlId, and instead of only displaying the one with the lowest Sequence attribute, it will stack them all in order of Sequence number, as shown below.

image

This means that I can add any number of  things to the area under the Quick Launch without further customizing the the Master Page.

Maybe I am just easily amused, but I thought that was pretty neat!

The source for this, including the master page, is available here.

Validating User Passwords in SharePoint 2010

I recently wrote a user self-registration solution for SharePoint 2010. As part of this solution, I needed to validate the requested password to ensure that it met the requirements of the authentication provider (in this case, Active Directory).

The code, while hardly rocket science, is something I do not want to figure out again. So I thought I would post it here for my own benefit. If anyone else finds it useful, that’s cool, too!

I wanted to validate that the password met various requirements from the AD policy:

  1. 1. Length
  2. 2. Complexity (contains a combination of lower case, upper case, digits, and special characters.
  3. 3. Content (does not contain all or part of user name)

I did not need to check against old-passwords to prevent repetition, since this solution is creating new users.

Checking for length is blatantly obvious, so I won’t bother showing that.

For complexity, the default AD policy is as follows:

“Passwords must contain characters from three of the following four categories:

  1. English uppercase characters (A through Z).
  2. English lowercase characters (a through z).
  3. Base 10 digits (0 through 9).
  4. Non-alphabetic characters (for example, !, $, #, %).”

This is pretty simple to do. In fact there are several ways to do it, depending on whether you want to use regular expressions, built-in methods of the string class, etc.

  1. For digits and special symbols, I simply created character arrays for those two groups, and used the string class’ IndexOfAny method.
  2. I could have done the upper and lower case the same way, but I decided to take a different approach (just for variety). For a string S, if S==S.ToLowerCase(), then S contains no uppercase letters. Similarly for uppercase.
  3. Having determined the presence of the 4 classes of characters, I can then simply add up the number of character classes found.

So, code I have used for these conditions is:

The next interesting part was the content check. To check that no more than 2 consecutive letters of the user name or full name are used in the password, I iterate over the username, taking three-character substrings, and checking to see if the password contains them. This is then repeated for the full name. If any of the substrings is found, then the password fails:

   1: protected bool PasswordComplexityValidation(string UserName, string FullName, string Password)

   2: {

   3:     char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };

   4:     char[] symbols = { '~', '!', '@', '#', '$', '%', '^', '&', '*', '_', '-', '+', '=', '`', '|', '\\', '(', ')', '{', '}', '[', ']', ':', ';', '"', '<', '>', ',', '.', '?', '/' };

   5:  

   6:     bool blnHasDigits = (Password.IndexOfAny(digits) != -1);

   7:     bool blnHasSymbols = (Password.IndexOfAny(symbols) != -1);

   8:     bool blnHasUpperCase = !(Password.Equals(Password.ToLower()));

   9:     bool blnHasLowerCase = !(Password.Equals(Password.ToUpper()));

  10:  

  11:     int conditionsMet = 0;

  12:  

  13:     if (blnHasDigits)

  14:         conditionsMet++;

  15:  

  16:     if (blnHasSymbols)

  17:         conditionsMet++;

  18:  

  19:     if (blnHasUpperCase)

  20:         conditionsMet++;

  21:  

  22:     if (blnHasLowerCase)

  23:         conditionsMet++;

  24:  

  25:     return (conditionsMet > 2);

  26: }

That is about it. I make no representations that this is the best way of validating passwords, or even the best. This is just what I thought up over the weekend!

   1: protected bool PasswordContentValidation(string UserName, string FullName, string Password)

   2: {

   3:     // Check that password does not contain a large part of the UserName or Full Name

   4:  

   5:     bool blnIsValid = true;

   6:  

   7:     // Check if password contains a 3 character substring from the username

   8:     for (int i = 0; i < (UserName.Length - 3); i++)

   9:     {

  10:         string substring = UserName.Substring(i, 3);

  11:         if (Password.Contains(substring))

  12:         {

  13:             blnIsValid = false;

  14:             break;

  15:         }

  16:     }

  17:  

  18:     // Do the same for 3-character substrings from the Full Name, but only if the password is not already invalid

  19:     if (blnIsValid)

  20:     {

  21:         for (int i = 0; i < (FullName.Length - 3); i++)

  22:         {

  23:             string substring = FullName.Substring(i, 3);

  24:             if (Password.Contains(substring))

  25:             {

  26:                 blnIsValid = false;

  27:                 break;

  28:             }

  29:         }

  30:     }

  31:     return blnIsValid;

  32: }