Categories
Development

A Month With GitHub Copilot

As a follow-up to my last post a week in, I decided I’d post a small update with my impressions after a little more time. Overall, my opinion hasn’t really changed, but I’ve found a few places where Copilot is particularly handy and thought it worth pointing those out.

Where it Shines

Copilot is particularly good when you’re writing a bit of code that’s a common problem. For instance, I recently needed to implement a simple base64 string conversion in .NET. This is typically something I’d go to Google to look up the code for because I never remember (it’s a write-once and never look at again sort of thing).

I wrote my function definition (it’s an extension method):
public static string ToBase64(this string input)
Then opened the Copilot tool window and had it generate some options. I can’t remember if it was the first suggestion, but one of the options gave me both the ToBase64 and FromBase64 implementations. Perfect. So it saved me a trip to Google and a few minutes of coding time. Not a huge gain, but it’s something and was actually convenient. (Though on a side note, the inline suggestion wasn’t as useful.)

In addition, as I mentioned in my previous post, Copilot is pretty good at generating documentation. I can start a sentence and sometimes it’ll give me exactly what I want; though I have to do some editing about half the time, so overall it maybe saves me a few seconds each day.

I’ll occasionally use Copilot in unit tests, but typically I find myself writing those by hand. I follow some common patterns for my tests, and I typically set up templates for the common parts, leaving me with just the specifics that change with every test. Copilot isn’t as great at filling in those details. That said, it can sometimes be pretty helpful.

Where it Fails

I’m still not letting this thing generate more than a few lines of code. It’s still obviously following patterns instead of understanding anything about code and will regularly make up property names that follow a pattern but don’t actually exist on other objects.

It also doesn’t play nice with other auto-complete extensions. I might need to find a way to disable the inline suggestions, since it keeps conflicting with ReSharper (which I find more helpful in general). Along the same lines, I think I’ll need to change the shortcut used to fill in the inline suggestions, because I’ve found that I’ll sometimes fill in Copilot suggestions when I just meant to add a tab.

Finally, as I mentioned above, Copilot isn’t good at working from scratch. It can write code, but it’s always going to be modeled on existing code, so anything “new” is basically impossible unless it’s a common problem (the sort you’d look up a solution online for).

Final Thoughts

I think Copilot works in a few very specific scenarios. If you’re learning a new language, Copilot can accelerate that process, but you’ll still need to be mindful of what it generates. If you’re solving a common problem, it can generate that code for you, saving you the time you’d spend searching for the solution. If you’re writing code based on an existing pattern in your codebase, Copilot can do a decent job of mimicking it.

However, as a senior developer, most of my work isn’t cranking out code. Most of my time is spent designing or refactoring. I mostly work with languages I’m already familiar with. My time is spent working on the “new” or context-specific problems and not things I could find solutions for online.

If Copilot were a free tool I could turn on when needed and ignore the rest of the time, I’d use it everywhere. But at $10/month, I don’t think I’d ever purchase the individual subscription, aside from possibly for a month or two when learning something new. In my day job, I’ll use it if it’s provided, but it’s not something I’d push to have. (Unlike ReSharper, which is basically a requirement wherever I work.)

I’m still annoyed by a lot of the hype around Copilot (and LLMs in general), saying that developers will be obsolete or replaced by this technology in a few years. I doubt it. Being a developer is a lot more than typing code, and Copilot is only barely able to do that reliably. It might make some developers more productive, but I don’t think it will be replacing good developers anytime soon.

Categories
Development

A Week with GitHub Copilot

I’m very skeptical of the way current “AI” utilities are being pushed as “tools”. Everything I’ve seen so far makes it clear that they’re very fun toys, but since they don’t really “know” anything, they’re not authoritative or even trustworthy. I’m especially concerned because the companies building the software push the technology as a tool. And we’re already seeing them be abused.

But a few weeks ago, my boss asked the team about using GitHub Copilot. I rolled my eyes, expressed my dissatisfaction, but said I’d give it a try. (I at least want to have my fury informed by facts.) And having finally gotten access to Copilot, I decided I’d give it a try.

