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.

While Working On Your Own Reach Out To Others.

This is another topic that seems slightly obvious, but it also highlights an easy trap to fall into. Programmers are often drawn into their projects and tend to ignore the world around them. It is a necessary part of the job, but it is also a risky one. So, I implore you to step outside of that zone at times and reach out to others. This isn’t just when you need their help. It is also true when things seem to be going okay.

Why, you ask? For a break, and also for perspective. In the end, our projects are going to be used by other people. It’s important to get some feedback from others in order to know if our ideas are working or not. But, it also gives us a chance to give our brains a break. It is easy to get so focused on solving problems that we miss the easiest solutions. Forcing yourself to step back occasionally will often avoid that trap.

So, yeah. Take some time for other people – even if it’s a short online chat or email. Getting that contact with another real person can sometimes make all the difference in a successful project. Yes, you have time to take a few minutes away from your project – both the project and your sanity require it.

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.