Skip to main content

Building attractive CLIs in TypeScript

So you've come to a point where you want to build nice CLIs. There's a few different options for building CLI's. My two favorites are oclif and commander.js. I tend toward leaning to commander, unless I know I'm building a super big app. However, I've really enjoyed building smaller CLIs with commander recently.

Continue Reading

Speeding up CraftCMS on Heroku

So, I previously blogged about how we hosted CraftCMS on Heroku. When we built the marketing site for Quala the twig templates were built for maximum authoring flexibility at the cost of some TTFB problems. We knew this going into the project. In an ideal world we would use GatsbyJS to build the frontend, but we very limited in time. When we went live, we saw a dramatic improvement to First Contentful paint, but a huge decrease to Time To First Byte, averaging at 1.3 seconds.

Continue Reading

Serving AMP Pages with Dotnet Core

I remember when (Accelerated Mobile Pages) first came out, and it was very restrictive and weird. I think this ultimately hurt the AMP Brand Beyond this, several companies have built AMP experiences which haven't always been the best experience. I do however think AMP pages always load extremely fast. A lot of that is just the constraints of AMP. Last night I put my blog posts on AMP for a laugh, and it was much easier than I thought it would be.

Continue Reading

About

I am a software engineer. I currently work at Quala. I have worked on all area's of the stack. From a sysadmin, network engineer, backend developer, and frontend developer. I've helped build some extremely large scale websites such as Vistaprint and CarGurus. I have a passion for high performing software, devops, and front end. I am a huge fan of JavaScript, C#, Golang, and Rust.

I blog about my general pains building software.

Why Terrible Dev?

Honestly, I was a network engineer, and I worked with many developers. They'd often blame bugs on the network, or the database. I heard a lot of it works on my machine. I started the TerribleDev twitter handle where I posted some things developers said. Then when I became a developer, I figured I'd just make it my handle. These days, I'm now blaming the network 🤣.

Continue Reading

How to host a javascript monorepo on Heroku

So I've been using monorepos for some time, and recently I've gotten a lot of questions about how to host them on Heroku. I figured I'd give you the simple guide. There are two basic scenarios. The root of your git repo has your yarn/npm workspace, or you have a folder inside of a gitrepo you wish to use.

Continue Reading

Hosting Craft CMS on Heroku

So, like most early startups, Quala (where I currently work) bought into a Wordpress site to sell our product, probably before it really existed. Flash forward, we have customers, and we're on a path to building a platform to change the game on customer management. The Wordpress site was terrible for performance, and core web vitals. None of us know Wordpress, and barely know any php. We had huge drive to rebrand ourselves, but to do that we needed to edit the Wordpress theme 😬 or use something else.

Continue Reading

Building a remote cache server for Turborepo

Turborepo is a tool that came across my virtual desk recently. Monorepo develoment has been around for a long time. This is a strategy where all of your code remains in one repository regardless of services. A lot of people use monorepo's even for microservices. The huge upside is to keep everything in one place, which allows for development efficiency, such as grepping an entire codebase for specific keywords. A quick example would be a top level directory which has child directories that each contain an npm package, unlike publishing these packages, you access them locally as though they were published.

Continue Reading

Hosting dotnet core on Heroku

I've been getting back into building scrappy little web apps for my friends. On top of this, I recently joined a startup and getting away from Enterprise class software has made me make a huge mind-shift. In the recent past when I wanted to build apps I was thinking Kubernetes, Helm Charts, etc. However, in small app, and startup land reducing the barriers to ship is very important.

Continue Reading

Accessibility Driven Development

I've been working at CarGurus.com for the last 2 years or so. One of the biggest journeys we've been undertaking is to take accessibility far more seriously. However with an engineering team way into the triple digits it gets harder and harder to scale accessibility knowledge.

Continue Reading

5 web perf tips for 2019

As more and more of the world is getting online, a larger part of the internet community is using the internet on lower powered devices. Making websites fast is becoming paramount. Here are 5 tips to improving you web page's performance