All my work is in JetBrains Rider (my favorite and only IDE), with the official GitHub Copilot extension. I’m working in an existing codebase, written in C#. (If it works well, I might try using it with some of the Angular front-end code.)

First Impressions

I got access in the afternoon on a Friday, so I didn’t get a lot of time to play with Copilot right away. I was interested in having it write a unit test for me: a simple test to verify a mapping was set up properly and working.

I wasn’t sure what I was expecting, but it failed pretty spectacularly, writing code that wouldn’t even compile (and Rider’s ReSharper plugin picked out right away). It was certainly trying to generate something useful, but it was obviously using the context of some existing tests, which obviously weren’t checking all the properties of the new mapping. Those tests were checking some of the properties, so the generated code wasn’t entirely useless, but it didn’t really save me much time when I had to come behind it and clean up. (And considering I have a regular expression I can use to convert the mapping code to test assertions with nearly 100% accuracy, Copilot looks even worse.)

I tinkered a little more in some other code, but results didn’t get much better; maybe about 20-40% correctness in the stuff it was generating.

Obviously, I wasn’t very impressed.

Second Impressions

I came back in on Monday with some new work I needed to do. My first task was pretty basic: an ASP.NET controller method to perform a search, taking a POST body with search parameters. We use MediatR to implement a mediator pattern in our code, but I already have a template for a request and handler, so I wasn’t going to bother having Copilot take a stab at that.

I started out creating the search request model, and I could tell Copilot was really trying. As this was an empty class, it didn’t have a lot of context to work with, but it was obviously checking some code in nearby files, because it was generating nearly-accurate names for properties as I added type information. When I pulled up the tool window and had it generate a bunch of options, they were very complete, but also very wrong; generating tons of properties for things that I’m pretty sure don’t show up anywhere in our code. That said, it looked like it was trying to generate a decent search request model, so I guess I’ll give it partial credit.

When adding the code for the MediatR handler and the actual SQL search query, it wasn’t particularly useful. The generated code was typically almost right, but generated property names that don’t exist.

I decided to give it a shot at generating tests for the query, and it finally showed its usefulness. It generated two tests that were actually pretty decent, fully covering the code but missing some edge cases. I did a little cleanup, added a few more tests, and called it done. I hate writing unit tests for SQL queries, but it saved me some time here and did most of the heavy lifting. I did some refactoring afterwards to extract some utility methods, and when I tried generating more tests, it actually started using those new methods (since they were now in use in the file), which is nice to see.

Another thing I’ve found that it’s better at handling: documentation. When I’m writing documentation in my code, it’s better at using the context to come up with a decent comment. (I guess that’s not too surprising: the context gives it everything it should need, and LLMs are great at generating text.)

Something I feel like I need to point out here: it’s slow. Copilot isn’t running locally, so it has to go ask the server to generate suggestions, which takes a lot of time. ReSharper is all running locally and has knowledge of the entire codebase, so it generates better results faster, and doesn’t need “AI” to help it do its job. Unit testing is a similar issue, where I’ve seen tools years ago that could generate more complete test coverage without “AI”. That said, if you truly don’t know what you’re doing, maybe it can help.

Learning How It Works

I spent some time over the next day or two reading up on how Copilot works. I already knew it’s basically “Chat GPT for code”, and I already understood the basics of how LLMs work (basically using a bunch of probabilities to “guess” the next word in a sentence). What I didn’t know was how Copilot learns about code it has no access to – our repository isn’t in GitHub.

Turns out the IDE plugin sends a bunch of context with the requests to Copilot. The context includes the code from the file you’re editing along with code from all your open tabs, so the more tabs you have open with relevant code, the better the suggestions get. This is how I typically work, but now that I knew this is what Copilot was using, I started keeping more tabs open when working on code.

Third Impressions

