How We Solve Problems: Recursion

From Wikipedia: recursion is the process of repeating items in a “self-similar” way.

Self-similar, in mathematics, is an object that is exactly or approximately similar to a part of itself.

KochSnowGif16_800x500_2A Koch curve has an infinitely repeating self-similarity when it is magnified.

This s used in computer science to solve problems that can be broken down to smaller, similar, problems. A classic implementation of this is with sorting through divide and conquer methods.

How does this work?

Let’s start with the number 3, you could say that that number is a list, one number long, that is ordered.

Then you add another list one number long, [5], another ordered list, and you get [3,5]. Then you add in the ordered list [2,4], you get [2,3,4,5]. Easy right?

Let’s say you start with the list [3,5,4,2]. That’s not in order, but if we then had an easy way to combine lists so that the result stays in order, we can grow our list and keep it in order, as long as each list you add is an ordered list.

But what if you broke that unordered list down into 4 different ordered lists [3],[5],[4], and [2]. Now you can recombine them back, making sure they stay in order.

    /       \
  3,5       4,2
 /   \     /   \ 
3     5   4     2
 \    /    \   /
 3,5        2,4
    \       /

This specific sort is called merge-sort, there are other types of recursive sorting, and recursive functions altogether.

That’s how we use recursion in computer science. We know how to maintain an ordered list, as long as each list being added is in order. So we just break down our data into pieces that we can handle, and then handle them in the way we know how.

If a piece isn’t quite manageable, we just break it down some more.

Then we can start at the bottom and recurse back through the list merging them back together.

This function is considered recursive because the function calls itself. The function will check to see if it has a list of numbers that is 1 in length, if it doesn’t it splits the list in half and calls itself on each half, then it merges the results. This effectively does what we described above.


Why we use recursion!

Recursion is a powerful form of iteration. However it really works best when used to solve big problems that are made up of similar smaller problems.

Like the sorting problem above, all we want to see is which number is greater than another. We break it down to the smallest pieces, then put them back together in order.

Factorial is another example. Factorial(5) is 1 * 2 *3 * 4 *5, which is really 5 * factorial(4), which is 4 * factorial(3), etc.

More on recursion

Is this implementable outside of code?

Well, apparently it’s everywhere in nature.


Here’s a Close-up of a Romanesco broccoli.

When I discussed this with the founder of a location-based SEM company here in NYC, we discussed if positive reinforcing cycles, specifically education, are the best implementations of this outside of code.

Learning as recursion

When learning something, it can be overwhelming. If you break the knowledge into manageable pieces, it can be learned more efficiently and more effectively. The spiral shape that is built out of the self-similar Romanesco broccoli has a striking fractal form because it grows building off itself.

Learning a language, for instance, begins with simple basic words. They grow together to form sentences. Then punctuation and tenses are added which increases the learning difficulty, but each piece on its own remains fairly simple.

I asked one of my mentors, Yaniv Cohen, from my days at WorldMate, what this thoughts on recursion applied to learning were.

“Your assumptions regarding the other person’s understanding will change during the conversation when you lay down your explanation. This process of changing your assumptions and breaking complex ideas into smaller parts is more recursive the more complex your idea is, and the more basic foundations of understanding the other party you are addressing has to understand. As you break it down to smaller parts you have to assume knowledge of what the other person already knew, what he understood from the previous parts you already explained and to what degree.”

Based on the knowledge being taught, it’s necessary to break it down, based on the student’s knowledge, to understandable pieces. Then you build.

Positive reinforcing cycles.

In Making Habits Breaking Habits, Jeremy Dean talks about The Anatomy of Habit, Everyday Habits, and Habit Change.

“In theory, making habits should be easy. We do it automatically all the time. Think back to all the examples of everyday habits we’ve seen earlier: traveling, eating, socializing, working, and shopping. These habits were established because we found ourselves in the same situations trying to satisfy our various needs and desires, and on returning to the same situation, we made the same choice again, and so on, repetition layered on top of repetition until the habit was built. Sooner or later, the behavior became unconscious and, whether useful or not, over time these habits took hold of sections of our lives.”