Continue Reading

Rebuilding this blog for performance

So many people know me as a very performance focused engineer, and as someone that cares about perf I've always been a bit embarrassed about this blog. In actual fact this blog as it sits now is fast by most people's standards. I got a new job in July, and well I work with an absolute mad lad that is making me feel pretty embarrassed with his 900ms page load times. So I've decided to build my own blog engine, and compete against him.

Continue Reading

Managing and catering events

A few weeks ago I ran a 3 day event at Vistaprint. We had many engineers fly into our organization. These engineers are from both other countries, and even other companies. We essentially had a mini 3 day conference, and I had to run it! I learned quite a bit about running a conference.

Continue Reading

Taking time away

In case you haven't notice, this blog has not gotten updates much this summer. Some people have even noticed the overall lack of activity on my GitHub. Emails have gone, several weeks unanswered.

Continue Reading

Making alexa skills in .net

Ok so I've been in the alexa skills market recently, and obviously amazon wants you to use AWS Lambda for your skills. If you are like me, you have a ton of stuff in azure app service (the PaaS of azure). Azure app service supports nodejs, java, python, and of course .net. The two sdk's amazon ships (node, java) do not tie in with a web stack, and are obviously thought of as being used with Lambda.

Continue Reading

Exploring the dotnet cli

Now that dotnet core tools have been released I thought it would be good to look into the dotnet cli. This is a new command line interface to build, manage, compile and run dotnet core based applications

Continue Reading

VS 2017, and dotnet core tools. Today will be a historic day

Today marks the release of Visual Studio 2017, and with it the final release of the tools for dotnet core. This means as of today you can build, test, and deploy an application completely supported by microsoft. Not just the runtimes, but the tooling as well. The CLI for dotnet core has been finalized, and its awesome. The csproj system has been revitalized. New csproj's can be created, and are fully compatible with the old. Visual studio 2017 has finally released. This is probably the greatest version of visual studio ever created. Finally VS has gone from a slow, archaic editor, to a fast moving IDE. An IDE with a DevOps-First Cloud-First mentality. An IDE ready to tackle today's modern challenges.

Continue Reading

StatsN a modern statsd client for dotnet core, and dotnet 4.5

tl;dr click here

When we talk about capturing metrics in applications. One server/service that constantly is in all conversations monitoring, is statsd. Incase you have never heard of it, statsd is a udp/tcp server that you send your in-code metrics to. These metrics get aggregated by statsd, and are forwarded to various backends. Some backends are services like librato or sumologic. Other times you are sending metrics to time series databases such as graphite or god forbid influxdb.

This boils down to in code you can say "log whenever this block of code is hit" or say "measure how long this function takes to execute". These stories come together to form pretty graphs, and rich alerts. All of this enabled by statsd.

Continue Reading

Parsing cli arguments in dotnet core Console App

tl;dr view this gist

So its 2016, and we are still making console apps/cli's. In fact I would say there has been a surge in popularity of these types of tools. I think we have come to the realization that buttons on forms are not automatable, and that the command line doesn't have to be scary.

I recently started writing an app in dotnet core, which is the new runtime for dotnet. In the past I have often used command line parser, but as of this writing it does not support core.

I was really lost trying to find an arguments parsing library when I realized the dotnet cli was open sourced.

After much struggle, failing to bingle. I started ripping through the Entity Framework, and dotnet cli's code hoping to find a gem. Thats when I stumbled across a diamond. You see many dotnet projects use Microsft.Extension.CommandLineUtils to do cli parsing.

Continue Reading

Dockerize that old webforms app

So now that Windows server 2016 is generally avalible for the first time ever windows users can now use containers. Ok, so what exactly are containers? Well more or less they are virtual operating systems that share the same kernel as the host OS. In regular VM's the hardware is shared between machines, but containers go a step further and share the kernel of the OS. Why does this matter? Well because you are sharing an existing kernel that is already running, your startup times are instantanious. To put this in perspective, this is virtualization at the OS level.