I feel like I was hitting a peak through the rest of the week. Copilot was occasionally generating useful code, but it was still painfully obvious it knew nothing about my code; it was just generating text that “looked” like it fit. I used it to build some SQL views and just like C#, it generated SQL that referred to tables and columns that didn’t exist.

I find I have to be more vigilant when working with Copilot. Whereas ReSharper uses context to provide suggestions that actually fit in with existing code, Copilot will often generate complete gibberish.

Final Impressions

I suppose I’m starting to find a place where Copilot can come in to play, but I’m not as enthralled as some people seem to be. Context is critical to make it work well at all. On an empty file, Copilot will just generate random text that looks like it might belong, but given enough context (via comments, member names, and code in open tabs), it starts generating somewhat usable code.

I see Copilot advertised as “Your AI pair programmer”, and maybe that’s part of the problem. It’s like working with a junior developer that doesn’t know anything and will never learn. I’ve always hated pair programming because it’s so much slower than how I normally work, and Copilot isn’t really any different. I have to spend a lot of time evaluating what it suggests instead of just writing the code I need written.

That’s part of the problem: code has strict formatting. It’s not like natural languages where you can get words out of place or skip certain things and have the same (or at least similar) meaning. Copilot doesn’t actually understand code: it doesn’t know what access modifiers or data types are; it doesn’t know what a variable or method or class is. They’re all just words and all Copilot “knows” is that some words often follow other words.

The place it might work best is when you genuinely don’t know what to do. Maybe you’re working in a new language, and Copilot can help fill in the gaps. Maybe you’re working on a method to perform a simple task and Copilot can save you some time searching. But I find these are short-term or one-time tasks and the majority of what I do is generating code to solve specific business problems; things you can’t just pull code from an open-source repository to solve.

And maybe that’s what it comes down to: Copilot is great for poor developers. Those who write repetitive code; those who never innovate or improve. It’s what worries me most about these AI “tools”: they turn everyone into the lowest common denominator, while simultaneously making them think they’re geniuses.

Categories
Development

Cloud Blogging

Time for an update on my adventure in cloud hosting my blog. It’s been less than a week, but I think I’ve found a clear winner. (For my purposes, at least.)

Cost

To run my blog, I need a VM to serve it, some disk storage, and a DNS to point my website at it. The total costs in Azure and GCP come out something like this:

AzureGCP
VM$9.50
(with 1GB storage)
$13.80
(with 30GB storage)
Storage$0.00 (included in VM)$0.00 (included in VM)
DNS
(1 zone, 1M queries)
$0.90$0.60
Total Monthly$10.40$14.40

By those numbers, GCP is more expensive. However, both Azure and GCP offer a free tier. Unfortunately, Azure won’t let you use a custom domain for a free-tier application. And since “shawnweaver-blog.azurewebsites.net” just doesn’t roll off the tongue like “blog.shawnweaver.com”, I want to use a custom domain, which means Azure’s $10.40 cost is basically the minimum. GCP, on the other hand, doesn’t have this restriction, making the total cost of the VM and storage $0.00, leaving only the $0.60 for the DNS, which makes GCP the clear winner. (The paid-tier VM from Azure is obviously more powerful, but I don’t need that power, so it’s a moot point.)

In addition, GCP charges for use whereas Azure charges per application. This means that if I have my blog set up in an app service but leave it turned off all month, I still pay the whole $9.50. With GCP, I’d be charged nothing for the VM if it wasn’t running (I’d pay only for the storage). This just seems ridiculous and I’m not sure why Azure works that way.

GCP lets you set budgets and alerts as well, to help make sure you don’t blow your budget by accident. Azure appears to have some cost management features, but they’re currently limited to enterprise agreements (support for other plans is supposed to be coming soon).

On top of all this, GCP also has something called a “sustained use discount” – the longer something runs, the less you pay for it. This seems especially targeted at VMs that run constantly, though it applies to anything. As long as I’m using the free-tier resources, this won’t really matter, but if I ever want to play with some new technologies, it might come in handy.

Usability

Both Azure and GCP offer a lot of the same options, so I’m not going to compare them individually. Instead, I’m going to focus on some of the little things that I’m actually interested in.