Repetition is not recursion necessarily, but recursion is a form of repetition. Dean explains how habit making and breaking are intertwined with two things:
1) Anchoring the desired action with positive anchors.
2) Breaking the habits down, at the beginning, to smaller pieces, then building up…

Then time. Once you do it enough you won’t have to think about it anymore.

It’s no surprise that learning and habit building are interconnected. With both we are building pathways in our brain. When creating pathways it takes a certain amount of going over the newly created paths to strengthen them, then building on top of the previous pathways with new information.

Now that you know a little more about recursion, do you use it anywhere? Would you use it anywhere? Do you break down tasks to small, similar tasks then build off each success to complete the whole task?

WordPress as a framework for a bank

I saw the following question on Quora: I am powering a bank’s website using WordPress. What security measures should I take?

Matt Mullenweg responded, awesomely as he does,  but in his answer he said the following.

“I agree there’s probably not a ton of benefit to having the online banking / billpay / etc portion of a bank’s website on WordPress.”

Which I don’t entirely agree with. So I commented my thoughts, but thought I should share them here too:

I’d be interesting in hearing why not…

One reason I use WordPress is its ubiquity, knowing that since so many people use it, the moment something is revealed to be insecure in the system, I know that some of the top security minds are working on it. Not to mention the other features that exist out of the box, that are constantly being developed and improved upon by a great community of great minds: user management, database structure and connections, data structures, a templating system.

Now one could argue that a bank of all places should have a dedicated team focused on all these features making sure that they are as secure and well-built as possible.

But you all see the results in you own bank’s web portals. I’m sure many of you have jumped into helping maintain a legacy system which constantly requires new features while many out-of-date systems are not updated.

This is why I have my team build many of our projects on top of WordPress, as a framework. We can focus on the specific features I need and leverage the WordPress community for the rest. I make sure that my team could build these features themselves, that they understand what they are building on, but why reinvent the wheel each time you need to drive to the store to get milk?

Are there other frameworks out there I can use? Of course, are they better? Now you’re splitting hairs, because for most of my projects I need a great deal of the functionality already baked in.

Because I rely so much on WordPress I try, when I can, to give back. Many people feel the way I do and that creates a positive reinforcing cycle.

So thank you Matt for what you’ve given us.

Part II: The Founder Institute, Lessons Learned

Some of you are familiar with Inkwell—I founded it as part of the curriculum for the Founder Institute (FI). I had come to FI to see what I could do with the idea, and that idea carried me through to graduation.

What I got from the Founder Institute

I came to the Founder Institute wanting two things:

  1. An overview of what I would need to know to run a company.
  2. A network of professionals, both going through what I am, and mentors who have already succeeded and can help me succeed as well.

I got both.

The curriculum was excellent. There is only so much material you can fit into a weekly meeting, even if it spans three months. Nonetheless each class was well thought out, and delivered by professionals with deep knowledge of what they were presenting, as they had learned about it through experience.

This network of mentors is phenomenal. Most of the mentors were receptive to helping and those who were, were generous with their time.

The founders who made it through the program were all of high calibre and given their diverse backgrounds, each gave tremendous insights and suggestions into each other’s startups.

What I didn’t get

One aspect of FI that I didn’t know going in, that I felt was somewhat deceptive, was the costs. FI is very upfront about the requirement to incorporate in order to graduate. Going in, if you research a little, it looks like it will put you back only a few hundred dollars. But due to special requirements by FI of how you need to incorporate, it will actually put you back several thousand dollars unless you have legal savvy. In addition, the tax requirements of running a startup costs over a grand a year, if you find the right accountant. There are other assignments throughout the program that cost money, all of which add up.

I went in expecting to put out a significant amount of money—as cheap as it’s become to get a startup up and running, it’s not free, more so when you bring legalities into the mix.

