Changing roles and focus – but not good bye

I’ve been presented with a great opportunity to work on the NeuronESB Team (www.neuronesb.com). I’ve always wanted to work on a product team – which is a big change from my work over the past 23+ years where my focus was on custom application development and related consulting. I’ve been on the Neuron team now since 1/5 and it has been a great experience.

So…what does this mean as far as my community activities? Candidly, I’ll be cutting that back quite a bit. I will try to get to 1 or 2 shows this year. If you follow me on Twitter, you began to see my travel schedule pick up. We’re not through February yet and I’ve already racked up 26K miles already. Given that trend, it doesn’t leave time for conferences – which is difficult because it means I won’t get to see good friends throughout the year. This is also a good thing as I’ve been speaking at shows, non-stop – for 6 years. Even without this job change, I was likely to cut back on the shows. It’s time for others to step up and share their knowledge with the community.

I’ll still continue to write for CODE Magazine and I will still continue to produce videos for WintellectNOW. I’ll do my best to support the Code Camps near me (Philly, NYC, Central Penn). With all of this travel, I may be in town for a user group and If possible and if you would like to have me, I’d love to speak at your group. I’ll post on Twitter my travel plans as they become known. Most of my contributions are going to be in the legal arena – specifically on open source and intellectual property as they relate to technologists, contracts, etc.

Posted in Uncategorized | 2 Comments

How Google broke the OSS compact with Angular 2.0

When I first wrote the title, I had to pause for a moment to consider if I was actually writing this post or if it was a bad dream. As it turns out, at least from my vantage point, what I’ve seen thus far, which candidly isn’t that much, has been much like a bad dream. For purposes of this post, what matters more is what we know we haven’t seen. Nonetheless, I have seen enough to make a few conclusions I’ll express here.

It’s helpful to start with some defined terms and a framework that I can use as a backdrop to support my argument. In this case, I’m relying on the classic OSS development model described by Eric Raymond in his 1997 essay The Cathedral and the Bazaar. I won’t go into all of the model’s facets save one: That all users should be treated as co-developers. The over-arching theme of OSS is one of transparency and at least get as close as possible, to true democratization.

In reality though,democratization is often preached by the same people that just as often don’t practice it. I won’t delve into motive or intent. Rather, I’ll simply rely on what I’ve seen and observed as an outsider looking at the building that has its curtains drawn – trying to get a glimpse of what is going on inside. Is it my or any of our business? You bet it is as collectively, we are part of a large community that is responsible for Angular’s success. We are impacted by decisions being made in the dark.

Looking at Angular 1.x, it has quickly become one of, if not the most popular MV* web development frameworks today. There is a robust community and at last count, has over 1000 contributors. All one has to do is navigate to https://github.com/angular/angular.js to see how robust and vibrant the community is.By all accounts, the Angular Team appreciates this community through the comments expressed at the 2014 ng-Europe Conference. In this day and age, words don’t mean nearly as much as actions. I’m a member of that ever-growing legion of people that judges by what is done, not what is said.

There is no doubt the external community (those outside Google) is the reason why Angular has been so successful. It’s common sense after all. Without broad uptake and support, an OSS Project may be many things, but a success won’t be one of them, unless of course, the goal was for the software to only be used by a few people.

Today, the world is abuzz with mentions of Angular 2.0. Here and there are mentions and perhaps the briefest of glimpses of what 2.0 will be. We keep hearing that it’s not an upgrade, but a complete rewrite, that it is for modern browsers, support for ECMA 6, etc. We’ve heard they seek to make 2.0 more modular and to correct things that weren’t right in 1.x. It all sounds good. But my question is simply this “Where is it? Perhaps you are part of an enterprise that adopted Angular and are wondering what the future will hold. What will happen with 1.x support? Should you plan for an upgrade? Can you upgrade? What about the supposed lack of support for certain browsers? Can you test and verify that? What are the plans after the first release? Again, where are the bits? This is one of the first blog posts on the matter: http://angularjs.blogspot.com/2014/03/angular-20.html. Note the date – March, 2014. You’ll soon see how common that date is.

