Aaron Schlesinger

Software Engineer, Soccer Player, Creator of Go In 5 Minutes (bitly.com/goin5minutesyt)

Page 2


Concurrency is the New Memory Management

These days, we all need to build “cloud apps.” We’ve heard “cloud” so many
times at this point that it’s a buzz word, but underneath the hype lives a real
fact for us developers: everything we build needs to be a distributed system.

For our apps to run, we must have servers and they need to respond to requests
from our apps, all the time. So we need to build systems that have many
computers to provide all the fault tolerance, throughput, etc… we need.
You’ve probably heard this all before.

 Distributed Systems are Hard

This is a fact that we all know by now. Computers die, networks get congested,
etc…

The bottom line is that our programs are deployed onto multiple nodes as a
process on each, and each process communicates with all the others.

The process model is still powerful but it has changed on the server side. Now
every process communicates with N other identical ones, making a

Continue reading →


My Ideal Programming Language, Part 1

I’m shifting in this post from writing about my life, health, etc… to writing about software again.

Among the many things Bjarne Stroustrup has said that someone has published on the internet, my favorite is this: “There are only two kinds of languages: the ones people complain about and the ones nobody uses.”

As of this writing, I’ve been writing code as my full time job, as well as for some open source projects, for a few days over 5 years. Before that, I majored in computer science, where I wrote lots of code, and I worked for the UM Computer Aided Engineering Network, where I wrote lots of code. Before college, I wrote code for fun.

Most of the work I’ve done in my adult life has been writing code, so I’ve worked with a wide variety of programming languages. I’m writing here what my ideal programming language would look like. I’m writing this post as a time capsule. In 5 more

Continue reading →


Anxiety

I just read the my last post, and I’m thinking that everything feels so far in the past. I know that’s a good feeling since life feels almost normal again.

I think there will always be parts of life that will remind me I’m “different.” Most of the reminders have disappeared or are just worries that I can brush off. I’ll always be
bothered that I can’t live a totally care-free lifestyle like I used to, but I’ll try to come as close as I can. I get small fears sometimes that I’ll have another seizure,
but I always work to control those as well. Also, sometimes I feel pretty lonely that very few people I know feels some of these emotions, and I wouldn’t want them to either.

In light of those negatives, I’m proud that I’ve come far enough to be thinking of them instead of the physical health problems. I don’t intend to talk much more in this post about seizures or epilepsy, but instead

Continue reading →


Shock

 A Note

I began writing my last post about Epilepsy because I felt good expressing my experience and feelings via this medium. My first draft was a novel, but I felt relieved because everything was out on the screen. As I edited the text and made it more concise, my thoughts and memories became more clear. I’m happy I found this outlet.

When I shared that post on Facebook, I saw the outpouring of support and was humbled. From the bottom of my heart, thank you to everyone who read that post. It means the world to me, more than I can describe in text. Still, I’ve been conflicted about continuing to write. I usually tend to isolate my feelings, so sharing like this makes me uncomfortable.

Anyway, I’m going for it. The following text describes what happened in the weeks after I returned from Chicago, back to the “real world” that I had waiting in San Francisco.

 Coming back to SF

When I

Continue reading →


Epilepsy

In December 2011, I had a seizure and immediately began seeing a neurologist. At the time, the doctor, my family and I all thought there
were non-neurological reasons for the seizure. There are tons of reasons why parts of the human body can seize, and many of them are not directly related to the brain. I got tested to see if
I had any of those problems, but none of the tests were positive.

I found a statistic somewhere that 1 in every 10 people has one seizure in their life, and that made me feel very hopeful. Maybe it was a fluke and I could move on. Once I made peace with that idea, I moved on.

 Diagnosis

In April 2012, I had another seizure. Medically speaking, when a person has 2 unprovoked seizures they officially have epilepsy, so as of April 2012 I am an epileptic. Once the diagnosis came, I felt like I had a disease. I am now sick, and I can never shake the diagnosis and

Continue reading →