Azure seems to have some more power in the UI; I don’t need to drop to a command line to do some common tasks. GCP requires a command line for anything beyond the basics. Both Azure and GCP have a cloud console where you can perform all sorts of actions, and they both have a nice customizable dashboard to monitor whatever you want.

Azure and GCP both have a pretty easily navigable interface, though Azure makes it very easy to just start adding something new; GCP takes an extra click or two. They both have a marketplace full of ready-made resources (like WordPress deployments).

The mobile apps for Azure and GCP are pretty similar, but GCP’s seems more robust. With Azure’s mobile app, you’re limited to checking the status of resources, starting and stopping resources, and using the cloud shell. In GCP’s app you can do all those things, but can also manage those resources much better – you can create disk snapshots and download files from storage, for instance (and I assume the other products have similar control through the app). I also find GCP’s app generally easier to navigate; in general, it just feels a bit more modern.

Summary

I prefer how GCP works and charges for use. It fits my budget and how I plan to use everything – short bursts of use and development instead of running constantly. A few things were easier to set up (like hosting static web pages with a custom URL), and I can expect any tinkering I do to cost a lot less than it would on Azure.

What about AWS?

I looked at their pricing calculator and cringed (it seriously looks like it’s from the 90s). And when I clicked their “Free Website on AWS” example and it showed my estimated monthly cost of $594.97, I was pretty much done (why their “free website” preset uses XL VMs, I don’t know). Feature-wise, it looks like AWS is more-or-less equivalent to Azure and GCP, and their pricing sounds more like GCP than Azure. I was just immediately turned away by their site and cost calculator.

Side note:

Why does everyone have to use their own terms for all this stuff? Azure has “App Services”, GCP has “Compute Engine”, and AWS has “EC2”. They’re all cloud VMs. It’s incredibly annoying trying to figure out what’s what when moving between these services.

Categories
Development

Google Cloud Platform

I decided while I was tinkering with Azure, I’d give Google’s Cloud Platform a test, too, and see which is best for what I need – simple, easy hosting for a low price, with some room to play and grow (for a similarly low price).

Looking over Google’s pricing, it seems like I should be able to host my blog for pennies since it’s so low traffic. The big difference between Azure and GCP seems to be how they charge. Google charges based on use – their billing model indicates that they charge for a minimum of 1 minute, and after that charge per second of use. At worst, it looks like I’d pay $15/month to use my blog VM for the entire month; which is extremely unlikely. Azure, on the other hand, charges for the application, so regardless of how much an application is used, you pay as if it ran the entire month. Regardless, Google provides a nice $300 credit for the first 12 months, so I can figure things out as I go. (Azure provides a $200 credit for the first month, so Google’s credit is much nicer here.)

I’ll say that Google’s management site is a lot prettier than Azure’s (more modern-looking with Google’s Material Design), but basically has all the same stuff. Like Azure, they had a WordPress template I could install and start using right away, and I migrated my content across to it. Setting up a redirect seems to work as well, and unlike Azure, GCP doesn’t appear to have any limitations on what projects can be given a custom domain. If that’s the case, I’ll likely be moving entirely to Google soon, as I have several small projects I’d like to give a custom address under my domain name. On Azure, I’d be paying about $10/month per project – whether that project is running or not – just to be able to give that project a nice URL.

The only issue I’ve had with Azure was with their pricing as I ran my blog and learned more about how they charge. Since they charge per resource (application, database, storage, etc.), you have to pay whether you use it or not. Google, on the other hand, appears to only charge based on use. If your application is bursty like my blog (only needs to run when I’m actually working on it, or when people are reading it), Google seems like the superior platform cost-wise. In addition, Azure forcing me to use a paid-tier just to give my application a nice URL on my domain is difficult to accept. With Google, my basic-tier VM has an IP address I can set up with an A record and everything just works.

It looks like Google has just as much capacity to scale as well. I can upgrade or downgrade my blog VM by stopping it and changing the machine type.

