Category Archives: programming

Getting Into Programming

I’ve had several people ask me, “How can I do what you do?”  The answer is simple: start.  Any skill in life takes time to learn, whether that be programming, cooking, playing baseball, or playing the piano.  With any new skill you need to start somewhere.

Below, I hope to highlight a few things that will help non-programmers start on a track to becoming one, for a job or even just for fun.

 

Set Your Standards Low

I am by no means a code guru (much more of a polyglot), though I have been programming for over 10 years.  I started with basic Windows scripting, and moved on to Linux scripting when Counter Strike: Source came out.  For half of that time I’ve been developing iOS applications, with a handful on the store, published either by myself or a company I’ve worked for.

If you’re familiar with programming and you’re switching to iOS development, you can probably knock out an app in a month or two.  However, if you’re new to programming, and you don’t understand what methods, arguments, header files, and variables are, you will have a LOT to learn.  That’s not to say it can’t be done, just that unless you dedicate your whole life to it, it’s going to take a while.

If you go into development with zero background, expecting to make the next Flappy Bird in a month, you will most likely be extremely disappointed.  If you get into things expecting nothing, you’ll be happy with improvement of any kind.

 

Finding a Good Language

There are an extremely large number of programming languages, just look at this Wikipedia page.  What language you start with has a lot to do with what your goals are.  If you pick a language that is in line with your interests, you are more likely to stick with it, and more likely to succeed.  And most importantly, you never forget your first.

Figure out what you want to do with programming: get a full time job, built yourself a website for a hobby you have, or maybe have your computer automatically check you in to flights for Southwest Airlines at exactly 24 hours before departure.  Once you’ve figured that out, pick the language that will get you there.

Java

Java often gets criticized for being slow, but if you’re new to programming you most likely won’t notice it.  Android applications are developed in Java, and Java desktop applications can run on OS X, Windows, and Linux.  The idea behind Java is to “code once, run everywhere”, so you could write a Java program on one computer, transfer it to another, and easily run it.  With some modifications, you can also turn desktop applications into web applets.  Java developer jobs are also highly in demand, so if you want to make a career out of development, Java is not a bad route to go.

HTML/CSS/JavaScript

No, JavaScript is not the same as Java, though they have similar roots.  I’ve lumped that together with HTML and CSS  because those are the three main pieces that make up websites.  Think of them like layers of a cake (the cake being a website).  The HTML is the base, the content, where pictures and text reside.  On top of that is the CSS, which adds colors, applies fonts, adds in background images, and more.  It’s the colorful frosting to your website cake.  At the very top is JavaScript, which is the toy car and candles that the cake lady who also works at the deli threw on top.  JavaScript runs things like animations, images slideshows, and most of what people consider the “interactive” pieces of a website.  You’re not going to be making the next Facebook or Twitter, as contents with dynamic content are run by server languages like PHP and Ruby, but HTML/CSS are the basis for anything on the web today.

If you want to stick your toe into the pool that is JavaScript, CodeAcademy has some free lessons for beginners that are quite good.

Python

Not to be confused with the snake, Python is very powerful programming language.  It is often praised as the best programing language to start with, as it also has a clean syntax and is usually quite easy to read.  Python powers applications such as Dropbox, and is used by large companies such as Google and NASA.

Ruby

Ruby is an object-oriented scripting language.  Built on top of Ruby is Ruby on Rails, which is a framework that allows you to create dynamic websites very easily.  Over the past several years it has started to gain popularity, and many companies are hiring Rails developers.  Websites such as Twitter, Ask.fm, and GitHub have been built using Rails.  If you want to get into dynamic website creation with user generated content, you could start by learning Ruby, and working your way up to using a framework like Rails to make your code even more powerful.

CodeSchool has a great introductory course to Ruby.

PHP

PHP is a server-side scripting language.  It powers sites like Facebook, Wikipedia, WordPress, Drupal, and many others.  It first appeared in 1995, and is what runs over 20 million websites today.  It is one of the most popular web development languages, though not many consider it a beginner-friendly language.

 

