Author Archives: Jeff Magill

CODEM: Compile Once Debug on Many Using HoloLens and Visual Studio

Microsoft’s recently announced HoloLens, the world’s first augmented reality headset, to be powered by Windows 10, and some never-before-seen hardware technology, like an HPU (Holographic Processing Unit), offers completely new opportunities for software developers and computing in general. One such opportunity for software developers I have termed CODEM: Compile Once DEbug on Many software debugging and testing using HoloLens and Visual Studio.

Visual Studio is already a solid multi-platform, multi-device, integrated development environment (IDE). But currently when you compile a project you can’t target multiple platforms or devices simultaneously and run them side-by-side to see how things are coming along. With HoloLens, coupled with advanced Visual Studio emulators, this could indeed be the development environment of the future.

Imagine developing a Windows Universal App targeting desktops, tablets, and phones and being able to display their emulators side-by-side during testing. “Well, the phone and desktop look good, but the layout isn’t adjusting properly for 7″ to 8″ devices.” With HoloLens you’d be able to have say three emulators running side-by-side, visualized against a large whiteboard. You could reposition them, resize them, and interact with them as if they were physical devices running a release build. Something’s not quite right? Fix, recompile, retest and make sure all of your targets are working properly.

My ultimate vision is that at compile you’d be able to not only target multiple devices simultaneously, but also multiple platforms. Imagine having a Windows phone, Android, and iOS emulator running together, side-by-side, with different sized screens for each, targeting either specific phone models and/or general screen sizes, and being able to interact with all of them through HoloLens.

Conceptually, CODEM seems to be a simple and obvious idea, but certainly it would take quite a bit of development to make this vision a reality. Nevertheless, history has proven that if a possibility is technologically feasible, it’ll happen. And I’m looking forward to the day CODEM becomes the standard for software development.

Code well, code often!

Free eBook, Microsoft Application Architecture Guide

As a new programmer, application architecture probably isn’t something that’s on your mind. Learning the syntax, the keywords, about objected oriented programming, and basic programming logic is hard enough. But at some point your programs will start getting large enough that architecture should become a concern, and Microsoft has a free eBook, Microsoft Application Architecture Guide, to get you started.

Below is a diagram from page 57 of the book that shows the basic structure of a well-designed application. The fundamental concept is this, that each “layer” of your application should be designed to work independently of any other layer. The reason being that if you have to make a change to one layer of the application it shouldn’t break something in another layer.

For example, let’s say you are coding up a simple calculator application as one of your first projects. It probably makes sense to you that you wouldn’t want to design the program such that if you made a mistake in one of your calculation methods, say adding numbers together, that you shouldn’t also have to rewrite the code that displays your number pad on the screen. And that’s the basics of application architecture.

While the deep technical aspects of application architecture might be a bit over your head in your early programming days, the high level concepts you can handle. So when you’re coding up your next program for a programming class or just for practice think about designing in layers.

Layers

 

 

C# Explicit and Implicit Variable Typing

There are typically multiple ways to do something in a programming language. And with C# there are two ways to set the type of a variable or object — explicitly and implicitly. Here is some code to demonstrate the two ways. I’ll explain a bit more after the code.

using System;

namespace ExplicitImplicitTyping
{
    class Program
    {
        static void Main(string[] args)
        {
            // Examples of EXPLICITLY setting the type of variables and objects
            string myString = "This is a string of characters";
            int myInteger = 12345;
            double myDouble = 123.45;
            Car myCar = new Car();

            // Examples of IMPLICITLY setting the type of variables and objects
            var mySecondString = "This is a string of characters";
            var mySecondInteger = 12345;
            var mySecondDouble = 123.45;
            var mySecondCar = new Car();
        }
    }

    class Car
    {
        public string Make { get; set; }
    }
}

 

Notice that the only difference between the two sets of declarations is that with the explicit declarations you use the type keywords (string, int, double, etc.), but when implicitly declaring the variables you use the var keyword.