My assumption is it has to do with how the “clouds” are handled between Azure and GCP. With Azure, it seems like you’re dedicating specific hardware resources to an application (even in their “shared” tiers), while with GCP you’re making use of a big “cloud” of vCPUs and memory. If that’s the case, it seems like GCP is more like how I’d expect “cloud” hardware to work. It makes Azure feel a bit old-school… Though this is still all automatic hardware management and virtualization distributed across multiple regions, so they’re both very state-of-the-art in that regard.

I’ll post again once I’ve had more chance to compare the costs between GCP and Azure. Right now, GCP seems like it’s going to be the winner. I’ve only been with Azure a few days, but I’ve already racked up $12 in costs by running application services I wasn’t using (under the false impression that I wouldn’t pay if I wasn’t using them), and using a MySQL database resource for my blog (which could have been run in the application service for no extra charge). It’s only been a day with GCP, but my total cost so far is 20 cents. If the trend continues, I’m still only looking at maybe $6 with GCP, which would be on the high end since I’m spending a lot more time on my blog with all this tinkering I’m doing…

Categories
Development

Moving to Azure

I’ve been thinking about moving my website to Azure for some time now, and when my web hosting provider decided to move me to a higher-priced plan without telling me, I decided it was a good time to make the switch. Moving my blog here has been incredibly easy, and Azure opens up a lot of opportunities for development.

Even as a developer, Azure can be a bit intimidating. Azure is an incredibly powerful platform; you can run VMs, run bits of code at large scale and blazing speeds, you can create triggers to, say, process files when they’re uploaded. That’s really only scratching the surface, but my point is there is a lot you can do. Microsoft has packed all that in a relatively easy to use interface, but it can still be difficult to navigate at first simply because there’s so much.

Fortunately, there’s a WordPress app service template that you can set up in a few clicks. Within seconds, you have a fresh WordPress install. Moving my content to the new site was easy because WordPress is awesome and has a fantastic backup and restore tool built-in.

Getting my DNS settings configured properly took a little longer, but I managed to fumble through it. After I created a DNS zone in Azure and switched to their DNS servers, I was able to configure all my entries within Azure, so I don’t even have to go to my domain provider to fiddle with them anymore.

All this power and the possibilities don’t exactly come cheap. My previous hosting plan was about $10/month (which they were raising to $12/month), and hosting just my blog on a shared plan (so I can use my domain name) will cost about $9.50/month, not including the database (which I can probably move to save some additional money). There’s a free tier you can use for development and testing, but you can’t use a custom domain to access the application (you have to use your azurewebsites.net address), so it’s not the best option if you’re trying to host something more publicly available.

Overall I’m satisfied with this initial step into Azure. The chance to work on some more interesting projects will be fun, and the ability to easily scale if I ever develop something successful is nice. I’ll try Azure for at least a few months and see if it’s the right place for me.

Categories
Development Projects

Spaaaaace!

It’s been a while since I’ve touched Unity; mostly because work has been rough and my desire for non-work coding has been nonexistent. But I’ve been toying with some ideas and I wanted to actually try doing something new, so I downloaded some updates, cracked open Unity, and started a new project.

That's a moon.

My close friends know how absurdly crazy I am about space in general. On top of that, I’ve been wanting to use some “real” math again (business applications rarely involve much math). So on Friday, after talking with a coworker a bit, I decided I was going to program a solar system simulator this weekend. And while the result isn’t exactly what I wanted, it works and it’s something I can expand on.

A pretty moon with its planet in the distance

To start, I knew I’d need something to generate pretty planets, and I recently saw a planet kit advertised on Unity’s Twitter feed. It does a good job in general, even with the free version of Unity. There are several places where some more advanced effects don’t work (thunderstorms on planets, city lights at night, and the lighting quality in general in a few places), but from what I can tell, it’s just because I can’t use Unity’s deferred lighting mode. The stars in particular don’t look as great as they could. After getting the new planets imported, I set up a quick PlayMaker script to generate a simple solar system.