As it turns out, there were some resources where we could start to get a picture. The problem is, that momentum never carried though. One such site is the learn Angular site: http://ng-learn.org/2014/03/AngularJS-2-Status-Preview/. Note the date: March, 2014. This is nearly an 8 month old post. Supposedly, the design documents are kept on a Google Drive: https://drive.google.com/a/bzmedia.com/?pli=1#folders/0B7Ovm8bUYiUDR29iSkEyMk5pVUk. There was much hype about the designs being released: http://sdtimes.com/google-releases-angularjs-2-0-designs/. Note the date – March 2014. After that, there has been for the most part, radio silence until the ng-Europe conference. But even at the conference, there still wasn’t much in the way of meaningful details. Looking at the documents today, they are either out of date or completely unreadable. Many have been crossed-out entirely. What does this mean? Has that design been scrapped? Is it a bad edit? If there is meaningful information in either the doc library or the source repos, then it is like finding a needle in a haystack. If the goal was to achieve secrecy through obfuscation, then congratulations – mission accomplished. It would be fair for some to conclude that Angular 2.0 is mere vaporware. I’m not willing to go quite that far.

Here’s my contention: if all of this was around the first release of Angular, fine. We had nothing in the first place and the team is trying to get things squared away before going public. I’ll say this, had this been Angular’s first release, where there was mis-communication and partial transparency, the prospects of success would not be there. The fact is, this IS NOT Angular’s first release. Clearly, 2.0 is a revolutionary step over 1.x. The Angular Team looking to capitalize and build upon Angular 1.x’s success. As such, the community that was praised at ng-Europe has a reasonable expectation to be kept in the loop. That’s the way you’re supposed to treat the community that makes up your development partner base. To me, it seems rather common-sensical. Why on Earth would a team want to disenfranchise the very community it relies upon and praises? Is it meaningful praise or does it just make for good copy? Words are cheap and easy. Again, it’s what you do that counts.

There’s an old saying in business and politics: You dance with the one that brought you…

If some other notable companies engaged in this sort of behavior, they would be publicly flogged. I’ll leave it to the reader to speculate on who those notable companies are.

My request of the Google Angular Team is a simple one – stop with the secrecy. Get the community involved. I’m not saying there has to be design by committee. That’s never a requirement in OSS. There should however, be an opportunity for the public to review and comment. Whether you implement that feedback is up to you. The public has a good way of showing its support or lack thereof. There are many individuals and organizations that not only need time to evaluate, they are owed that time. That is part of the compact. That’s how you earn and retain trust.

The public has put its collective trust in Angular. The Angular Team should return in kind.

Posted in OSS | 28 Comments

Quick easy steps to grab your build artifacts from Visual Studio Online

If you haven’t checked out Visual Studio Online yet, you are missing a lot! I’m in the midst of producing a video series on how to use Visual Studio Online for WintellectNOW. Don’t have a WintellectNOW account? No problem. Enter my promo code PETERSEN-14 and get 2 weeks of unlimited free access.

If you are using Visual Studio Online and have begun to use the hosted build controller, you may be wondering how to grab your build artifacts. Deploying to targets such as an Azure Website is simple. However, there are times when all you want are the raw build artififacts (dll’s, exe’s, html, css and js files, etc). How do you get those?

As it turns out, it is pretty simple!

One of nice new features with Visual Studio Online is the new REST Api.

I’ll leave it to you to sort through the Api reference. The one I want to key on is the Api call to get the list of builds:

GET: https://{account}.visualstudio.com/defaultcollection/_apis/build/builds?api-version=1.0-preview.1

The following is an example