So what’s going on here? When you explicitly declare a variable’s type you are telling the compiler which type to use for that variable so it can set aside a space in memory that is large enough to hold that variable. When you use the var keyword you are making the compiler figure out the type for you. If the compiler were human, and spoke English, it would say something like, “Ok, I see you’ve created a variable with the name of myString. And I see that you’ve set its value to a bunch of characters between two double quotes. Based on what I’ve been programmed to do, that fits the definition of a string. So I’m going to declare your myString variable as type string.”

My understanding is that the var keyword was implemented in C# for no other reason than to speed up code generation. “Hey, you’re using Visual Studio, so you must know how to program and set your variables, so we’re going to let the compiler do this little step for you by using the var keyword so you can get on to other things.”

One last thing. According to the MSDN documentation, an implicitly typed variable using the var keyword “…is strongly typed just as if you had declared the type yourself…”. That means that once the compiler determines and sets the variable type, the type will not change unless you cast it to another type. The is different than some other programming languages.

Happy coding!

Job Opportunities for Software Developers

Being a software developer is much more than writing phone and tablet apps. Below is a list of different development areas taken from the Microsoft Careers site and expanded a bit. By no means is the list exhaustive, but it should give you some ideas of the enormous opportunities that exist for developers, whether you want to develop as a hobby or you want to make it a career.

    • Business Software
      Consumer software is what you hear about most in the media, things like operating systems, phone apps, etc., but business software is a far larger market. Things like hosted IT solutions, information systems, supply chain management systems, inventory management systems, customer relationship management systems, financial management systems, etc. If there is a company, it needs software to manage every aspect of its operations.
    • Communications
      Skype and Lync are the two examples given on the Microsoft Careers website. I’m sure you’ve heard of Skype. Lync is a business-focused communications platform, including VoIP and video conferencing, messaging, and meeting management. But these are just two products from Microsoft. There are hundreds, if not thousands, of companies that have other solutions that are built to either compete with or enhance Microsoft’s own technologies. And that means development opportunities for you.
    • Developer Tools
      Developers use tools like Visual Studio and Blend to design and build software. But developers had to design and build the developer tools. Every programming language has developer tools, even if it is just a simple text editor. Software needs software.
    • Educational Software
      eReaders, math applications, art applications, biology applications, the list of possibilities with educational software are endless. And not only are the topics endless, but applications can be built for a variety of audiences (teacher or student) and platforms (PCs, tablets, and phones).
    • Entertainment Products
      Xbox and PC gaming are the two big areas here. Options include game development and other media solutions, like apps for the Xbox (SmartGlass, Netflix, HBO Go, etc.). And of course you could work on the Xbox development team. The Xbox needs software to run.
    • Health Solutions
      This bridges both the business market and the consumer market. Hospitals have major information management needs. That means software. And consumers are becoming more and more connected with their health, that means products like the Microsoft Band, software like Health and HealthVault.
    • HoloLens
      If you haven’t yet heard of HoloLens, you have to check it out. Virtual reality? How about augmented reality! If you want to develop the future, learn to develop for HoloLens.
    • Internet of Things
      With Windows 10, Microsoft is moving full-force into internet of things (IoT) development. This is going to change the technology world and offers you tremendous opportunity as a developer.
    • Kinect
      Kinect isn’t just for gaming. Kinect for Windows is being used in a wide range of applications. Check this out to get inspired.
    • Mobile Software
      Mobile software development is unique in that it brings together a wide range of technologies into a single device. With our phones we can make calls, email, text, instant message, listen to music and watch videos, take pictures, and use GPS to navigate. Windows Phone is Microsoft’s current mobile solution, but this is transitioning to Windows 10 with universal apps. This is my development focus and I think it offers tremendous opportunity.
    • Office
      Office is by far the most widely used office productivity suites in the world. As a developer, not only could you work on the Microsoft Office development team, but you could also work for a company that develops office add-ins to bring additional functionality to Office. Or you could focus on automating workflows by tying information systems to Office. There are lots of possibilities here.
    • Web Development
      From building websites to backend server technologies, there is no shortage of development opportunities in web development.
    • Windows Operating System
      Virtualization, networking, security, file systems, kernel services, storage, and device technologies: These core components come together to deliver the Windows experience, whether it’s on a mobile phone, a PC, or the web; at home, at the office, in a car, or anywhere in between.