I saw, and still do see, my participation in FI as an alliterative to doing an MBA, and ultimately it was cheaper. Moreover, I received a hands-on overview of what it means to launch and run a company, and got to have late night beers with some of the top minds in the startup community.

My critique

Adeo explains that the idea behind the incorporation requirement is that it pushes founders to action. It forces them to have skin in the game, and as I understand him, is akin to throwing someone in the pool to teach them to swim.

While I think this concept is important, I am not sure that incorporation is the most effective way to achieve that goal. A startup does not need to legally be a corporation to prove its viability. The rest of the program, though, pushes founders to show viability of concept and proof of concept. As an early stage incubator, this is what budding companies should focus on.

I think that, instead of incorporation as a requirement for graduation, a better requirement would be another metric of proof of viability, like creating $X/month of revenue, or a user growth of X month over month. There are ways of launching a product without a fully developed prototype. Both the Lean Movement and the Four Hour Workweek discuss this in depth as well as many others. These metrics are far more important to potential investors than whether the startup has incorporated yet.

Landing pages cost pennies to set up, yet can provide powerful metrics to prove the viability of an idea. I think a focus towards actual metrics and proof of concept, rather than who is fortunate enough to be able to afford a lawyer, would give FI a higher success rate of graduates and be better overall for their community.


I’m proud to be a Founder Institute graduate. I think it’s a great program. I met high calibre people and learned a lot, but I think that the program is flawed. But not by much, a small tweak to the model would make it significantly more successful and facilitate much more viable startups.

Part I: Inkwell Inc, Post Mortem

Some of you are familiar with Inkwell—I founded it as part of the curriculum for the Founder Institute. I had come to FI to see what I could do with the idea, and that idea carried me through to graduation.

The Idea

Inkwell was going to be a crowdfunding platform specifically for authors.

With the rise of self-publishing platforms, it’s hard to get noticed. Inkwell would provide tools for authors to raise the funds from their fans directly for the purpose of investing in the preproduction of their book to increase the chances of their success. It would also provide a trusted network of professionals to help them with production.

Where Inkwell went wrong

While at the Founder Institute, in the week in which we built our financial projections, I discovered that the numbers weren’t looking good. I delayed for a bit, hoping that I could find a way to make it work, but ultimately I was not positioned to make it happen.

One of the stories we hear about crowdfunding platforms is that it’s somewhat of a crapshoot. I can’t think of a single project I have backed that has delivered on time. Costs always go over, things always take longer than expected.

The only way to avoid this is to have deep domain expertise in the product which is being produced. By nature, this is not the case with most crowdfunding projects. The power of these platforms is that someone with minimal background can break into a market with the help of popular demand.

Not providing expertise in the market to support the authors would mean not providing anything meaningful beyond what established platforms are already providing. However, providing that expertise, via a network of professionals, really meant that Inkwell would be more of a publishing house with a technical side than a technological platform helping authors — not my domain expertise.

However the numbers did start to look interesting if I played with specific variables:

More authors. Unfortunately, this isn’t very practical, or interesting. If you look at the Kickstarter Stats page, of all time, there have been 27k publishing projects launched with a total of $66.27m successfully raised. Kickstarter takes a 5% fee that’s $3m in revenue from publishing.

But that’s over the past six years, and they’re at the top of the game. Even if Inkwell could replace them in the publishing market completely, that’s not a very high ceiling for an expected growth. It’s not bad money, but remember, that’s revenue before expenses. For a one- or two-man team, numbers like that can be nice. But to make something like that happen would take a team. With a ceiling of $1m per year in revenue that’s not all that interesting for investors, and could only be considered a labor of love project if bootstrapped.

Successful books. This is the model upon which publishing houses are built. Invest in a slew of books, some break even, a few make it big, the successful books support the publishing of speculations. This is not unlike how VCs and other investors work.

Sadly, now that sales stats are more accessible than ever, publishers are leaning towards supporting the more popular books, which tend not to be the books with staying artistic power.

