Sunsetting Features – Difficult Decisions

There comes a time where every software engineer needs to make the best of a challenging situation. With software creep an all-too-real issue, making sure that you only keep features that benefit your program is indeed important.

Removing unwanted code can also dramatically improve your productivity, preventing you from having to search through massive, mostly-unused files for answers you need.

But how do you decide whether or not you want to keep a feature? After all, even the most loved bits of widely-used software might have to get replaced with a new feature.

Below I'll list a few of the most common reasons I've had to sunset features in some of my projects.

The code behind the feature is buggy/complicated

Sometimes it's as simple as evaluating the code you have and cleaning it up. But sometimes, your code has so many forks and branches, so much cruft from years of development, that you just need to toss it out and code a drop-in replacement. Or throw the feature out entirely.

Causes massive server load

If the feature you're looking at causes massive server load for minimal benefit, and is starting to cause an issue... Why is it still around?

Ask yourself, do your users really need this massive turd slowing down the rest of their experience?

Users don't like or use your feature

Users know best.

... Okay, maybe not always. But if the majority of your userbase dislikes a feature, or almost nobody uses it, it's simply wasting space. Now, there are exceptions.

  • Accessibility settings
  • Important diagnostic information
  • Help files
  • & more!

(Non-exhaustive list above)

Users not using a feature is my number one indicator that it's either not easy enough to use, or that it has to go.

Conclusion

Removing or replacing features in your software can be beneficial to your productivity and user experience. Other times it can't be. Deciding when to keep a feature, or when to leave it on the curb, is just as much a part of software engineering as writing the code itself.

While I don't claim to be an expert in programming theory, I hope you choose to make the right decisions.

Improving Health by Dropping Soda

A few years back, my Father was hanging out with his friends, one of which had been recently diagnosed with diabetes. In an effort to save everybody else in that room from that fate, he offered to let them use his blood glucose machine.

My father, being the guy that he is, took him up on that offer - he found that his levels were pretty high. He had, after all, been staying hydrated with Mountain Dew while at the office, and then had been relaxing when he got home with a nice big cup of Pepsi. It came as no big surprise to him.

Instead of getting upset, he decided to replace all of his sodas with something extremely natural and abundant: Water!

Yes, water. Good old water. 6 weeks after he started drinking nothing but water, he had dropped 20 pounds and his blood sugar was back to normal levels. He became more energetic by the day.

As time went on, he missed the experience of drinking soda. Instead of doing what most people would do, he started buying various carbonated water products. All sugar-free, with no calories. His health has continued to be great since the whole ordeal.

Basically, I'm telling you to stop drinking so much goddamn soda. It's not good for you. No, that diet soda isn't good for you either, although it may be slightly better (the jury's still out on that)

(and really this was just an excuse to write an article.)

Tiny Review for the Ducky Mini

Last week, I decided I would hop on the bandwagon and get myself one of those fancy 60% keyboards that everybody on /r/mechanicalkeyboards was circlejerking over.

After much deliberation (see also: looking at some reviews online and considering what I want in a keyboard), I decided to go with the Ducky Mini, by Ducky Channel.

Fast forward a week, ignoring a boatload of FedEx-caused issues (seriously? I paid $20 for expedited shipping and there were still delays after it arrived 20 minutes from my house. Ugh), I unbox the keyboard and plug it into my computer.

And then nothing happens. Nothing interesting, anyway. It's exactly as I thought it would be.

The review

The Ducky Mini is a backlit 60% keyboard that includes the ability to move your mouse cursor around with your keyboard. The one I specifically got has Cherry MX Blue switches, but it's available in a variety of different flavors.

The case of the keyboard is excellent - two pieces of sandblasted aluminum with some plastic sandwiched between them. The keyboard weighs in at somewhere around 2-3 pounds. Very solid.

Many of the keys can be set to have different functions. Included in the box are keycaps for keys that can have different functions. For example, I changed my caps lock into a second fn-key, since I rarely use caps lock.

Speaking of keycaps, all of the included keycaps are ABS. They feel cheaper, but allow the backlight LEDs to shine through.

The backlighting is very nice, although the keyboard only has red and blue LEDs, so you can't get anything other than red, blue, purple, or whatever's between those. That's perfect for me, though, as I don't like green/yellow/orange/etc on my gear.

Overall, it's a very solid keyboard. I can understand why some people wouldn't want it, but so far from my usage it's perfect.

10/10 with rice.

How not to be a shipping company

Recently, I bought some parts off of Newegg. Everything was fine and dandy, until I saw that it was being delivered by a shipping company that is notorious for not handling your packages carefully, and not attempting to notify you when they've delivered.

"Is it UPS?" you might ask. "What about FedEx, they're pretty bad!" you exclaim. No, no. I mean the one, the only, OnTrac.

You might be saying "WhoTrac?", and that's a perfectly fine response. They're a package delivery service that's only available on the West Coast of the USA.

A little backstory as to why I dislike them...

2010

I ordered a bunch of parts (off Newegg, as usual) to replace my parents' computer. They got there around noon a week later. Sounds good, right? Well, they were left on our front doorstep, in plain view of the street, for a good 3 or 4 hours. There was no attempt to hide any of the parts. There was a bush literally a few feet away that they could have hidden everything behind.

Luckily, nothing was stolen and only the boxes had dents.

2014

I buy a laptop off of Newegg, and it ships via OnTrac. The day they should be arriving comes around, and they stop by at 9 PM. Absurd, but at least I was able to take it out of the delivery boy's hands, preventing any damage.

April 2015