The DRIP Method to Learning

This morning, as I was thinking through the process of learning to program, something hit me about how it all works, how we learn, particularly as it relates to languages. But fundamentally we learn everything using the same method. I call it the DRIP Method:

Do Repeatedly and Incrementally Progress

Do
To learn something, you must do it. It doesn’t matter what it is. If you want to learn to read, you have to read. If you want to learn to write, you have to write. If you want to learn to program a computer, you have to program a computer. There are no shortcuts.

Repeatedly
To learn something, particularly if you want to learn it well, you have to do it repeatedly. When you were learning to write, you didn’t write a single word and stop. You wrote the same word over and over and over again. When you learned to write a sentence, you didn’t stop with your first sentence. You wrote sentence, after sentence, after sentence. If you want to learn to program, you can’t write a single line of computer code and call yourself a programmer. You have to write and write and write until the fundamentals become second nature to you.

Incrementally
We learn incrementally. With a spoken language, it’s one word at a time. We say our first word as a baby. Then we slowly add words to our vocabulary. Eventually we figure out if we put multiple words together we can create a phrase or sentence that allows us to communicate effectively. This same incremental process applies to everything we learn. Expert, or even competent, status is never reached immediately or even quickly. It is a methodical process of doing something repeatedly and incrementally adding knowledge and skills to our competence repository.

Progress
By doing something repeatedly and incrementally adding new knowledge and competencies we slowly progress. We go from scratching our heads in confusion about the syntax of a programming language, to building our own code repositories, to creating well designed and useful programs.

I can promise you that at some point along your programming journey you’re going to get discouraged. It happens to the best of us. And when that time comes, just remember that you got to where you are using the DRIP method, and the DRIP method will see you through those difficult times. Do, repeat, increment, and progress, and one day you will be the expert you’ve dreamt of becoming.

Code well, code often!

Getting a C# Start

To learn anything knew, you have to start with the basics. And to develop for Microsoft technologies a good place to start is learning the C# programming language. Below you’ll find a couple of video resources that I personally have found to be very good. These aren’t the only beginner resources available, but I’ve enjoyed them, have learned from them, and highly recommend them.

If you’ve never programmed a single line of code before, don’t worry. You have a lot to learn, but it’s doable. Just remember that a programming language is no different than a human spoken language. You learn it one word (keyword) at a time with lots and lots and lots of repetition. And so it goes with programming. First you’ll learn the keywords and the syntax (the punctuation) and the mathematical operators (just like regular math). Then you’ll learn how to write lines of code (the sentences), and then blocks of code (the paragraphs), etc. Pretty soon you’ll be writing decent sized programs that do something fun and cool and useful.

My point is to not get hung up on everything you have to learn. Programming languages have gotten large and complex, but only because they have become so capable. You didn’t learn to write a best-selling book when you were 4 years old and you’re not going to learn to write the next operating system in your first year of programming. So give yourself a break. Sure, learn as quickly as you can, but don’t feel like you have to be a master programmer in a few weeks, months, or years. It’s not going to happen. Be realistic! Otherwise you’ll get discouraged and give up because you’ll convince yourself you can’t do it. And that’s utter nonsense. You CAN do it! And you WILL do it, if you stick with us here at WinDevsDotNet!

Personally, I learn best by listening, seeing, and doing. So here are two video courses to get you started. These are from Bob Tabor, the founder of LearnVisualStudio.Net. Lucky for us Microsoft has apparently contracted with Bob to offer a few of his courses for free. I hope they paid him!

C# Fundamentals for Absolute Beginners at the Microsoft Virtual Academy. I’m in the process of taking this course and so far it’s been great. Bob does a nice job of taking it slow and pointing out the “hows” and “whys”. He assumes you know absolutely nothing about programming. This series was recorded towards the end of 2013 and posted in early 2014.