{  
   "value":[  
      {  
         "uri":"vstfs:///Build/Build/36",
         "id":36,
         "buildNumber":"Test-Build-One_20140902.1",
         "url":"https://{account}.visualstudio.com/DefaultCollection/_apis/build/Builds/36",
         "startTime":"2014-09-02T12:40:31.583Z",
         "finishTime":"2014-09-02T12:42:08.483Z",
         "reason":"manual",
         "status":"succeeded",
         "dropLocation":"#/119161/drop",
         "drop":{  
            "location":"#/119161/drop",
            "type":"container",
            "url":"https://{account}.visualstudio.com/DefaultCollection/_apis/resources/Containers/119161/drop",
            "downloadUrl":"https://{account}.visualstudio.com/DefaultCollection/_apis/resources/Containers/119161/drop?api-version=1.0&$format=zip&downloadFileName=Test-Build-One_20140902.1_drop"
         },
         "log":{  
            "type":"container",
            "url":"https://{account}.visualstudio.com/DefaultCollection/_apis/resources/Containers/119161/logs",
            "downloadUrl":"https://{account}.visualstudio.com/DefaultCollection/_apis/resources/Containers/119161/logs?api-version=1.0&$format=zip&downloadFileName=Test-Build-One_20140902.1_logs"
         },
         "sourceGetVersion":"LG:(no branch):b792b3c303982b6be3e6105c3e587307fd35381a",
         "lastChangedBy":{  
            "id":"f21f35aa-5c28-462a-91cb-e077e30e0dbd",
            "displayName":"Elastic Build ({account})",
            "uniqueName":"LOCAL AUTHORITY\\Elastic Build ({account})",
            "url":"https://{account}.vssps.visualstudio.com/_apis/Identities/f21f35aa-5c28-462a-91cb-e077e30e0dbd",
            "imageUrl":"https://{account}.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=f21f35aa-5c28-462a-91cb-e077e30e0dbd"
         },
         "retainIndefinitely":false,
         "hasDiagnostics":true,
         "definition":{  
            "definitionType":"xaml",
            "id":17,
            "name":"Test-Build-One",
            "url":"https://{account}.visualstudio.com/DefaultCollection/_apis/build/Definitions/17"
         },
         "queue":{  
            "queueType":"buildController",
            "id":2477,
            "name":"Hosted Build Controller",
            "url":"https://{account}.visualstudio.com/DefaultCollection/_apis/build/Queues/2477"
         },
         "requests":[  
            {  
               "id":36,
               "url":"https://{account}.visualstudio.com/DefaultCollection/_apis/build/Requests/36",
               "requestedFor":{  
                  "id":"874bcfb5-80fe-4a9f-ac62-25bb3487769f",
                  "displayName":"John V. Petersen",
                  "uniqueName":"{account}@gmail.com",
                  "url":"https://{account}.vssps.visualstudio.com/_apis/Identities/874bcfb5-80fe-4a9f-ac62-25bb3487769f",
                  "imageUrl":"https://{account}.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=874bcfb5-80fe-4a9f-ac62-25bb3487769f"
               }
            }
         ]
      },
      {  },
      {  },
      {  },
      {  },
      {  },
      {  },
      {  },
      {  },
      {  },
      {  },
      {  },
      {  },
      {  },
      {  }
   ],
   "count":15
}

The item you want to pay attention to is the drop node’s downloadUrl Property:

"drop":{  
   "location":"#/119161/drop",
   "type":"container",
   "url":"https://{account}.visualstudio.com/DefaultCollection/_apis/resources/Containers/119161/drop",
   "downloadUrl":"https://{account}.visualstudio.com/DefaultCollection/_apis/resources/Containers/119161/drop?api-
version=1.0&$format=zip&downloadFileName=Test-Build-One_20140902.1_drop"
}

If you are already authenticated, entering the downloadUrl into a browser will result in a downloaded zip file that contains your deployment artifacts.

There are alternative ways to authorize – which you can find documented here.

That’s it – Super easy to grab your built application artifacts!

Posted in Uncategorized, Visual Studio Online | Leave a comment

