Categories
Computer Science

Expect the unexpected

When you design software you usually have a few use cases in mind, in the case of EpsilonGit the use case I keep coming back to is a project lead who wants an overview of how his team is working and how they are using their version control software.

Back in second year when I developed The JavaScript Orrery my target audience was David Parker and the only use of the software was to impress him for degree credit.

A short while later I made a few small adaptations to package the orrery as a Windows Store (now called Universal Windows) Application. I thought a few people might enjoy watching the planets go around the screen, but didn’t really expect too many people to download it. To be completely honest, I mainly packaged it as an app to get points for the App Builder Rewards competition.

I haven’t touched the orrery, packaged as Solar System Simulation on Windows, for years. However, I wrote a little while back about someone who used it to teach their daughter about space, an unexpected use but a nice one.

Today I got an email from a student in Brazil who wondered if the software had a function to see planet locations at specific dates, as he liked the simple 2D graphics and wanted to use them to make a tattoo of the layout of the solar system on his birthday. Strange, but cool.

Unfortunately the Solar System Simulation (which is a gratuitous name — its in no way even close to a ‘simulation’) doesn’t support this function — but its a cool idea, and one I wouldn’t have thought of.

It might be fun to add it in one day, and see how popular some of the ideas I have would be compared to those that a user has had and wanted to be implemented enough to go to the effort to email me about it. I suspect the user submitted ideas might be more popular, because no one knows how well a customer users your product as well as a customer. But I might be wrong, it could be an interesting bit of research.

So, expect the unexpected uses of your software and services — both in positive ways, such as odd-but-exciting use cases, and negative, such as malformed input — but also be excited by the prospect.

Danny

P.S ‘Solar System Simulation’ is still available and works on Windows 8, 8.1 and 10.

Categories
Programming University

2D Graphics Solar System Simulation Coursework Result

I’ve written a few posts now about my Solar System Simulation — also known as a JavaScript Orrey — Coursework for 2D Graphics. It was the coursework I’ve been most enthusiastic about since I’ve got to university so I was anxious to get my result.

I’m very pleased to say I got a grade of 86%. This is a high first class.

Because I’m pretty confident I did quite well in the other half of the module, User Interface Design, I think I should have a high first class for the Module as a whole, which I’m very happy about! Of course I will update this blog when I get my module grades back on the 18th of February.

The lecturer who set this coursework, Dr. David Parker, provided me with some really useful feedback, saying:

This was a well featured piece of work, I also love what you did turning it into an app (though that isn’t reflected above).

Some of the code is a little over complicated and you could put some thought towards how to make it simpler. This also has maintainability consequences.

Taking that into account I intend to spend much more of my programming time working on refactoring my code to make it easier to understand and maintain.

I was also very pleased that Dr Parker described my use of SVN, a subversion system used to keep track of changes to software source code over time, as the best he had seen. 🙂

Danny

Categories
Programming University

2D Graphics Coursework – A JavaScript Orrery

I apologize for the lag in the above video, its honestly not my code! 😉 It’s the free screen recorder program I used being iffy.

For the last few weeks I’ve been steadily working on my coursework for the “2D Graphics and User Interface Design” module. We’ve been tasked with developing a digital orrery using the HTML5 canvas tag and the associated JavaScript drawing API’s. “What is an Orrery?” I hear you ask, Wikipedia to the rescue:

An orrery is a mechanical device that illustrates the relative positions and motions of the planets and moons in the Solar System in a heliocentricmodel

Heliocentric just means that the planets move around a stationary sun.

The finished, final version of the product will have gravitational forces effect the positions of each planet, allow the user to invent new planets and place them in (effecting the courses of all the other planets!) and have an additional drawing mode in which all of the planets are made to look like pretty Koch Snowflakes 🙂

In the above video you can see what I have achieved up until now, with another month remaining to get it finished. I have

  • 4 Drawing modes (Arc mode, Line Mode, Sprite (image) mode, Animated Earth Mode (Using spritesheets))
  • Independent rotation speeds for each of the planets
  • Keyboard controls to decide which mode is shown

I have the following left to implement

  • Gravity
  • User added planets
  • A moon orbiting earth
  • Elliptical orbits
  • Koch Snowflake drawing mode

I hope to get most of these done this week 🙂

One of the interesting parts of the assignment has been the programming language used itself. JavaScript, though based on the same family of programming languages as my preferred language C#, is quite different to the aforementioned language in some pretty important ways, for example Object Orientation doesn’t come naturally, instead the language uses the Prototyping paradigm, which takes a bit of getting used to if you are an OOP programmer.

JavaScript is also the first loosely typed language I have been formally taught, though I did write in PHP for a few years before university which is also loosely typed. A loosely typed language such as JavaScript doesn’t have hard and fast rules on what can be stored in a variable, for example in C# if I write:

public int WholeNumberVariable = "string";

the whole program will not compile, because putting a string in a variable that has been initialized to hold integer numbers is illegal. In JavaScript when you initialize a variable you can’t assign a type, so It can hold anything

var WholeNumberVariable = "string";
var IExpectANumericResult = WholeNumberVariable / 2;
//I'm going to be a huge bug! I expected a number to divide by 2 but now I'm trying to divide letters! This makes no sense!

This can cause some unexpected behaviour, also known as bugs. So it’s fair to say I much prefer Strongly typed languages.

But, I’m getting used to JavaScript and its numerous quirks, and actually rather enjoying it. I hope to report back soon with some additions to my orrery to show you!
Danny