C# Fundamentals: Development for Absolute Beginners over on Channel9 is also from Bob Tabor. This series is similar to the one above, but appears to have been recorded back in 2011. I remember going through this series a couple of years ago and really liking it. So I don’t think you can go wrong with either of these.

Check back soon for more learning resources. I am in the process of developing a learning plan for you to keep you (and me) on track. Comment below with any questions or comments, or follow us on Twitter and tweet away.

Develop the Future, Develop for Windows

I have to start off by saying that I’m a huge Microsoft fan dating back to the days of DOS. Call me a fanboy. I’m ok with that. I’m a big believer in what Microsoft has done over the years, and I’m even more excited with what’s to come with Windows 10. Let me explain. And let me explain why you should be as excited about developing for Microsoft technologies as I am.

Windows 8 was the beginning of the future for personal computing. For years we’ve talked about device convergence, but the hardware and software were not capable of fulfilling the dreams of the day. That is no longer true. Smartphones have converged mobile communication, navigation, entertainment, and some productivity into a single device. With Windows 8 and the first generation Surface Pro we were given proof that convergence is now feasible for fully-fledged personal computing. The power of a desktop in the form of a tablet. And with the Surface Pro 3, convergence has been proven to be capable of being incredibly functional, versatile, and downright gorgeous. Gone are the days of needing a separate device for each computing task. “Toasters and refrigerators” can harmoniously live together.

But Windows 8 was just the first step. Enter Windows 10. Windows 10 is true convergence. Currently, Microsoft has Windows, Windows Server, Windows Phone, and Windows RT. They may have others, I’m no expert. Each are distinct operating systems with a special purpose. There may be underlying shared code, but unified these OSes are not. With Windows 10 that changes completely.

Windows 10 will be a truly unified operating system designed to run on any device, from a server, to a desktop, to a tablet, to a phone, to the Xbox, to toasters and refrigerators. Functionality and the user interface (UI) will automatically adjust to the device. Install it on a desktop, you get desktop capabilities and a desktop UI. Install it on a phone, you get phone capabilities and a phone UI. Install it on a tablet…well, Microsoft has redefined the tablet. A limited functionality tablet operating system is no longer necessary. You get the point. You’ll be able to install it on anything.

So, why should you be excited about all of this? Well, aside from it being super cool, the reason you should be excited is that convergence will completely change how developers develop and open up a new world of possibilities. Imagine writing your apps once and having them run on any device capable of running an app. Imagine being able to reach billions of users with a single app that will run equally well on desktops, tablets, phones, and the Xbox. In just a few years, saying you’re a desktop, tablet, or phone developer will likely raise eyebrows of confusion, because you’ll be able to simply say, “I’m a Windows developer.”

This isn’t to say all of this convergence stuff will be easy. Surely there will still be device experts and flexible UI development will be much more important. But with a single, powerful, cohesive foundation from which to work, being a Windows developer is going to offer opportunities never before possible.

So join me! Let’s learn to develop for Windows and change the world!

Welcome to WinDevs .Net!

WinDevs .Net is a new community for developers of all experience levels that are interested in developing for Microsoft technologies, including Windows, Windows Phone, Xbox, Kinect, HoloLens, IoT, and everything else in the Microsoft stack.

I created WinDevs .Net for a couple of reasons:

  1. I’ve wanted to learn to develop for Windows Phone (and now universal apps) for quite some time, and
  2. I want to meet people with a similar interest in developing for Microsoft technologies so that we can learn from each other, encourage each other, and grow together as developers

You’re probably thinking, well, there are already tons of resources out there for learning all about Microsoft technologies, why WinDevs .Net? The reason is that I’ve not found a program yet that works for me. And I can’t be the only one. There has to be a better way. So, here we go.

I hope you’ll join me on this experimental educational journey. I think it’s going to be a great ride and I look forward to seeing what we can accomplish together.

If you have any questions or suggestions, email me.