Exceptions exist for a reason – use them!

C# and all CLR-compliant languages support a fantastic facility to ensuring code quality. That facility is the Exception. Sadly, it is an often under-utilized facility. How many times have you seen code that checks for an object’s validity? If, like me, you are part of the “Fail Early” school, then the Exception Class is your best friend. By fail early, I mean that as soon as possible, without any interaction from my code or any additional code, the system will abend. Of course, if your classes can throw exceptions, it means that your code will have to handle exceptions. Bear in mind that the try…catch block does come with an overhead cost that *may* impair performance. The key to look at is is what value are you getting for that cost? And – is whatever performance penalty there may be managed and negligible to the user.

It’s not enough to throw exceptions. Rather, you need to throw the right exception and in many cases, you’ll need to throw a custom exception. With a specific exception, you have a better chance of ascertaining exactly what happened. Only as a last resort will you want this:

   throw new Exception("Some other, unaccounted for exception");

Note: when possible, use the built-in exceptions that are already in .NET. For more detail on the base exceptions in .NET, refer to this link: http://msdn.microsoft.com/en-us/library/z4c5tckx(v=vs.110).aspx

Often you may want to create a custom exception:

    public class MyCustomException : Exception
    {
        public MyCustomException() : base("My Custom Exception")
        {

        }
    }

It’s worth noting in the constructor, you get access to many properties – some of which you may want to initialize:

Practical Exampleexception_image1

The following is an example of an approach that you may wish to follow and adapt as necessary:

    public abstract class MyBaseException : Exception
    {
        public  MyBaseException(string message) : base(message)
        {
            HelpLink = "http://www.myhelplink.com/helptext";
            
        }

        public override string ToString()
        {

            return string.Format("{0}{1}{2}{3}", 
                base.ToString(),Environment.NewLine,
                "For more help on this error: ",HelpLink);

        }

        public void Log()
        {
            Console.WriteLine(ToString());
        }
    }

Note: In this particular example, no need to worry about serialization as there are no custom properties.

One of the nice things about the base Exception Class is that it has a usable ToString() method. Nevertheless, it is missing some additional information that could be useful. This is why there is an override for the ToString() method.

With a base exception class in place:

 try
            {
               throw new MyCustomException("My Custom Message");
            }
            catch (MyCustomException ex)
            {
                ex.Log();
            }

Here is the output:

exception_image2

Hopefully, this post has given you some ideas on how you can effectively use exceptions in your applications.

Posted in C#, Exceptions | 10 Comments

Accessing Visual Studio Online from YOUR Azure Account – Now we can with this new PaaS offering

In case you missed Brian Harry’s announcement – we can now either link existing Visual Studio Online (VSO) instances OR we can create brand new VSO instances and control them through the Azure Portal. The problem before was that there had to be a 1:1 correspondence between VSO an a Microsoft Account. If you’re managing your own projects, that is likely not a problem. If however, you are in an enterprise, having a direct dependency on a Microsoft Account doesn’t work.
The good news is that today, we can associate VSO instances to an Azure Subscription.



image2

Creating a new VSO instance is easy:

image3

Note: if you want, an Azure Active Directory instance can be associated with your VSO instance.

image4

And just like that, we have a new TFS instance courtesy of Visual Studio Online!!

image5

No more having to spend unproductive time installing and configuring TFS from scratch. In a matter of minutes, we can stand up TFS with Visual Studio Online. From here, you can elect whether you want TFVC or git for your source code control. From there, it is very simple to connect your Azure Website to your new repository in order to publish from the source code repository. Like the on-prem version of TFS, you can choose your process template: CMMI, MSF Agile or Scrum. With VSO, you can also create build definitions. For more info on what VSO has to offer, check out this site. For a comparison of features between Visual Studio 2013 (On Prem) and Visual Studio Online – check out this resource.

Posted in Team Foundation Server, Visual Studio Online | Leave a comment