On Linux, containers have been a thing for a long time. This technology is called LXC. Docker itself is a layer ontop of various container platforms embedded in operating systems.

Continue Reading

Use dotnet rc2 with appveyor

dotnet CLI is currently in RC2, and while the train is fast approaching RTM, most tools are still catching up. dotnet seems to have a documented cli based install for every platform except the good ol windows. That being said getting a windows based install/build is possible.

Continue Reading

Bringin' turbolinks to .net

For a while now I have been playing with rails, and rack webapps. If you are not familiar with these, they are webservers created in ruby. One of the features I ran into during my journey into ruby land is Turbolinks. Incase you are not familiar, Turbolinks is basically a simplified pjax, with a lot of flexibility. When you click on a link in a page with turbolinks, the link action is hijacked and the target page is loaded via ajax. The result of the ajax call (which is presumed to be html) will replace the document of the body tag. At the end of the day its a technology to load your server side pages via ajax.

Continue Reading

The wix toolset tl;dr

So recently I have had the (some would say unfortuate) time learning wix. Specifically I am trying to better understand windows installers, mostly to install webapps into IIS with MSI's. This is mostly due to the unfortunate situation where I constantly do work for windows things. I would recommend reading the docs on the wixtoolset website, but if you are still having a trouble understanding how the tools come together, you can read this.

Windows Installer Xml toolset or Wix for short, has been around since the early 2000's. The toolset is one of the great mechanisms to create MSI's. A while back I blogged about how to use them to install ssl certs in IIS. Until recently when I fit the tools together in my head, I couldn't figure out how they work. So here is the tl;dr

Continue Reading

Commiting a new file to git, through the github api

Recently I have been working on an application that basically has a github bot (aka user) fork a repo, commit some files, and submit a PR against someone's repo. When it came down to actually making a new git commit through the github API, I had quite a hard time. I figured it out with some help from a ruby tutorial, and now I'm going to show you how to do it.

Continue Reading

Bringing configuration management to the underconfigured

I spend much of my time at Vistaprint just being a normal developer. In fact its over 75% of what I do. I am a Web Developer, however with my background in ops I have spent more and more time at Vistaprint doing configuration management, and coaching other teams how to approach the subject.

Continue Reading

Just got a Nexus 5x

Just got a new phone last week, and its one of the new Nexus phones

I recently bought a Nexus 5x from our favorite search engine, Google. Incase you didn't know I am an Android fanboy, to really specify I am an apple hater. Outside of iPhones my options are *droid or Windows Phone. Every time I have used someone else's windows phone I am honestly stricken at how great it is, but I stuck with what I know and love, which is android.

Why Nexus?

As you all are aware there are a large number of Android devices in the ecosystem that is android. The flagship phones of this year seem to be the Galaxy S6, LG G4, and various other phones that are not Nexus phones. The competitor to these phones in the Nexus line would have to be the Nexus 6p; Which is larger, and more powerful than the 5x.

UI

My huge gripe about non nexus phones, is that they are not really Android. Well they are, but they usually come with a ton of weird apps, and a non-stock UI. The UI that google ships for Android stock is fantastic. The OS looks crisp, clean, and somewhat futuristic without being tacky. Other UI's such as TouchWiz cannot even compete, and yet these manufacturers insist on adding this experience to their phones.

Updates and security

There is no doubt that Nexus phones get updates much faster than non-nexus phones. Incase you were not aware, Nexus phones get their updates pushed directly from google. These phones often receive more updates than non-nexus phones, which have to get updated though the manufacturer, working in tandem with the carrier. Google around yourself, and find out which phones got updated to Lollipop, or even Marshmallow. Most of the nexus phones have been kept up to date.