A friend of mine orders a boatload of parts. He's building his first computer, and only has an old case from a friend. Day one, half the parts arrive. They're promptly dropped onto his deck from waist-height, and no effort is made to notify anybody home. Everybody was home, and the only reason he knew they had dropped off his package is his brother lives in a room with a window overlooking the deck.

A few days later, a second package arrives, receiving the same treatment.

Later still

My new motherboard and CPU arrive. They arrive at some point between 8 and 9 AM, with no effort made to ring the doorbell or even knock, and no effort to hide my stuff from the street or neighbors.

This post doesn't really have a punchline, I just wanted to post my "exceptional" experiences with OnTrac.

Using CSS3 counters to number sequential stuff

Glorious CSS3 brought some great new mechanics to the CSS standard, & here's a quick tutorial on how to use one of the neater features included with it.

Yes, that's right, I'm talking about counters! Consider the box below.

Doesn't seem too crazy, right? It's really easy to do! So easy, in fact, it's so easy I'll show you how to do it right here & now!

    <style type="text/css">
    #counter-example {
        counter-reset:c;
        border:1px solid #aaa;
        padding:5px;
    }

    #counter-example li::before {
        counter-increment:c;    
        content:counter(c) ". ";
    }
    </style>
    <ul id="counter-example">
        <li>Entry #1</li>
        <li>Entry number twooo</li>
        <li>Entree namber Threeee!</li>
    </ul>

Wow! That's how you use CSS3 counters. That's a bad example, as lists automatically support numeric counting, but you can do some fancy & simple things with counters!

Now you know!

Getting top performance out of Grand Theft Auto 5 for PC

Sometimes, you just want to play a game. And sometimes, it doesn't work so well, resulting in slowdown & crashing. To help you out, I've decided to compile a list of things you can do to speed up performance in Grand Theft Auto 5 for PC.

Disable all "Advanced Graphics" settings

These settings offer some great visual improvements, but will demolish your game's speed unless you're running some very powerful hardware. Most importantly, Extended Distance Scaling & High-Resolution Shadows are particularly demanding & should be disabled if you're running into any sort of performance issues.

Lower your settings overall

It should be obvious; if low framerates are plaguing you, just lower your settings! The most obvious of which are Shadow quality, Post FX, Reflection Quality, Shader Quality, & Water Quality.

Other settings that can improve performance a little with no noticeable quality difference include...

  • Tessellation - This can lower your framerate by 3-5 frames per second in most cases, and only affects a few types of objects.

  • Texture Quality - Unless you've got loads of VRAM on your card (2-4GB), you should definitely tune this down to normal. Otherwise, you run the risk of encountering VRAM-related stuttering.

  • Population Variety - Unless you really hate seeing copies of cars and people hanging out around town or have spare VRAM available on your graphics card, you should lower this setting.

  • Particles Quality - This can reduce your framerate by up to 10 frames per second, and offers little visual improvement.

Other performance tweaks

  • Set the game's process priority to "High" using Windows Task Manager

  • Kill the "Grand Theft Auto V Launcher" process - it's uselessly taking up RAM and CPU in the background.

  • Update your computer's drivers for everything, if possible.

  • Avoid filling up the custom radio with hundreds of songs. The game has to process all of them. It won't like having to process a few thousand mp3/wav/etc files.

If you've got some other performance tweaks that I've missed, feel free to leave a comment! I'll be happy to include any user-submitted ideas.

Difficulties with HTML5’s audio tag looping

Recently (although not too recently), I made Ambient Crossing. It works decently, but it's plagued by an issue that I have yet to easily solve (you can even check my progress on the beta site)- Seamless looping.

Now, it doesn't sound like it should be too difficult to achieve, right? Just set the audio tag to loop & it's done! Unfortunately, the audio tag has a small issue preventing that from being the case. I'm pretty sure it's just an implementation issue, but since it affects all browsers that I've tested I get the feeling it'll be an issue for a while.

The issue comes along with the conclusion of the song & the looping of the file. The audio tag lags for a short while, sometimes less than 10ms, sometimes over a second, causing a gap in the playback. I'm sure you can see the issue.

Reproducing the issue

It's really easy to find. It's especially easy to find with audio files that are meant to be looped seamlessly & are short.

    <audio loop preload="none">
        <source type="audio/mpeg" src="http://crossing.hypertext.ml/music/12.mp3">
        Your browser doesn't support the audio tag
    </audio>

Stick this on your own page, and wait for the loop. You'll hear it before long. Unfortunately, fixing it has proven less-than-easy.

Potential fixes

Thus far I've come up with a few things that could fix the issue, but either haven't or wouldn't work well enough.

Two audio sources, switching from one to the other using Javascript

This is an overall simple one to imagine & it sounds like it should work fine, but sometimes (due to the implementation of the tag) it'll fail for no apparent reason.

Using Javascript to manually loop when the song gets to the end

I've tried this one via 2 methods: Using setTimeout to set up a loop right after it starts or loops, & checking the song every 50-100ms or so to see if I can catch it before it hits the true end and moving it back myself.

As with before, both of these ended up being too flaky and imperfect.

Using the browser's appropriate audio API

This one sounds pretty promising, but the audio APIs are rather complicated. It's high up on my list.

Doubling the length of the song and sending it back to near-0 once it passes length/2

This solution is particularly easy & I think would probably work great. The downside being I'd have to somehow loop all the music one or more times so that I would have the extra buffer length.

Conclusion

For some reason, the HTML5 audio tag is a pile of crap. If anybody knows why this issue is present, please tell me.