Implementing this model in Inkwell would mean retaining some of the rights of the book once it was published. I, however, wanted Inkwell to be a launch platform for authors to get picked up and published from, empowering them. Dipping into the dwindling pot of revenue from books would be just another way authors were getting screwed—a fundamental principle I was building Inkwell to prevent.

The way around that would be to publish the books entirely myself. Basically, I was looking at starting another publishing house, while I was interested in creating a technology platform that happened to deal with authors. A classic founder/startup mismatch.

How it could work

I’m not saying that the model is impossible to get right. It would be very wise for a publisher to create such a platform as a discovery engine for them and a support engine for their authors. Authors would benefit from being able to raise money to produce their books, even if they are only self-publishing. If done right, it could break even, and provide a good way to get first dibs on talented authors finding their voice and fanbase.

But as a standalone project, it would be difficult to make viable due to the naturally small margins. Increasing those margins would dig into the author’s needs, which went against the whole reason I wanted to start Inkwell in the first place.

Feature Image Source

How We Solve Problems: Update

I would like to start by thanking everyone who has contributed to the project. I will be sending out follow-up questions shortly to dive deeper into some of the beautiful points submitted.

I received wonderful responses from around the world. People in various positions, from CEO & CTO, to journalist, to entry level developer. This mix I find particularly fascinating. We all come from different backgrounds, and the original question of “how do developers solve problems outside of code?” is only made more interesting by the range of backgrounds of the people contributing.

One thing I noticed is that almost everyone uses their debugging skills through every aspect of their lives. I will dig deeper into this in a future post. I believe that this is one of the main “superpowers” we all rely on most. Keeping it cool, and breaking down problems; knowing that there will be no solution unless we take it step by step.

Thank you all again for contributing and keep an eye out for the series and future discussions.

[UX] My Issue with Windows 10’s Multiple Desktop Feature

One of the more productive features I’ve embraced is the multiple desktops. I tend to compartmentalize tasks, and being able to actually do that visually, helps me focus on what I’m doing, and keep my process organized.

I use Windows at my day job and I was thrilled when I saw that Windows 10 was adding this feature. Unfortunately it comes up short due to one major flaw in the UX, the implementation.

OS X splits the various programs running in to the program and the windows (or instances) of that program. Windows does that too. OS X indicates which  programs are running in the dock with a little dot underneath the icon of that program. Windows does too.

But here’s where Windows, sadly, goes amiss. In OS X you can have different instances of a program running in multiple desktops. No matter which desktop you’re on, if the program is active on ANY desktop, it will show a dot under the icon. If you click that icon it will (should at least) take you to the most recent instance of that program regardless of the desktop that instance is in. Yes, it could work a little more smoothly as it doesn’t always work that way, but it DOES indicate that it’s running somewhere.

Windows 10 separates completely between desktops so that there is no connection between the programs running on the different desktops. This means that when I need a program, I can’t see that it’s running on a different desktop, because the dock only shows me what’s running on the current desktop I’m on. This leads to unnecessary instances of a program running leaving the benefits of the multiple desktops mute and void.

If I don’t know what’s running on my computer I’ll never find that instance, or I’ll waste time trying to find it. If I need my email and I don’t see it’s open, I’ll open it up again. If I waste time looking for it on the 5 different desktops I have open I lost the benefits of having multiple desktops.

True, multiple desktops came in on the Mac in 2009 with OS X 10.5 “Leopard”, and true, it wasn’t great with it came out either. But I had hoped that Microsoft would learn from Apple’s mistakes with this feature.

All in all, I must saw that upgrading from Windows 7 to Windows 10 has been painless, it’s a shame it wasn’t eventful.


[UX] The Chicken and the Egg Problem

I recently had the honor of advising a startup on their initial launch design. The biggest issue I encountered, and I’ve encountered this quite a bit with new companies, is the problem of the chicken and the egg.

Many products rely on two separate types of users in order to get off the ground. A marketplace needs sellers and buyers, a social network needs followers and people worth connecting with, big data needs sources as well as consumers.