The updates are not just about features. Updates contain security fixes. At the end of the day a Smartphone is really just a computer that can place phone calls. Like any other computer, smartphones are susceptible to hacks and can be compromised. Updates can often contain security enhancements to reduce the surface area of attack to these phones, allowing your personal information to be stored safely.

Review?

Ok so I should actually review the phone right?

The Nexus 5x is the sequel to a phone (Nexus 5) that was a cheap phone that really competed with phones twice its price. The 5x fails to live up to that a little as the specs are at best what a good phone was last year. That being said this phone is extraordinary in both performance, size, and quality.

The 5x is about as fast as most Android phones. The camera is a 12 MP camera that takes pretty solid pictures. The battery life seems to last roughly 24 hours for me just doing daily activities on the phone. The fingerprint scanner can wake the phone from sleep, and is located in the centre on the back. This is a very convenient place that is usually where my index finger lands. This Nexus phone gets GPS locks every time, and never seems to stop performing beautify. Other phones such as the 6p would probably out perform it if you sat them side by side, but day to day you wouldn't notice any slowness in the 5x. Overall I'd say its a good buy for the value.

The future

I'd really love to see a day when manufacturers would stop putting custom UI's ontop of Android. I'd love to see a day where all Android phones get updates direct from google. Until that time we must live with what we have, which is a weird market place in Android land. iOS users do not have to worry about such things, and I believe the same needs to happen for Android.

Continue Reading

Migrating Ghost blog to hexo

I recently ported my ghost blog to hexo, and it was pretty easy.

Checkout my other hexo blogs:

Getting Started with hexo

To get started with hexo run the following commands:

  • npm install -g hexo-cli
  • hexo init
  • npm install

This will drop many files, and folders. The primary one we are going to talk about is the _config.yml. You will want to start by filling out the _config.yml file. Name your blog, give a descripton, etc.

Porting your blogs over

To get your data over you will need to go to this url: http://yourblog.com/ghost/settings/labs/ and click the export button. Place the json file at the root of your hexo blog, then run.

  • npm install hexo-migrator-ghost --save
  • hexo migrate ghost NameOfYourExportFile.json

Your posts should drop in the posts folder, but the tags will need fixing. Open atom (or another editor that can do find replace in a directory) and replace tags: | with tags: in all the files.

Now that it is done we need to fix the paths to your images. Download your images (if you are using azure you can get them via ftp), and place the folder in the source directory.

Now run hexo server, browse to port 4000. Your blogs should appear.

Backward compat. urls

We need to make some modifications to make sure the urls are backward compatible.

Set the tag_dir to tag, in ghost the path to tags is /tag.

if your post urls were just /Title then put :title/ in the permalink setting. Otherwise adjust the urls for the proper date format.

RSS

You will want to have an rss feed. You will want to npm install hexo-generator-feed --save

You can then add the following to your config.yml

feed:
    type: rss2
    path: rss
    limit: 0

If you were like me you registered your ghost rss feed to /rssinstead of /rss.xml. I have no perfect answer to fix this, but I used azure's Url redirect to redirect /rss to /rss.xml.

<configuration>
  <system.webServer>
    <rewrite>
          <rules>
              <rule name="SpecificRewrite" stopProcessing="true">
                  <match url="^rss$" />
                  <action type="Rewrite" url="public/rss.xml" />
              </rule>
          </rules>
  </system.webServer>
</configuration>

If you are using github pages you can use the jekyll-redirect-from gem.

Continue Reading

Why I moved from Ghost to Hexo

Blogging right? I can't believe I somehow stuck with it all this time. Even when I took a long break I still kinda blogged. I got started after being ~~convinced~~ inspired by a coworkers passion to start blogging. To say the least he, and I have very similar tastes, and he turned me on to ghost, and the ghostium theme. After a year and a half of Ghost blogging I have left Ghost.

Continue Reading

How the ASP.NET team made the web framework I have always wanted

