Skip to main content

Starting your Project at the End

Phil Hadviger

Phil Hadviger

Principal Site Reliability Engineer @ GLG

It started with recursion for me#

One of my first computer science class lessons that stuck with me the longest was when we were introduced to recursion. Focus on the stopping case!

With iteration, the approach was generally simple: pick a starting point, and stop at the end. For example, use a for loop to add up the numbers 1 through n. Simple, just declare a sum variable have each step of the loop increment the sum until you reach 1.

int add_all(int max) {
int sum=0;
for (; max >= 1; --max) {
sum += max;
}
return sum;
}

Recursion was a different beast, because we didn't really have sum as a variable and had to add the results of more function calls until we reach a stopping case, at which point we did something completely different and returned just a number.

int add_all(int max) {
if (max < 1) {
return 0;
} else if (max == 1) {
return 1;
} else {
return max + add_all(max - 1);
}
}

Since we don't have the luxury of the sum variable that is part of the iteration, the stopping case in the recursive example is really important to think about if you want the results to come back the same as the iterative version.

Country Does Not Equal Language Preference

Phil Hadviger

Phil Hadviger

Principal Site Reliability Engineer @ GLG

Where Am I Coming From?#

So I'm a developer speaking and reading primarily English, living in Japan, and sometimes traveling to Hong Kong, or the United States, mainly for work reasons. I work for a Japanese branch of a US company, where a vast majority of our infrastructure is located in the Unites States.

MeOrganization
CountryJapanUnited States
Japan
LanguageEnglishEnglish
Tech VendorsUnited StatesUnited States
China

So this is me, and the summary is that I personally, and the organization I work for, primarily interact with US Vendors in English.

Web Browsers Do It Right#

Inside of most modern web browsers, you have the option to choose what your language preferences are. So for myself, I choose English, but technically I could add German to the bottom of the list, since I do understand that as well. Web sites, then have the option to check what my language preferences are, and offer me a site that adheres to what I'm telling them is best for me.

Email Marketing is the Worst Offender#