Get Feedback

Once you’ve started programming, it’s hard to gauge your skill level without getting feedback.  If you have an experienced developer who can be your mentor, that is great, though not everyone has that luxury.  One way to try and get feedback is to your your code publicly online with a service like GitHub.  Doing this accomplishes two things:

1) You learn how to use version control, which is an invaluable skill once you start working on larger projects.

2) You get used to other people looking at your code.

It’s easy to think “I’m not good, nobody should look at this”, but that is a feeling you need to get used to.  When I look at some of my old code I feel slightly embarrassed, because with each passing day I improve on my skills, and my code from 6 months ago is not nearly as good as code I write today.

Another important note is that a lot of people on the internet can be pretty harsh.  Quite often other developers can be hyper critical of your work, and you’ll have to develop some tough skin to deal with it.

 

The most important thing is to just stick to it.  If you want to get better you just need to keep working at it.  Accept critiques from other developers and improve on your skills.  Once you understand the basics of the language you’ve chosen, you can use websites like Codewars which have little daily challenges on them to keep your mental blade sharp.

Happy programming!

Building an Android

Before I even get into talking about Android development, I should state that I’m primarily an iOS developer, and because of that am more accustomed to iOS development styles.

I’ve been developing Android apps for a while now, and one thing that I’ve always disliked is Eclipse.  It’s the recommended IDE from Google, so when I first started developing it seemed like an easy choice.  Since then I’ve realized that it is bloated, slow, and the exact opposite of what I’m looking for in an IDE.  For a while I just put up with it, thinking I was as locked in with Eclipse for Android as I was with Xcode for iOS (which turns out to not be as true as I once thought it was).  Then I stumbled across a beautiful thing…….

IntelliJ

My new love affair

At first I was worried, there didn’t seem to be a large amount of Android tutorials using IntelliJ, but I heard good things from Mackenzie Powers and figured I should give it a try.  The thing I had the hardest time with was figuring out how to important 3rd party Android libraries.  Eclipse was easy enough, dropping any libraries I needed into {PROJECT_ROOT}/libs.  IntelliJ required a little more setup configuring each library as a module, and then setting each module as a dependency for my application.

But there was another problem, this module/dependency layout doesn’t seem to compile the same was as Eclipse does.  My existing project that compiled file with Eclipse was giving me all sorts of errors with IntelliJ.  Errors were being thrown around saying I had already compiled the Android-support-v4  library.

Oh noes! Errors!

Weird, why was it trying to compile in the support library a second time??  It took me far too long to discover the problem.  After trying to configure a bunch of settings I gave up and tried deleting the library from my project.

Safe Deleting support-v4

I was then presenting with this error:

I can’t let you do that, Joe.

So that was it! My other 3rd party library was using Android-support-v13, which apparently includes v4 automatically.  The way to get around this in IntelliJ is to just have each module require the same .jar library as a dependency, and then it is smart enough to know to not include the same library twice.  Switching both modules to v13 fixed the issue and I was free to Eclipse!  After resolving all my IDE issues, I only have one other problem…

The Simulator

Hanging between screens

I don’t have any physical Android devices, nor do I really care to own any.  Problem is, the Android simulator SUCKS.  It’s terribly slow, and my mom’s Windows XP Pentium D outperforms this thing by a mile.  For months I dealt with the slowness and just accepted it.  But then I found a 2nd tool that would bring speed to the table: VirtualBox.  I found a guide that walked me through setting up an x86 version of Android and configure it’s network interface to be bridged with mine.

Prepped a VM for Android
The interface NEEDS to be bridged or it doesn’t work

Setting a few screen resolutions available to the VM and restarting left me with an extremely fast Android OS.

I named it 4.0 and installed 2.3 :

The only thing more difficult with this is that is doesn’t automatically connect with ADB.  You can manually connect it by running

./adb connect 192.168.56.101

I consider this mild tradeoff completely worth it, as the speed and benefits far outweigh the costs.  Hopefully others won’t feel stuck with Eclipse and the simulator and can move forward with some tools that are a little more snappy.