So I know I do a lot of blogging about C#, or JavaScript, but I actually do a lot of nodejs apps as well as other languages. For a very long time I have not found the stack of my dreams. .NET has always been very close but there were multiple things about the app model that I was not a fan of. I think NancyFX has been the closest framework to my dreams in .NET land.

Continue Reading

Wiring up client side logs into c#/node.js logging frameworks

Around a year ago I joined a new team where I work, and this team was starting to undertake a full rewrite of their code. We were going from a full c#/mvc app to a tiny c# api, and a very big SPA.

Early one one of the huge things to do was to make sure that our JavaScript error logs could land in our Log4Net infrastructure. I started to write something to do just that, and as I was coding I quickly realized this was less trivial that it sounded. We had something internal we could use, but it was tied to a lot of other code that we didn't want to pull in.

I started Bingling around and I stumbled across jsnlog. JSN log lets you quickly wire up your client side logs to your server. I have been able to get PR's into the code base and the guy behind it has been very friendly to me when I have had questions.

Continue Reading

Moving from beta 7 to beta 8 in ASP.NET 5 (MVC 6)

So Beta 8 was recently announced, and I thought I'd update DotNetMashups to beta 8.

In case you havn't been paying attention, recently it was announced that helios was no longer a thing. Helios was the loader for ASP.NET 5 in IIS. Instead they are using the http Platform Handler to proxy the connections to kestrel.

So I thought that this was going to be a difficult update. I loaded the announcements repo in my browser and got to work. You can view the Pull request here.

Continue Reading

Why I avoid switch statements in c++

So one thing that kills me a lot in c++ is the switch statement. As you all know switch statements look like the following.

auto s = 0;

switch(s)
{
   case 0:
      doSomething();
      break;
   case 1:
     doSomething1();
     break;

}
Continue Reading

c++, when should I use the stack or heap?

So I have started learning c++ recently, and as a .NET/Java developer I always want to write the following code.

var s = new myClass().

In c++ you have to manage memory yourself, there is no garbage collector.

If you do not use the new keyword var s = myClass() you will create that class and assign it to on the stack.

Any stack variables will be cleaned at the end of the block, so in this case s will be cleaned. However if you use var s = new myClass() s will be allocated onto the heap and must be deleted, otherwise memory leaks will occur.

To clean the variable you must call delete when you are done with the variable, this will cause the memory in the heap to be cleaned.

Continue Reading

Less Pager duty, more Yak duty. My (Strange) DevOps (rant) story.

Growing up I always wanted to work with electronics, and as soon as I could work I was working with a computer. I currently work as a Software Engineer at Vistaprint. I work on the Gallery team, which is an agile development team that works on our platform to display products in a gallery (hence the name). Before I joined the gallery team, I spent most of my career doing ops things.

Continue Reading

How .ToLookup() Saved me 4 hours a week, and got me some high praise from my boss

I recently created a small utility that is ran in jenkins to create indicies in ElasticSearch.

The first versions took around 5 hours to index our massive data into elasticsearch. This was still better than the 9 hours, our old solution took, so no one was complaining.

One of the major slowdowns was a .Where() on a List<T>. When I wrote the tool this TODO was written

//TODO: use some kind of key lookup here, but we need non-unique keys and Dictionaries are unique only

Continue Reading

Avoid the Godclass

I joined a team earlier this year, who own a core set of pages on our website. This part of the site makes us buckets of money, and was written by people whom are clearly smarter than me. However every platform is not without its quirks.

Most of the code is C# MVC but a lot of the problems with the platform are more historic architecture, and less .NET specific.

Continue Reading

Razor Websites, lightweight C# web coding

I was exploring around github, and I stumbled upon an interesting project called Miniblog which was a lightweight blog engine written in c#. The thing that immediately stood out to me was the lack of a .csproj file.

As I dug around the code I realized this was not a Web App, which most of us were familiar with, but a websites project. I then suddenly realized that the whole thing only used razor!