IO for Great Good

 !(Side Effects)

Code is hard in large part because of side effects. If you call a function, it does stuff, and you might not always know what it does. Why? Because it interacts with the outside world.

The concept of a function interacting with the outside world is called purity, and there’s a fancy mathematical explanation of it. But I’m not here to spout a bunch of math at you. The 80% approximate explanation is this: if a function talks to anything outside of its body, it is impure.

So, being pure means you can’t do a lot of things. If your function is pure, it cannot:

  1. write or read any global variable
  2. talk to a database
  3. make a web request
  4. talk to a cache
  5. do anything immediately useful

If you missed it, look at #5 again. So if it’s useless, why the post about purity? Purity has one great advantage: referential transparency.

Again, fancy mathematical explanation aside

Continue reading →


Going from Java to Scala

Scala, in my opinion, is a wonderful language. I have refrained from saying that publicly until after the “honeymoon period” was over between me and it. Now that it is, I feel comfortable with that statement.

Perhaps the greatest feature of Scala is that it can work “seamlessly” with Java. But, that whole “seamlessly” assertion comes with plenty of caveats, because as some know, sometimes not even Java can work seamlessly with Java. But it is possible to ship production quality, stable code that is mixed Java & Scala. And although I think Scala is great, I won’t spend time in this post defending that opinion, so if you disagree or otherwise don’t want to use Scala stop reading now. Otherwise, read on!

 Why you’ll need to tangle with Java

Java is everywhere. If you have never written a line of Java and you’re staring fresh with Scala, welcome to the JVM. Yes, it is an open virtual

Continue reading →


Function Maps in Scala

I find myself using the Function Map pattern a lot in my Scala code. Generally, when I need to group a set of related functions together, I use one of these.
My favorite example is in actors. When passed a label that identifies an action, the actor looks up the action in the function map and then executes is. Here’s the code:

    ...
    case class BaseMessage(s:String)
    case class MessageOne(s:String) extends BaseMessage(s)
    case class MessageTwo(s:String) extends BaseMessage(s)
    case class MessageThree(s:String) extends BaseMessage(s)

    val FunctionMap = Map(
        MessageOne -> ((a:String) => println(a)),
        MessageTwo -> ((a:String) => doSomethingWithString(a)),
        MessageThree -> ((a:String) => doSomethingElseWithString(a))
    )

    val MessageProcessor = actor {
        loop{
            react {
                case b:BaseMessage => {

Continue reading →


StackMob

I recently left my job as a software developer at Zynga and now I work at Stackmob. I had been at Zynga for two years, had a bunch of stock in the company, was paid well for a single 25 year old dude, and I knew in my gut for the last 6 months of that job that I had to get out.

After I left, I took a bit of time off to chill and reflect a bit, and I spent some time trying to answer 2 questions:

  1. Why didn’t I leave immediately after I got the “gut” feeling?
  2. Why did I end up leaving when I did?

The first one is easy. The golden handcuffs were on the whole time I worked there. When I talked to people about possibly leaving, I frequently got the response “stay at Zynga and cash out.” So I took the advice and stayed a while at Zynga.

The second one is tougher. I eventually got out of the cuffs. I switched teams and projects a few times inside Zynga, looking for something I was happy

Continue reading →


Fuck the Easy Way, Find the Challenge

TL;DR Do hard stuff that you will fail miserably at. It’s a great way to learn.

I just got back from playing in a soccer game in which my team was destroyed. The score was 7-2. Yea, destroyed.

The league I play in is a recreational one, and we’re all recreational players. From time to time, we play regular season games against very competitive teams that wipe the field with us. Today was one of those days.

We agree to play these types of teams because games against them help make us better. We get destroyed, and leave with our egos flattened and we learn. How the hell does that work?

Brendan’s article explains it well. You need to be challenged in order to grow. In everything you do.

I see accolades as nice to haves (as in: your life will suck without them because you will feel worthless!), but you need to be in those “I just got destroyed” situations so you can get better (yea, I’m

Continue reading →