A ringed gas giant. Likely far too close to that blue star.
Likely far too close to that blue star.

When I say “simple solar system”, I mean just that: a random number of planets, with a random number of moons orbiting at random angles and rates. Took all of an hour. I didn’t even have to program orbits – the planet kit I bought actually has a script that makes planets and moons orbit. Not realistically, but it’s something, at least.

These planets are too close to that star.
Definitely too close to that star.

My next goal is to write a more complicated generation script that’ll generate a more realistic system, and some new code to handle orbits more realistically. After doing a little reading on how Kerbal Space Program implemented orbital mechanics (patched conic approximation), I’ll probably start with something similar since that’s a much simpler model. I’ll also take some time to read the entire Wikipedia entry on orbital mechanics and see if I can recall some trigonometry.

Categories
Development

Business Apps Aren’t User-Friendly Because of Business

I read a great article a few weeks back about making business applications user-friendly. The basic idea is that most business applications are designed to serve the needs of the business and not the needs of the user. It’s a fantastic article and if you develop business applications, you should read it.

I completely agree with the premise: if we want business applications to be pleasant to use, we need to spend time on interaction design, learning from users, prototyping and iterating. In my experience, however, the “business” just doesn’t care about how user-friendly the software is. And unfortunately, they’re paying the bills.

There are downsides to this way of thinking. Applications that aren’t user-friendly bother people. They erode their happiness and make their work a chore. It slows them down, and that actually has a direct impact on the bottom line; it’s just difficult for managers to understand that.

As developers and designers, we can solve the problem. We’re perfectly capable of providing a piece of software that not only gets the job done, but does it quickly and in a way that users enjoy using. But doing that takes time, and at my current employer, the dictate is: “Just get something out there. We’ll make it nice later.” But I know as well as they do: later never comes. So we end up stuck with applications that are so unfriendly that even some of the developers hate using them.

I work for a company where research is a priority. We’re developing an application to replace their existing research application, which basically drives the entire research side of the business. We’re fixing data problems, improving the interface, and trying to make it more user friendly. But this time constraint means I can’t produce my best work. When I’m crunched for time, I can’t spend the time it takes to produce an application that works exactly how the user needs it to work. Instead, I have to cater exclusively to getting the job done. The business’ needs take priority over the user needs.

Until businesses realize their own employees’ needs are more important than just shoving a tool in their hands, this isn’t going to change. There’s little a developer or designer can do to change the mindset. All we can do is make small pushes in the right direction when opportunities arise.

Categories
Development

You should write more unit tests

I write a lot of unit tests. There have been some days when I spend more than half the day just writing tests. I haven’t fully adopted test-driven development, but I know the value of unit tests and want to make sure my code is covered. There have been times in the past when I haven’t written as many tests, and when I finally do take the time to cover that code with tests, I inevitably find some problem with it. Writing tests not only helps me clarify the process of doing something in my code, but it makes my code more easily extensible and testable.

We’ve hired a few new developers where I work, and they always react with astonishment when I tell them how many tests I have and how much code is covered by those tests. This is a bit upsetting. They’re writing tests, but most of what they write are integration tests: tests that make sure the various bits work together. They don’t have many tests that simply make sure some small piece of code is doing what it should. Their integration tests are good to have (I’m not arguing against integration testing), but unit tests are quick to run and provide a safety net to maintain a healthy codebase and track down bugs when they happen.

To illustrate my point, let’s take some pseudo-code for a real-life example:

public bool CanEdit
{
    get { return this.CanPerform(AuthorizationAction.Edit); }
}

This is a simple C# property that returns a value indicating if I can edit the class it’s attached to. The server tells me what I’m allowed to do, and I’m simply exposing that through this property. A unit test might look something like this:

public void CanEditTest
{
    var obj = new Thing();
    obj.Authorizations.Add(AuthorizationAction.Edit);

    Assert.IsTrue(obj.CanEdit);
}