I am a huge fan of Nancyfx because its much more lightweight than the MVC framework created at Microsoft. To say the least I am a massive fan of small tools, and micro frameworks. So when I realized this whole thing was powered by razor only I was immediately impressed.

I decided to dig around on the internet to see if anyone else was talking about this. I found out quickly that it has been possible for some time, but I didn't find many references about it.

The one thing that bummed me out about the Miniblog example was that it was not a web app. You can use nuget packages will websites, but you cannot make references to other projects in the solution. This was a problem for me, and unlike websites, web app's are precompiled which reduces application startup time.

Continue Reading

Navigating the JavaScript waters in 2015

In this last year I have done much more JavaScript development than I have before. The landscape, and tools have exploded over the last few years. Gone are the days of JQuery widgets, and come forth have advanced virtual dom libraries, JavaScript servers, and multiple package managers. Along with new language features.

Continue Reading

Saying goodbye to my VPS (..and my opinions of cloud providers)

I have used Linode for quite a long time now. My blog was hosted on linode, as was my StarBound server. My linode was the CentOS Pet I always wanted. Full of manual Fail2Ban configs, I make sure I fed my VPS every day. I even used cowsay to give me a cool message from my pet every login.

The major reason I moved my things away from Linode, was not the devops story itself. I could have stuck with linode, and used chef or something to manage my former friend. I decided to host everything in Azure Web apps. Now before I give you my long ramblings why I like azure; I must tell you. I put everything in azure, because my MSDN gave me free credits. There was no huge scientific analysis behind this. The simple fact that I got free money in Azure was the only reason why I started using it.

Continue Reading

Hosting NancyFx with OWIN on IIS

So I was quite confused about hosting Nancyfx on OWIN under IIS. Parts of the Nancy wiki led me slightly astray.

Here is the simple guide.

