Learning To Code – Learn, Try, Fail, Repeat Until You Succeed.

I have been programming for longer than many readers of the blog have been alive. Learning new things has always and will always be a large part of what programming actually is. It is one thing to get comfortable with a language, it’s another to fully understand why things are working they way they work and how you can use that to better your code.

I started in the mid 1980 working on an Apple IIe using BASIC. It didn’t take long to learn that BASIC wasn’t considered a great language by any stretch. It had a tendency to create bad programming habits. But, it did solidify many central programming ideas. I fully understood loops, conditional statements, variable, and boolean logic among other topics. I could come up with an idea and build it in code within a short time. It’s great to have “perfect” code, but it’s even better to see your ideas working.

A basic template to succeed in learning: find a project, learn, read, try, fail, learn more, try again, repeat until done.

That’s why for this post I’m really pushing the idea that you find a project that interests you. It can be anything – ideally, not too complicated, but still a challenge. I don’t recommend trying to build a Facebook clone for your first project, but make sure it’s more involved than “Hello World.”

Once you have a project, then start to look into how to implement it. This is where you’ll have to pick devices and languages you plan to use. Sometimes, your initial goal will point you in a certain direction. If so, then follow that lead. If not, that’s okay. Look into your options and find out what will be the best suited for your project and also your future hopes. To rephrase that, don’t learn PASCAL if you hope to write mobile apps. It might be possible in some roundabout way, but it isn’t worth the extra hassle.

Once you have a basic idea for the project and how you plan to implement it, continue to read up on the language and how to use it. Once it begins to make a bit of sense, then start to write some code. Start small. To begin, focus on some aspect of your project that you can make work quickly and without much hassle. For me, this usually becomes obvious as I start to learn a new language or device. I will often learn some aspect of a language or device that will fit with my planned project. I can then use that information in order to make a part of it work. Sometimes, it’s just a part of the interface, other times it is a mathematical or logic part. But, the key is to make it something that you can play with and see the results quickly.

That is an important aspect of learning – seeing the results of your labors as soon as possible. It helps in a couple of ways, you solidify what you are learning, but more importantly you get to see the results of your lessons. Those two things make it easier to go onto the next steps in learning – failure. It is a given that your first attempts will have problems. They might run and kind of do what you want, but it is rare that they work fully right, or give you what you are hoping to have in the end. That’s okay. Failure is the best teacher.

The next key is to take your failure and turn it into a success. You do this by continuing to try. This will involve continuing to education yourself more on the language and the devices you plan to use. It will also involve you learning new things in order to improve your first attempts. You might not written the best program or made the best app, but you will have made something. And as long as you have something, you can improve it.

Just keep learning! Just keep failing. Just keep trying again and again. You can do this.

A quote that I found years ago:

“Make sure that your next project is beyond your skill and requires tools you don’t have. You won’t regret it.”

Programming Suggestion of the Day: Test Test Test!

Assuming things work just because you can run a program and not have it crash is a sure path to failure.

If you are using automating testing, that will catch a lot of issues before they become a problem – provided that you did a good job with your test coverage. But, either way run your program many times. Make sure to test every option, or combination of options. Try things that don’t make sense – put words in a number field. Try to break your program, and when you are done with that get it in front of other people and let them attempt to break it also.

Only then can you begin to feel confident that your program will do what you expect it to do and users won’t run into issues.

Well, I should back off that last statement – errors will still manage to show up and people will find them like magic. It is amazing how many things manage to get missed even after thorough testing.

So, just keep testing. Even if you think you’ve tried everything, try a few more things.

A Feature For One of My Apps – Time Clock Helper.

Since I brought up the idea of marketing yesterday, I thought I would show a bit about one of my apps.

This is my Time Clock Helper app that I wrote years ago to help myself quickly calculate the hours I was working each day. It was based on the older style paper punch cards with four punches for each day.

The original version of the app made the user type in their hours in 24 hour time. This was met some backlash, so I added a way for the user to enter their punches using a scroll wheel. The scroll wheel would use whatever time representation the user already had set up in their device – for the most part 12 hour time. This seemed to fix most of those issues, and didn’t hurt the purpose of the app at all. So, in all it was a successful change.

Thousands of copies of this app have been sold and it is used by hundreds of people a day as far as I can tell from Apple’s information.

This app can also track multiple days – simply press the “Add to Total” button and it will be added to the list of saved days and included in the total number of hours worked. You can view all of the saved days, along with the date they represent. If you need to change the dates, you can easily from the list. Also, you can email the list of days along with the total hours worked to anyone that you want.

At one point I had a request for the app to handle businesses that round their hour calculations either by 6 or 15 minute intervals. It wasn’t overly tricky to add the option, so the app fully supports those systems, too.

Click to bring up the Apple App Store