101 – Setting up your environment

Physical environment

Many people consider their development environment to be their PC and the software on it. They overlook the actual physical environment. Take some time to put some planning into this. Odds are you’re going to spend 8-12 hours a day in this space, so it really does matter.

Get the ergonomics right. If your chair isn’t comfortable and promote the right posture for the long haul you’re going to suffer. If your monitors aren’t at eye level you’re going to suffer. If you’re on a laptop put it on a riser so the screen is at eye level and use an external keyboard and mouse or trackball. Use a decent keyboard like the Microsoft ergonomic models to avoid issues like carpal-tunnel.

Spend a couple bucks on extra monitors of decent quality. A couple extra monitors pay for themselves in improved productivity: Not wasting lots of time opening and hiding various pallets due to limited screen real estate etc. Plus you’re probably going to have Visual Studio, email, a task list and a web browser that lives on Google as its home page all open at the same time. That’s not accounting for a device emulator if you need one or two. You can eat up screen space in a heartbeat as a developer.

Quality monitors such as a Dell with good specifications and wide viewing angle will save your eyes and reduce aggravation when compared to low-end monitors like Acer that can only be viewed if you are at the exact right angle; especially if you rotate one of the monitors to portrait so you can have a tall monitor for viewing lots of code at once (hint, hint).

Pet peeve: Developers belly-aching about spending money on software or other aspects of their environment. Get over it. Everyone else pays for their tools: Mechanics, plumbers, electricians.

Windows PC

The Windows machine is where you’re going to spend your day. Make it comfortable. Use a machine with as much processor, ram and SSD space as you can afford. Use a fast SSD for boot and applications. Leave the applications and all their required files on the C: drive. Don’t try to get fancy with moving them to a second drive etc. Microsoft applications and Visual Studio in particular don’t handle that well. Use a fast second drive dedicated to Visual Studio code. Drives are cheap these days. A drive with one purpose in life (your code) shouldn’t be a problem. Do not use the default Visual Studio project path because it’s a freaking mile long and will cause a lot of your files to exceed to file path length limitation. Something like “d:\\” is a good place. Don’t bury your projects. “d:\\Code\Projects\Clients\2016\A\AdvarkMoving\” is going to be a problem. If you’re that busy with work then use contract/ticket numbers: “d:\\556677\” is much better.

If you’re going to be using an Android emulator instead of a physical device you’ll need more RAM. Personally, I’d suggest a physical device as soon as possible. Cheap android tablets are everywhere. Spend $50-100 on one. Your cellular provider will probably GIVE you one with a new phone purchase or contract extension; which you know you are going to do anyway.

All flavors of Visual Studio 2015 include Xamarin, including the free community edition. However, when you run the Visual Studio installer the options are not ticked on by default. Choose ‘Custom’ then go through the options turning on all the options for Cross Platform. Personally, I prefer to download the offline installer and run it from my own drive, than using the web installer. But that’s me. If I ever have to re-install I already have the ISO and don’t have to wait (again) for a 6gig download. This is a really good approach if you are on a metered connection such as satellite internet with monthly data limit.

There are a few plug-ins for Visual Studio that make your life easier. Again, you’re spending 40+ hours in this environment so it’s worth making it nice.

  • XAML Regions, free
  • XAML Styler, free
  • VS Color Output, donation ware.
    • Spend a couple bucks and make a donation to the guy. It’s really nice to have key output standout, like errors be in red. Five bucks for this less than your morning latte.
  • Visual Studio Spell Checker, free
  • Automatic Versions
  • Clar MEF Component Cache
    • This free extension is really important because once in a while Visual Studio can get confused about this cache and give you various problems. This extension forces the cache to clear and thus avoid the issues.
  • ReSharper, paid but so very much worth it
  • TabsStudio, paid but really worth it.

Macintosh build machine

Once you get everything set up, you’re not going to spend a lot of time on the mac. It can be a Mac Mini that you keep on a KVM… It can be a paid Mac time-share… It exists as a build machine to keep within the licensing requirement for Xamarin, and to produce the native Swift code via Apple’s XCode IDE.

  • Update everything on the Mac
  • Install XCode
  • Run updates again
  • Install Xamarin from their installer
  • Run updates again.
  • Run Xamarin Studio and have it check for updates
  • Connect your iPad or iPhone.
  • Run XCode
    • Make a new default project. Run it on the iDevice.
    • Follow all the prompts about activating developer mode etc.
    • Provisioning the device will take place as well.
    • Provisioning tends to be a pain in the arse the first few times. There are articles on-line specifically about this that go into great detail. I’m not going to repeat all of that here.
    • Once you have all that working you should be able to make Xamarin.Forms solutions on your Windows PC in Visual Studio and run them on the Mac. Here’s what I do when I start a new solution in Visual Studio.
      • Make a new XCode solution on the Mac settings the company name and program name: com.mycompanyname.supercoolprogramname
      • Run it on the iDevice just to have it fetch provisioning permissions for that name.
      • Close it.
      • Now on the PC in Visual Studio make your new Xamarin.Forms solution.
      • In the properties for the iOS project set the name to exactly match (case sensitive) the one you just made on the mac. Since the device is already provisioned for that product you’re golden.
    • As a tip though: Provisioning on a per-software basis is case sensitive. Just get in the habit of doing everything in all-lower case and it won’t be a problem.

Networking

Wi-Fi is inherently unstable even under the best of conditions. Have your mac and your PC on the same network switch, preferably on either static IP or reserved DHCP so they always have the same address.

The Xamarin’s Mac Build Agent in Visual Studio will offer up all the Mac’s it finds on your network by DNS resolved name. Don’t fall for it. Add a Mac and give it the actual IP address.

Before going any further, make sure all this works a few times with a bunch of ‘disposable’ default applications. Be sure you can make 10 projects and have them all work, getting a solid grasp on the process.

Other tools

ToDoList

There are lots of programs out there for keeping you on task and helping you keep track of your to-do list. Maybe you’re good with just a simple Notepad document or you love spreadsheets. Maybe you have something else you already use. Personally, I’m a huge fan of ToDoList by AbstractSpoon. First of all its free for a very well equipped lite version. It works in node-subnode paradigm which to me reflects how most projects go. And it has built-in time tracking for each line item: Just click the stopwatch when you start working on that item. This is invaluable for all of us but especially for new developers that aren’t good (or honest with themselves) at estimating their time to complete something. It’s really easy to think it only took an hour to make up a graphic, but forget to include the two hours of back-and-fourth with the client for approval on the final version. If you can’t estimate a task you can’t estimate the entire job and suddenly the kid at McDonalds is making more for taking out the trash than you are as a freelance developer.

Move in

Once you get all that going, take some time to move into your environment. Get all your Visual Studio palettes where you like them. And browser. And Outlook/Office. And other tools. Even with 3 monitors I still have programs stacked behind each other. Do it in a way that makes sense: Have your browser on a monitor not covered by Visual Studio so you can read from one screen and type on the other. Put Word and the code page on the vertical monitor because you can see the entire document that way. Etc.