The big issue is that you cannot cannot cannot gear a site to both effectively.

Imagine going into an electronics store with sections geared towards the supplier. Would you really want to buy there? The message it sends is that you can’t get suppliers. If you supplied to that store, would you feel confident that that store would be able to sell your wares?

This is a design problem as much as it’s a business problem.

One classic pattern that tries to straddle both is to have two big buttons: “I’m a buyer” / “I’m a seller”. In lieu of the above paragraph, does that still sound like a good idea to you?

A page split down the middle doesn’t look all that good either. It gives the message that you don’t know what you’re doing, what your company’s focus is.

To solve this you need to focus on one. If you can do that effectively, you’ll never get both. Until you get the ball rolling you probably will have to do a lot of manual marketing to the other behind the scenes, to make the site work.

There are two ways to go about doing this:

The first is to put up a shell online for a very manual process that happens in the background. The shell is minimally automated, just enough to make it look like a fully functional site. What this does is it keeps the development costs down while you build a user base and test your assumptions.

Then focus on building it into the tool you would use, while you build up the user base. As you make successful deals through your site those deals make a great foundation for your next homepage that features your successes.

Airbnb did a version of this, I am not advocating for what they did as it might have been illegal, but when they were starting out and trying to grow aggressively, they pooled potential poster from Craigslist.

The second way is to provide a service for the first user-type regardless of whether the second user-type exists.

Kickstarter is a classic example of this. Kickstarter has two user types: project creators and project supporters. But Kickstarter became a platform for the creator to sell to the supporter. If you are a creator and you don’t have a community to begin with, you probably won’t find that community on Kickstarter. Kickstarter stays away from promising that. They created a platform that provides value for the user whether or not Kickstarter is huge.

If you can focus on one type of user you’ll be doing your website’s aesthetic and your company’s business plan a huge favor.

What do YOU thing? Please comment.

How We Solve Problems: Inception

As any good developer, I’m constantly trying to keep up with the latest and greatest, as well as brush up on the oldies and goodies of the skills I leverage daily. As a full-stack developer, I tend to study in cycles, switching between “front-end” and “back-end” skills. In June I presented some thoughts on typography at To prepare I focused quite a bit on design principles. To balance that out, I decided to up my analytical skills and focus next on reviewing design patterns.

“In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into source or machine code. It is a description or template for how to solve a problem that can be used in many different situations. Patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system.”


Some of the top minds in the world have worked out, not only the best way to solve various problems that repeat themselves, but also how to quantify that.

This idea made me curious regarding how this approach can, and has, been applied outside of the world of Computer Science.

An example: Memory Leaks. A memory leak occurs when a programmer, or a language, uses the computer’s memory but neglects to free up again the resources it used.

When your computer sees that it’s running out of resources it starts to borrow memory from other processes that are running in the background, but it can’t return those resources because of the rogue program wastefully using them. Consequently, the computer has fewer resources to run the programs it runs and slows to a halt.

This is what happens with most forms of limited resources, whether financial, stress, emotional, or focus.

People spend money, sometimes it seems like a good idea at the time, but we don’t always reclaim those resources when we’re done, or when we decide it wasn’t a very good idea. We end up throwing good money after bad; either to justify the original decision, or because we don’t have the ability, energy, or know-how to go back and reclaim the wasted resources.

Can techniques developed to find memory leaks be applied to financial management? Can garbage collection be applied to stress management?

I am a strong believer if we have a skill in one area of our life, that skill spills over into other areas of our life…. and developers solve problems all day long. I decided to write a series of articles about how developers solve problems, outside of code.

I was inspired by Advice from Strangers, to explore this in the form of a series of articles. I developed a Google Form to dig deeper and begin research:

This form is designed to trigger the results as much as it is designed to collect examples of them. Some of you have graciously given your time to answer these. If you haven’t yet, I’d be grateful.

I’d love to get the widest range of perspectives as possible, so if you can think of any creative developers who might have something interesting to say on this topic please pass this on to them.