Make sure you Install the following nuget packages (if you havn't already).

Continue Reading

New Series: Windows myths debunked!

Over the last 8 years the demand to scale has ever increased.

We have gone from curating machines like your favorite pets, and started spinning up, and destroying VM's at an ever increasing pace.

As engineers the Unix like platforms, have always been easier to work with. Personally I enjoy linux, I love package managers, I love ssh, and configurations are much easier. That being said, lately I have been interacting a lot with Windows servers.

Continue Reading

Excel Interop cannot open my file!

So a while back I made a website that uses the Excel interop (long story). Since I made it a while ago, the IIS configuration is not automated, and must be done artisanally.

Recently I have been working on moving it to a new server. I installed Excel, and the website.

Continue Reading

Must Have Tool: NDepend

Code quality tooling has become a bigger, and bigger industry. Tools like Resharper, and stylecop have been telling us how bad us human beings are at developing code.

The one problem I have always had with these tools is they dont go above and beyond to help you understand your code at a higher level.

Continue Reading

Watching the Watchers: Monitorama PDX 2014 Day One

I am here in lovely Portland Oregon attending Monitorama. Monitorama is a 3 day open source monitoring convention.

Monitorama had catered food, and drink. The food was plentiful and delicious, and the drinks were amazing.

There were 10 talks, I have made a quick summarization below. I don't have time to write in detail about each one, but I am sure you will get the gist from the basic summary.

Continue Reading

ChromeOS: Gateway to portable productivity

Up until the last few years the only devices on the market were all full operating system work horses. However the majority of us would easily sacrifice functionality for portability. This statement has been backed up by the increase of market demand for tablets and ultrabooks over the years.

Continue Reading

Capturing Client Side JavaScript Errors

Capturing client side errors in my opinion is really good. For starters you can troubleshoot your client side implementation, but you can also make sure a js change did not break certain pages.

Below is a really simple, yet effective way to capture errors. Eventually you may want to implement something more advanced, but this will get you out of the gate.

Continue Reading

Xamarin For Android The Conclusion: (Part 4 of 4)

Well verdict is in boys, and girls. Personally, I thought the platform needs to mature more. For those people who can pay for the business edition ($1000 USD/developer), and really prefer c#; then go for it. For most of us that can either do c# or Java; you may want to stick with Java.

C# vs. Java for Android

Essentially Xamarin is a competing product with using Java. I felt that the hefty price tag, and the lack of free support means the ROI for Xamarin will be low.

If Xamarin provided more in the way of automation tools, and documentation; it would be the clear winner

The fact is going straight to Java for most people is probably a must. Even if you are more comfortable with c#, finding help on the internet is much easier. As the platform matures, and more features are added hopefully things will change.

License cost deterrent

One of my biggest gripes with Xamarin is the very inflexible license schemes. You can get by with the $300 indie edition, but it is pretty clear they want people to go the $1000 business edition route.

The biggest deterrent to the Xamarin platform is the high cost of licensing.

With no sliding scale prices based on organization size, or project scope Xamarin is a tough sell (especially for open source projects).

Student Discount

Xamarin, does provide a student discount. They give 90% off for enterprise edition, and for those of you whom go to school this is almost a must buy. You could probably make it back with this simple formula.

Flappy bird-like animal + Mario pipes + admob = $$$

Verdict

Personally I like Xamarin platform. The ability to re-use code for multiple mobile platforms can be helpful. For most of us tinkerers out there Android Studio is probably enough. For serious businesses, with a major focus on c#; Xamarin is probably the prefered method of development.

Room for improvement

Before I can fully back Xamarin I'd like to see better componants that provide more mobile platform abstraction, increased automation tools (visual studio macros could help here), and better documentation. From the activity of there web pages, I suspect all of these things are coming.

Continue Reading

Xamarin For Android The Ugly: (Part 3 of 4)

I had some problems with Xamarin. Somethings are ugly, but with plastic surgery almost anything can become beautiful.

Components

Xamarin has its own software packages available for download. I tried a lot of them out, some were good others not so much. One of my biggest gripes was that Google Play Services currently has a bug that makes builds really slow. Other packages were either genius, or were simply unimpressive. The components have their own package manager, and it does do a decent job of keeping them in order. I have to admit though Xamarin has its own set of componants that do in-app billing, and access phone data without having to lift much of a finger.

Moving at the build speed of Play Services

Component Documentation

A real put down is that only some of the components have adequate documentation. For instance for me to get admob working with play services; I had to look at the Java documentation, and try to figure out how its supposed to be done on Xamarin. This wasn't to difficult, but admob is well used. I would have assumed the documentation would have covered it, but couldn't find anything.

Visual Studio Designer

The Visual studio designer for Android at first seemed like the best thing since sliced bread! I was able to get a UI up and running in no time. Making my app work for tablets, and mobile phones alike was simple. However, once in a while it would be stubborn, and stop working. I'm not sure if it was something I was doing, but I felt like it would bomb out and I would have to restore the XAML file to continue.

The editor really isn't great for designing ListViews, working with fragments, or making something that will scale easily. Often it made things exact pixel widths instead of using dots per inch. To keep it short, I still had to do plenty of editing of the source manually (which was not too bad). Making the theme stick on the default view was a pain, until I realized that I could ignore the editor, and decorate my MainActivity with the theme I wanted to use.

[Activity(Label = "Label", MainLauncher = true, Icon = "@drawable/Icon", Theme = "@android:style/Theme.Holo.Light")]
Continue Reading

Xamarin For Android The Bad: (Part 2 of 4)

Xamarin is a very good platform, but like everything it has parts that are not so great.

Documentation

One thing that was really hard for me, was to find documentation that was newer than 2012. Android has made great strides with Ice Cream Sandwich, and Jelly Bean. New features such as fragments have breathed life into the platform.

The Xamarin documentation provides examples even with the newest features, but there is something about it that feels lacking. Almost like it was thrown together at the last minute. They have been doing webcasts to improve the knowledge out in the wild, but googling the answer to your problem just won't do. Part of the problem is that most developers write in Java, and only bigger companies can afford the hefty license fees that come with full support.

The user community was helpful at times, but I often found myself wandering though GitHub hoping my answer could be found in some mystical repo; Eventually having to study the full implementation to find the answer I needed.

Finding help

Although Xamarin has a forum where helpful users help each other, there are not nearly as many people coding on Xamarin than regular Java. Figuring out how to get something complicated working, was a nightmare. I'd look at a Java implementation, and then try to translate it into its Xamarin counterpart, which sometimes was far removed than the Java code. There are some examples of Xamarin for android out there, but nothing that really delves deep into manipulating the inner workings of the phone. I saw this especially when trying to edit contacts programatically. Xamarin support seemed helpful, but far too expensive for most freelance developers. This was a pretty huge put-off. If I went the Java route my questions would be answered with a simple search of stack overflow.

Boilerplate

Like most things Java, Android requires a lot of boilerplate. For a developer like myself, whom avoids Java this was a problem. I would have thought that Xamarin would have abstracted out more of the boilerplate than they did. On the one had, having my code look somewhat familiar when I see Java examples was nice, but on the other hand because the API is still different often the Java versions would not be close enough to fully help. My main problem with this, is if I really wanted to write boilerplate I would have used the Java libraries myself. They did make a start for this by generating the manifest file automatically, but I feel it needs to go further to fully mature this platform as a viable alternative to Java.

Continue Reading

Xamarin For Android The Good: (Part 1 of 4)

Introduction

This will be a series of blog entries where I discuss the Xamarin platform for Android.

I really enjoy C# programming language (JavaScript second)....Linq, Generics, anonymous methods, and Visual Studio are just some of the reasons I like it. Xamarin is a platform that gives you the ability you to write Android applications in c#.

When I heard about Xamarin I naturally, wanted to give it a shot. Having tried Eclipse, and Android Studio for android development I was no idiot when it came to the platform. So I got a license, and did nothing with it for six months, until a few weeks ago. After only 3 days I created Ultimate Gravatar Sync. An app that sync's your contacts gravatar images to their picture in your phone.

C# with no compromise

The Xamarin platform uses mono, and some kind of voodoo bindings to the Java libraries to make it work. I wont go in depth, but the native features of the C# language are there to use. I never felt like my hands had been tied, that all of a sudden I couldn't use a library that is normally part of the GAC (Global Assembly Cache). When I needed multi-threading, System.Threading was there, and when I needed to use C# Generics I had no issues implementing them.

Xamarin execution

Manage Android Manifest files

One of the things that blew me away about the platform, was that I never had to add anything to my manifest file. For those of you whom don't know, Android requires an XML config detailing the permissions you require, and the classes you have in your application.

Simple decoration such as:

[Activity(Label = "Label", MainLauncher = true, Icon = "@drawable/Icon")]

Will Generate in your manifest file as:

<pre>
<activity
android:label="Label"
             android:name=".logoActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </pre>

Adding permissions is also easy:

[assembly: UsesPermission(Android.Manifest.Permission.Internet)]

Using Java Libraries

Xamarin provides some kind of crazy visual studio project, that will essentially provide c# bindings to Java libraries you require. To bind Simply create a Java Binding project, adding the .Jar files, and then build. Watch the magic happen. They do note that you sometimes need to do some configuration for certain libraries, however I had no issues with the one I tried. On top of that if you really needed to, you could access the Java Native Interface for even more power.

Continue Reading

...A blog about technology, how original(not)!

Introduction (who am I?)

Hello, Tommy here. I work at vistaprint. I spend most of my time monitoring a website, writing internal tools, and doing things some would consider "Devops".

I'm not very qualified as a blogger, quite frankly my English skills are terrible.

My perspective is not very unique at this point. The industry is full of developer/sysadmin employees, and devops has become an industry movement. This movement has created in my opinion a 'trendy effect' to what some would consider little more than a buzz word.

Continue Reading