Between Dates – Another App Spotlight.

Since it’s the end of the month is a time that people tend to focus on dates, I thought I’d spotlight another app of mine: Between Dates.

Between Dates was written at a time that I was regularly calculating dates and the number of days between various dates on the calendar. The app has gained several features over the years, but it still retains its original functions in a way that doesn’t force the user to search through menus or screens.

The main part of the app is on the top. You set two dates using the picker wheel on the bottom and the app will calculate the number of days, weeks, months and years between those two dates. It will also tell you if the selected day is one of the holidays that are preprogrammed into the app and the day of the week that is represented.

The other handy features are the ability to add or subtract days from the selected date or two set both dates to the same date. These features were part of the original app and made my life a lot easier. At some point I needed to know how many days were between the dates and then I needed to add that many dates to the end date to figure out the next time I had to do a task. Using these buttons, you would set the date and copy it to both dates and then add the number of days you needed. That will give you your final date. You can easily continue to do this. It saved me a ton of time trying to count days on a calendar, or attempt to do the math manually.

There weren’t too many apps did what this had done at the time, and as far as I can tell there still aren’t many with all of the features this app contains. It is an app that I am proud of. It has a clean look, easy to use features and none of them get in the way of what the user is trying to do.

It also lets you save the dates you selected so you can recall them later. I used this occasionally to remember birthdays, or to calculate what anniversary it might be that year. You can easily find out how long you were working at a certain job, or working on a project. You can also calculate when you need to pick up medicine, custody agreements, or even just figure out what day of the week something happened.

There is something for everyone in the app.

Don’t Repeat Yourself. A Life Changing Obvious Idea In Programming.

In many ways, the idea seems simple, but it is easy to forget. When you are writing a program repeating code happens quite often. Sometimes it happens in various sections of your program so it isn’t always quick to recognize. Other times, we are just in a rush to get something done without thinking it through so code gets cut and pasted several times with few if any changes.

While, we have all made those mistakes, it makes your life easier to step back and find a way to fix it. Often, the fix involves pulling out a chunk of code and turning it into a function or a method. Other times, it involves rethinking why you are doing things the way you are doing them. Still other times, finding better ways to use the language will solve the problem.

A common fix in Swift is to replace a collection of if statements with a case statement. That doesn’t solve all of the issues, but it helps out more often than you’d think. As I am writing this, I can think of several areas in my own code that would be helped by this piece of advice alone.

If you can avoid the repetition, it will make your code more readable. But, beyond that, it will also make your code easier to update. It is far easier to change one function than to track down all the areas that you might have used the same code in order to make a simple change. Just think of how many potential bugs could be introduced by missing one or two areas.

Another way to avoid repetition is to set up constants for values that get used throughout your program. This allows you to change values in many places by only setting one variable. I use this many times with various values such as a scale modifier, or animation constants. It allows you to stay more consistent through the code, while also allowing you to make quick changes. If the value is limited in scope, then try to define it in that scope if at all possible. Also, make sure that you use variable names that are descriptive and make sense. It’s far easier to figure out why you used spriteScaler than a number 4.5 when you are reading the code.

So, take a few minutes to look through some of your code to find areas that you repeated yourself and take the time to fix that issue. You will thank yourself in the future.

Don’t Let Negativity Destroy Your Work.

Negativity has a way of creeping into work. It can show up in many forms – our own thoughts, frustration, errors that won’t go away, or a bad review. We are taught from an early age that negativity is bad and we should simply pay attention to positive thoughts. While, there is some value to that thinking at times, it ignores the potential gains you can get if you can find a way to be constructive with the negativity.

An easy example is in the form of a negative review. If the person making the review took the time to give reasons for that review then it is worth given those reasons some thought. Do their points reflect issues that other people may have? Are there suggestions for new features that would make sense to implement? Are they having a problem understanding some aspect of your program that could benefit from some documentation or an interface update? Does the description of your program suggest features that don’t exist? There are many possible reasons for a bad review – many of them will suggest useful updates that will allow your program to better serve its intended users, or even open it up to new users.

It is also important to realize that the outcome of a bad review won’t always be positive. That’s ok, too. No program can possible make everyone happy. It just isn’t the way it works. If you have a large collection of bad reviews for one program then you really need to find out what the problems are and fix them. But, if you only have a handful of bad reviews spread through a large number of good reviews then take what you can from them and find a way to put it behind you. I know that’s easier said than done, but it is necessary. If you let the negativity be your focus then the rest of the program is going to suffer. If you let that happen, then you will never succeed in creating useful programs or apps.

Also, know your intentions with your program and don’t let their suggestions take those away unless it makes sense. I know some of my own apps have changed drastically because of a reviews and they were better for it. On the other hand, I’ve also ignored suggestions that were brought up in reviews because they would change the app at a fundamental level that didn’t make sense.

I have also had several reviews that simply stated the app didn’t work or didn’t work as they expected. As far as I can tell, the app wasn’t crashing. There didn’t seem to be any other issues that I could see. At the same time I was getting great reviews and emails praising the same app, so it helped me push those useless bad reviews out of my thoughts. If it had been the other way around and I was getting more bad reviews that good reviews then I would have taken a serious look at the app and figured out how it was failing.

In the end, in all of these cases, I was able to use the reviews to better apps and the app experience. But, the negativity doesn’t just come from other people. How can you get past your own negative thoughts? That one is a bit trickier and will depend on your own personality.

For me, I often step away from a project for a bit. Either I work on something else, or I do something distracting away from the computer. If I’m fighting a problem that can’t seem to be solved, I often walk away completely for a bit. I have solved many issues on walks, in the shower, or in my sleep. If you get frustrated to the point that work isn’t getting done, then it makes no sense to keep trying. Walk away. Come back to it later or the next day. If you can get away from the computer altogether, then do that. If not find an unrelated project and focus your attention there. Yes, even if there are deadlines in place. If you brain is stuck, it needs a change of focus before it will unstick itself. Trying to do anything else is going to hurt the overall project and just waste your time and possibly other people’s time.

So, the short version. Negativity happens. Find a way to take anything valuable away from it and walk away from the rest.