JErickson.net

The blog of Joe Erickson, 20+ year web programmer from Cleveland, Ohio.

Programming to Interfaces

Yet another article from the archives. Hope it’s useful. There is a common Object Oriented axiom that says “Program to the Interface and not to the Implementation”. But what does that mean and why is it useful? Concrete Shoes Let’s say that we have a class that calculates the number of Strings that begin with S in a list: class Begins { public static int calcBeginsWithS(ArrayList words) { Iterator iter = words.

A Couple Pointers

This is an article I wrote a while ago, but is still relevant to many languages still in use. Figured I’d repost it to this blog. Many of you may have learned the following in Java 101, but I thought I’d repeat it just in case. Most of the variables you’ll use in Java are going to be Objects. So in the following code, we’re creating three Objects: BigDecimal number = new BigDecimal("9.

Double Trouble (Don't use doubles for currency or accurate decimals)

This is an article that I wrote a few years ago that still applies today. Working with decimal numbers can be more complicated than it might seem. Many a Java programmer has been bitten by using doubles when calculating currency or another decimal value that relies on precision. The problem Let’s say that we need to calculate a customer’s bill. They used 80000.01 kWHs (big bill!) and we charge a dollar per kWH for this customer.

Being a Craftsperson

I used to play role playing games in High School. Namely, the Teenage Mutant Ninja Turtles Role Playing game. I was the GM. I played almost every weekend with my brother and my best friend–the center of the football team. I loved those games. I think we ignored half the rules, but the stories we created are still some of my best memories from that time. Jump to today and my kids have gotten to the age where they are starting to stretch their storytelling wings a bit.

Would you want an email like this?

Take a look at this email and think about what it would mean about your career. What about this email is different than most of the job postings out there that you routinely see? Obviously, I put a big fat outline under one of those aspects; that they don’t care if I even know the language. The thing that most starting or junior developers are most worried about–“I need to know XYZ”–a hiring business in my area doesn’t even care about.

Don't fear the frustration

I’ve always been a little more tenacious than most people I know, willing to spend the time to flail before making the breakthrough that gets the results I’m looking for.1 I think part of that has to do with the fact that I do most of the flailing in private, at a computer where no one can point out my failures or see what I’m working on before it’s ready. But as I’ve taught other people programming over the years, I’m always surprised at how quickly they throw in the towel on problems that I know are solvable.

Don't make these three mistakes in your technical interview

I’ve been running a few tech interviews for the consulting company that I get work from and I’m realizing, most people aren’t very good at it. But that’s understandable. It’s not like we do it very often and it’s hard to get practice in on the interviewee side (interviewers do this all the time). Here are a couple of mistakes I’ve seen recently: Being non-chatty Yes, I see this as a mistake.

How to put a sparkle in a hiring manager's eye

When talking about interviews, most programmers are interested in the technical interview. And why not? It’s what we know. We think that if we can solve a problem on a whiteboard, we should get the job. Meritocracy for the win! But at most companies, it really doesn’t work like that. The management in charge of the programmers will always have the last say in whether you’re hired or not. What they want to know is, “Can this person do this job?

Ask Away: Laravel or Rails?

I want to learn web development. but i’m stuck in choosing the language (PHP or Ruby). I heard about Laravel I think it is interesting and I also heard that it is same as Rails. So I think which will be a better choice to learn Laravel or Rails framework and which has a bright future? Thank you so much for your question. I want to start my answer by saying that I can’t give you a definite answer, but you also shouldn’t be stuck on this.

The New World of Work

When my Dad got out of the Army in 1971, he got a job with AT&T as a repairman. He worked there his whole career for 41 years until he retired two years ago. This was normal for his generation and the generation before his. You got a job at a big corporation right out of college (or the Army) and they took care of you, treated you like one of the family and carried you through your career to a safe, and funded, retirement.