All final answers in by August 10th please so I can bring them into the articles.

(Edit: I’ve been getting some really great feedback, but it’s still coming in, so I’ll be  extending the submissions deadline till August 17th.)

Interested in getting updates about this project? Sign up here or email “Hell Yeah” to developersguide (at) this domain.

How to use JSONP (AJAX to SSL) in WordPress, an EASIER way

I’ve already written about How to use JSONP in WordPress Development. I explain how it works, and why you would use it there.

At work we work with several domains and I’ve had to use quite a bit of JSONP, I’ve rethought how to use it, and made this micro-framework to make it a LOT easier. Mostly, I wrote this to solve the problem that I’m using a lot of AJAX, and don’t want the overhead of the .ajax call each time.

There are a lot of values you need to set when making a JSONP call in general, and specifically with WordPress, this greases those wheels.

The paradigm is all you do is execute:

wp_jsonp("wp_jsonp", "getStuff", {variable: "hello world"}, getStuff);

and the rest is taken care of on the JS side. I wrote it to be agnostic of the server-side processing as well, this gives you the benefit of a pseudo factory design pattern with your switch statement.

You can download the whole repo to peruse or play with if you like, I made some gists for easy embedding.

This is the guts of the operation, I created this javascript object that handles everything, you past the ajax event, method, parameters and a callback function. The plugin takes care of the nitty gritty details that are a pain to remember for getting jsonp to work.

It’s well commented, so read through and feel free to ask questions in the comments if you have any.

Here’s the example, you might say, wait a minute, don’t you get a callback from jQuery already? Sure, good luck using it. It’s a little funny ignoring that, but hey, this works nicely.

Maybe I’m overthinking / over-complicating things, I don’t know, once it’s set up you can move really quickly, isn’t that the point of a framework?

Just one important note: make sure to validate the hell out of things because you’re giving that JS function a LOT of power.

I’d love to hear your thoughts, if you have suggestions for improving it, by all means, please comment below!

Why we need to avoid taboos

“At the great religious metropolis of Hierapolis on the Euphrates pigs were neither sacrificed nor eaten, and if a man touched a pig he was unclean for the rest of the day. Some people said this was because the pigs were unclean; others said it was because the pigs were sacred. This difference of opinion points to a hazy state of religious thought in which the ideas of sanctity and uncleanness are not yet sharply distinguished, both being blent in a sort of vaporous solution to which we give the name of taboo.”

– Sir James George Frazer, The Golden Bough

Frazer posits that the source of pig being forbidden in the Middle East in ancient times was due to its sanctity, via the worship of Attis and Adonis, rather than its uncleanliness. Throughout The Golden Bough Frazer brings numerous examples of how an animal, or object, or place went from being sacred to being profane due to its taboo status.

Whether you accept the thesis of the pig, this idea is found elsewhere. From one generation to the next, once something became forbidden, the reason for its being forbidden got lost.

I grew up with a story about a woman who wanted to get the recipe for her mother-in-law’s pot roast. One thing that puzzled her about the instructions was where that she was told that she needed to cut off the ends of the pot roast, or else it wouldn’t be kosher. When she found the source of this custom, she discovered that the pan, in which the originator of the recipe used to roast her pot-roast, was too small. But because her mother-in-law hadn’t asked why, she thought it was a necessity.

I was taught this story as an example of the importance of questioning things that don’t make sense to you. When people avoid something, and it becomes taboo, the reason they avoid it gets lost, because they don’t transfer that knowledge.

I’m concerned about how it’s no longer acceptable to discuss things that make people uncomfortable. I’m afraid that if we cannot talk about these things,  we are giving up our power to work through them and find real solutions. Whether it’s religion, race, or body image, it’s toxic to make discussion itself taboo. If we cannot talk about something, it means that we will lose the very reason why the issue is important.

Case in point, how many people who were so adamantly supporting the confederate flag knew that its popularity rose in the 50s and 60s in direct reaction to integration?

When we don’t talk about things, their knowledge gets lost.