This all looks pretty basic, and you’d be right: it’s about as simple as things can get. One might ask, “That code is very simple and straightforward. Why do I need to write a test for it?” Well, consider that I write a lot of these authorization properties and they all follow the same structure, so I do a lot of copy/pasting and rename them. Occasionally, I’ll forget to change the action I’m checking for in the “CanPerform” part. This test makes sure I don’t forget, and since this test runs every time I check-in code, it makes sure I never accidentally break it.

A coworker once told me, “it looks like you’re making sure you don’t change anything.” I was a little surprised. Of course I’m making sure I don’t change things, I thought, I know it works. I don’t want to change it. Refactoring is fine, and wouldn’t break the test. But if we completely change something – say we completely change how authorization works – these tests should fail. You’ve changed how something works, of course you’ll need to update the tests.

Part of the problem is that most developers seem to think of unit testing as extra work, but that’s not the case. It’s a developer’s responsibility to make sure they code they write works. If you’re not writing tests for it, you can’t be confident that it actually works. You can’t be confident that someone else will make a change that breaks it. And you can’t rely on a QA tester to catch everything you missed. Be a good developer: write unit tests.

Categories
Development

Why time matters in software development

I don’t often write posts about my work life, but I feel like I’ve been complaining to my coworkers and superiors about the same few problems over the past few months and I wanted somewhere to write some things… So here we are.

I’m going to start with a simple premise:

Good software is as much an art as a science. Good art takes time.

This is something few people outside of the software industry seem to understand. I don’t write commercial software, but I write line-of-business applications for my company. We’re a small team – currently around 10 developers – and we’re tasked with writing new software to solve various problems and help everyone work more efficiently. We tend to do fairly well, but the team is so small the work comes in faster than we can complete it, and the focus has shifted from doing things right to doing things fast. While I can understand the need to get things done quickly, I’m disappointed that we’re not trying to create good software anymore. I want to take pride in my work; I want to be able to show someone something I’ve worked on and be happy to say “I made this”. When someone comes to me and tells me my software is causing problems, that’s a failure on my part.

There are many cliches that apply to software development, but one I use repeatedly is the 80-20 rule, because it can be applied almost anywhere. For instance: “20% of the work takes 80% of the time.” I usually call that 20% “polish”. This was a bad idea: now my boss wants to cut out the “polish” and just leave things part-done or with a terrible user experience.

I’m sure I’m not the only developer in a situation where getting things done fast is more important than getting things done right, and I’m sure I’m not the only developer who would prefer to take the time to create a fantastic piece of software over just shoving something out there.

Think about most of the software you actually enjoy using. It’s probably not a line-of-business application. It’s more likely to be something social, something easy to use, something that just works. I’d be willing to bet the teams creating that software didn’t start off saying, “We’re going to publish this in a year.” They probably started with a simple idea, implemented it, then iterated on that idea, gradually improving it over time until it was ready. If they had arbitrarily chosen a deadline, it wouldn’t be as great as it is. And we’re not talking about software that doesn’t make money. We’re talking about software from places like Facebook and Google and Apple and even occasionally Microsoft (I like Excel).

Categories
Development

Unity is amazing

So I decided to toy with a new idea for a simple game. In about an hour and without a single line of code, I managed to create this:

OK, so it’s not much, but I’m amazed I was able to create this is practically no time (I had to learn how to use a new tool, create the tunnel model, and create the animations) and without any code work.

Tunnel Racer v0 (pre-alpha!)
(Use the A/D keys to turn left or right.)

I used a product called PlayMaker that I bought on sale a while back. PlayMaker makes it easy to create finite state machines (FSMs) that react to almost anything, and what little I did here didn’t require any code. All I had to do was create a few events that were triggered by key presses, then a few other events that were triggered when animations ended. There are only three states – Idle, MoveLeft, and MoveRight, and two objects responding to the commands – the ship (the bomber model from BattleGrid), and the tunnel itself.

Creating this was fun and a good change of pace, so I might try to flesh it out into a real game. It’s a lot simpler than BattleGrid, so maybe I can get it done in a much shorter time frame.