Wednesday, October 28, 2015

2008 Craziness

I was reading this article tonight about a tweetstorm from @pmarca about the financial crisis and it sparked a couple thoughts about that time for me.

First, it's hard to believe I'm at an age where something that seems so recent to me would be relative pre-history for someone of the age that could be a co-worker. But do the math and there you go.

Second, I was thinking of how crazy that time was and how crazy I was on top of it.

I was 6 months into a voluntary break from paid work exploring my own ideas/projects that I hoped would lead to my starting my own company. The financial system was collapsing. My wife was 7 months pregnant. I was actually feeling hopeful in that I thought they would let more fail than they did. I was still a little more than a year away from hooking up with @jonathanmendez to start Yieldbot and more than 2 years away from that bringing my next paycheck. And on the biggest down day of the market I cobbled together what I could to make some strategic stock buys. (For better or worse) I haven't done any stock trading since.

Reflecting on all of that, I suppose it's no wonder I love the startup world; wherein you get that level of crazy on an ongoing basis.

Tuesday, October 6, 2015

The Song Remains the Same

I've generally been way too busy to lift my head up and do any writing, which is probably something that won't change now. But I was amazed that my last post here was more than 4 years ago and I figured I could even say something random just so that wouldn't be true anymore.

In that time amazing things have happened at Yieldbot, including recently changing to needing 3 digits to count the number of employees in the company. More importantly than the number of people is the quality of the people, the amazing way they work together, and the great product that we've been able to build together.

A couple key things that have stayed the same over the last 4 years -

Yieldbot's mission. Everything feels like it's been an evolution, and my (admittedly brief) description of what we do doesn't need updating. This is a tribute to the original vision that @jonathanmendez had for what we do and how he's guided the ship the whole way.

Happily for me another thing that hasn't changed is I'm still the CTO; though the evolution of my role and what I do on a daily basis as we've scaled the company is hard to even believe. Maybe I'll talk more about it when I find the time.

Wednesday, August 17, 2011

UghSQL

I spent a good deal of time wrestling with getting MySQL installed on my new MacBook Air (OSX Lion), and in the name of saving someone else from repeating that amount of frustration I want to share the insights gained.

The problem I was having was that the install all went fine (using Macports) but the post-install setup of the database, using mysql_install_db, was failing. When it seemed to succeed, it left me with an empty users table and inability to gain access (or set the password for the root mysql user).

I found this: https://trac.macports.org/ticket/28772 which perfectly described the situation I was in.

In the comments of that I got to this stackoverflow answer which was even better.

The first problem I had, for whatever reason, was related to permissions, and that got me past that.

However, it continued to fail.

If you're currently in that situation, I feel your pain. And here is the nugget of info you might need.

The mysql_install_db script attempts to not overwrite tables that already exist when it is called. I believe the mechanism used to do this is a little too coarse. The scripts use the @@warning_count variable to try and detect if a table already exists, setting other variables, like in this case I hit @had_user_table.

After having done an uninstall/install to get me back to clean, I ran the mysql_install_db script again, but also got warnings. It probably doesn't matter, but I specifically got this:

110816 23:42:06 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.

It may have been these, or it may have been some other warnings that were silent, but I think the (empty) user table got created but the initial entries for the root user didn't get populated. Once the empty table exists, subsequent executions of mysql_install_db then avoid writing new entries into the table. The net result being you never get the initial entries for the root user that you need.

The simple fix to this was to modify the mysql_system_data_tables.sql file (which for me was in the /opt/local/share/mysql5/mysql/ directory) to change:

INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;

to be:

INSERT INTO user SELECT * FROM tmp_user;

This is basically setting it up to ignore the fact that it encountered warnings the table existed and instead you're telling it that you know better.
If you're going to do this, you should make sure your table really is empty. Run the server with the --skip-grant-tables option and run mysql and verify that the following:

SELECT * FROM mysql.user;

returns no results.

That we use MySQL for such a very small part of our platform at Yieldbot made it that much more painful. That it kept me from what was going to be my focus for the night, working with HBase, was all the more ironic.

Happy troubleshooting!

Wednesday, July 13, 2011

Are Amazon Spots Struggling?

[Update - heard directly from AWS and they report that the graph issue is a known bug and unrelated to the problem we were seeing getting m2.2xlarge instances. Hopeful we'll get to the bottom of the underlying problem]

[Update #2 - once we shared the info around time and type, AMZN was able to verify that there was a temporary issue involving only the m2.2xlarge, only in our region, and right in the window we happened to want them. Bit unlucky, but we should be all good now :-) ]

This seems pretty coincidental with the AWS announcement yesterday with per-AZ priced spot instances. At yieldbot we do some heavy lifting with clusters of m2.2xlarge servers, and haven't been able to get any spot instances for hours. Luckily we fall back to reserved instances if we have to, we'd just rather not pay the higher price. :-)

Here's a snapshot of the price history taken a few minutes ago for the m1.xlarge instances. Note that us-east-1b and us-east-1d seem to have stopped a while ago. us-east-1a and us-east-1c goes close to current, and our testing verified we could get us-east-1c instances.



Now check out the graph for the m2.2xlarge instances, taken about the same time. Availability seems to have fallen off a cliff hours ago, particularly in us-east-1c which appears to have not had availability for this instance size on the spot market for about 12 hours now.



The AWS health dashboard currently shows all green, which at some level is understandable. Spot instances are, after all, an as-available resource. The interesting thing here though is that the price shows no spikes, no price movement indicating an approaching shortage. The market didn't get expensive, there just stopped being a market.

Maybe AWS suddenly needed to add some instances to the pool of available reserved instances? Happily, reserved instances did come up and with no delays.

But we can't wait to start saving money with the spot instances again.

Anyone out there seeing the same or similar problem?

Friday, April 22, 2011

Amazon Saved Us a Bunch of Disk Space

Someone should start a webpage where people can post the beneficial things that happened to them as a result of the Amazon "cloudocalypse", just for the contrarians out there. Here's our entry.

We use MongoDB for a good piece of our platform, and have been meaning to swap in a backup of the database as the primary.

Because we had created some large collections a few months back that were subsequently dropped (for which MongoDB doesn't reclaim disk space) we found ourselves in a situation of pretty inefficient disk utilization. We'd recently bumped up to 90% on the database disk volume.

At the same time the backup with the same size volume was running at about 40%.

It was on our list to swap the backup in as the primary, but we hadn't gotten to it yet. Yesterday Amazon decided for us that it was time. And now we have all this free disk space in our database volume.

Thanks Amazon! :^)

Monday, October 11, 2010

team++ ftw!

Today's big news out of the Yieldbot offices is the addition of Soren Macbeth (@sorenmacbeth) to the team. Ok, so we don't have offices. If we did though...

Taking a step from being 2 people to being 3 people is huge. Taking that step like we just did, priceless. And now I get to work with @jonathanmendez *and* @sorenmacbeth every day. Woot!

In my startup experiences the early DNA of the team is the difference. Which is why having Soren join us just has "win" written all over it. From our first conversation it was clear our development philosophies were in alignment. I can't wait for Soren's mark to be made on the code base and on the product. Exciting times ahead!

Thursday, September 23, 2010

A Small Thought on Meaning, Humans, and Machines

I was attending Mongo Boston this week when a simple typographical oddity sent me on an interesting (and luckily brief) train of thought.

The simple occurence of "mb" on a slide to indiciate "megabytes" (it's in this presentation). First amusement because generally 'm' is milli and 'b' is bits. Of course expressing something in millibits is generally useless. So of course a human reading it (unless you're weird like me) doesn't give it a second thought.

Then I thought about the difference in how quickly I (and everyone else) make the right assumptions on what 'mb' in this context really is intended to mean.

And therein lies the huge challenge on the machine side if you're doing data mining and analytics. How do you infer intention automatically and properly, especially when you don't know ahead of time what type of mistakes or inaccuracies are going to be involved? Just the type of thing I've been having fun figuring out over the past year - at least for a particular problem space.

But something else interesting crystallized for me too at a human level. That this auto-correction that we all do so that we don't sit there confused by how one would break something into 200 millibit chunks is also the cause of many of our problems.

We need to be able to jump to conclusions in order to get past "mb" without having to ask a presenter for clarification, but we also are prone to jump to conclusions when we shouldn't - particularly in judging attributing some intention to someone else's action.

Two side of the same coin, one useful and the other problematic. Mostly we can't have one without the other though. Although I guess with practice we hopefully get better at figuring out when to jump and when not to jump. Though I think way too many people never figure out when not to jump.

If there were any typos above I hope your brain autocorrected them for you so you didn't notice.

Wednesday, September 8, 2010

The Best Wisdom is Portable

By which I mean that it can be put in multiple contexts and keep its status as wisdom.

I'm reminded of this over and over reading Seth Godin's book "Linchpin". I was expecting it would be a good book, but only a few pages in I was as excited about reading the book as maybe I've ever been starting off on a book. It just resonated so well with me, gave better voice than I could to vague thoughts that I've had, and went in brilliant directions I would have never thought of.

I'm now most of the way through, and I look back and it seems like almost at every page I wanted to stop and jot down at least one quote. Though I haven't (until now) because I couldn't bring myself to stop the flow of reading it.

The highly portable quote I hit today:

"Great bosses and world-class organizations hire motivated people, set high expectations, and give their people room to become remarkable."

This is one of the thoughts that so obviously resonates with me right now as we're thinking about putting together the team for our startup to take it to the next level.

But I feel like its true wisdom is that it resonates just as strongly in the completely different context of being a parent. It just strikes a chord with how I think about how we want to approach raising our almost-2-year-old daughter.

All children are motivated learners; are naturally curious. So you get that for free. Setting high expectations and giving her room to become remarkable is where the magic can happen. I get the impression that too many parents forgot that the last 20 years, and I hope that it's changing now.

This isn't the first case that this portability of wisdom in Linchpin hit me, and I think that is the real genius of the book.

Wednesday, September 1, 2010

Mosques, Corporations, and the First Amendment

Earlier this year I agreed with the Supreme Court majority decision on Citizens United that on First Amendment grounds Corporations and Unions could not be limited in their funding of campaigns.

The common argument made, which I disagreed with, was the simple one that the ruling made was that "corporations are people" and that this was ridiculous. And that the First Amendment should only, and was only meant to, apply to individuals.

I felt that the inclusion of "the press" in the original document indicates that these Rights, while grounded in the rights of the individual, did actually extend to the aggregations of individuals as well.

Fast forward to today and we have the "ground zero mosque" issue. Here as well I feel that under the First Amendment, this *organization* has the right to build their Community Center/Mosque wherever they see fit, and many are arguing the same. And it isn't because I/we think "churches are people" (or that "congregations are people"). Note, no single person is building or funding the community center. The first amendment here is getting invoked properly as applied to this group of people, and this should kill the "corporations aren't people" line of attack on the Supreme Court decision on Citizens United.

To put it in perspective, imagine the precedent had the Supreme Court ruled the opposite way on Citizens United. The decision would have been that the government can severely restrict the rights of aggregations of people, so long as the rights of the individuals are preserved in some more narrow sense.

Using this logic you could then say that the government could have the right to put restrictions on where a mosque get built, perhaps "within reason" or some vague qualifier. For instance, it would be easy to argue using this logic that the government could require the mosque be built 10 blocks away from the proposed location, as there would be little argument that it would put the individual members in a position of not being able to enjoy "free exercise" of their religion - it would be just a little extra commute (for some of them) after all. If you disagree with that, imagine it again but 1 or 2 blocks instead of 10.

Now one argument would be that churches exist for the express purpose of the exercise of religion and so it is more obvious that their rights more directly derive from the rights of the individual members. But then in the Citizens United case the Corporation in question was one that was created for the express purpose of putting out a political message. So its rights too were very directly derivative of the rights of the individuals that funded it.

Anyway, this is really a complex issue, much more so than "the Supreme Court thinks Corporations are people" line of reasoning.

Personally, I definitely do think that there is an overall problem of money and politics mixing. As I wrote about recently I think that transparency is a great part of the solution, as you saw in that recent case of Target dipping its toe into political contributions and the public backlash.

If we don't have full transparency yet on the money trail in politics we absolutely should have every measure in place to be fully transparent. The power of transparency in this age of information technology I think should not be underestimated.

I also think that it would be healthy to explore options to amend the Constitution to be more specific about rules around elections in particular since they are an aspect of the direct running of government. The bars are somewhat high to get that started, and they should be. But that mechanism is there for us to make changes that we deem important enough (but as Prohibition showed, we can certainly be temporarily pretty stupid about things).

But as far as the first amendment goes, I'm happy to have it consistently apply to individuals and to the organizations that individuals choose to create and belong to.

Wednesday, August 25, 2010

Go Into (Technical) Debt With Eyes Wide Open!

This morning Bijan Sabet had a good blog post on being open and honest about "technical debt".

I think (and commented there) that it's important to get into such debt with your eyes open and plans for how to address it in the future.

If the context isn't clear, what's being talked about here is basically hastily put together technology that accomplishes an early version of what was needed of a product but is considered "debt" because it cannot remain in the state it is in. It is carried as a kind of liability because at some point, either because of new features that are required or it isn't scalable, time and effort will need to be *paid* in order to make it more robust.

Having gone through the process of building multiple software systems from the ground up has clarified for me how technical debt should be planned for. And nothing clarified it for me greater than working on a large project with a hefty amount of inherited technical debt that we successfully cleared off the books, and the monumental effort that it took to do so.

I find it important as you are putting a system together to consciously make the tradeoffs that are necessary and have a plan for how the code (and technology choices) would be iterated and scaled up when the needs arise.

As in monetary debt, this is akin to advising not to take a loan without having a plan for how you're going to pay it back.

Along the way there are also very smart choices you can make to help make that debt less too. Layering and using adaptors being one great example. It can be expensive to retrofit an adaptor model to something that was written assuming it would only have to interact with one particular technology. So abstracting early, even if you are in a hurry, will help you with your later "payment plan" at a fairly low cost up-front.

Another good example is having an MVC model on your UI, which will help later when you need to put an API in place (and reuse the "M" and the "C").

Something to watch out for is piling debt on top of debt (don't charge your mortgage to your credit card!). That is, when the feature comes up that needs to utilize another technology that is in need of repair, instead of making matters worse you should seriously consider at least starting to pay off the debt on the older technology.

The important bottom line is take the debt seriously and don't enter into it lightly. Yes, it's necessary, but have a plan. Things will come up you didn't expect, and you'll suddenly find liabilities where you didn't know they existed. But then you'll be freer to deal with those unexpected things since you're in better shape overall. And your future self will likely thank you for it.

Thursday, August 19, 2010

Decentralized Beats Centralized

The current uproar around Target and its political contribution that ended up supporting a Republican candidate whose beliefs many disagree with is, I think, very instructive and holds lots of lessons. (CNN info about it here.)

The biggest for me is that it shows how transparency and decentralized action can be a healthier political force in the country than centralized enforcement.

Other than an unfortunate glossing over of some important nuance (more on that below), I think this is playing out exactly as I would have hoped after the Supreme Court ruling earlier this year that corporations could make political contributions.

Even though I'm concerned with large corporations unduly influencing our government, I felt the Supreme Court ruling was correct. Previously, the regulations around what corporations could and couldn't do were too difficult to decipher. It's a difficult problem to solve by centralized fiat because there are many subjective dimensions to defining what might be allowed.

But what is important is the requirement for transparency. This puts the information out there to be dealt with in a decentalized way, which is exactly what is happening now. And, of course, there's never been a better time to make information available which could lead to decentralized forces making their voices known.

Basically the Supreme Court crowd-sourced the problem. They essentially said that instead of saying there will be a central definition of what is acceptable, we will require transparency and let the masses do the job of keeping corporations in check. And the masses, unbeholden to "Mainstream Media" and with the tools of social networks and the virality that comes with it, have never been better prepared to do this.

The good lessons for corporations here will be that they can suffer reputational harm by making political donations, even those that might seem innocuous. This should serve as a brake on their making the contributions.

In fact, this is where the lack of nuance comes in.

The reality of the money flow is that Target contributed to a pro-Business group in Minnesota called "MN Forward" (www.mnforward.com). MN Forward then contributed to the ads for the politician in question. Their issues page lists: Tax Reform, Spending Reform, and Education Reform. Noble goals all.

The bad part about this loss of nuance in the story generally is that it means that people are assuming that Target and its principals have an anti-gay agenda. An objective look suggests that they contributed to a pro-business organization, who in turn backed a pro-business candidate who also holds non-progressive social policy positions (specifically, against gay marriage).

Now, the *good* part about this loss of nuance is that it will serve as a warning to other corporations. They will realize that their motivations for making a particular contribution won't matter as they can be undone by the perceptions about a candidate that might ultimately benefit from the contribution (even if at least once removed).

Let's hope we all keep doing our job and using all of the information we can get our hands on to our advantage, and solving the problem of corporate meddling in politics by being more a part of the process that can solve it.

Tuesday, August 10, 2010

SE is to CS as ME is to Physics

The past week I have had thoughts rolling around spurred by this post by Andrew Parker. The general theme of which is "how little a computer science education matches up to the real-world building of large scale applications." I thought it brought up a really good issue.

For me the issue comes down to whether you see a CS program as vocational in nature. Back when I graduated (in '95) I thought then that the CS program at my school (WPI) was too vocational in nature.

At WPI you do a major project your senior year as part of your graduation requirement. I've always leaned to the theoretical and mathematical side, and for my Physics degree my project was in the area of Quantum Mechanical energy degeneracies in multiple dimensions. No, I don't remember the equations in detail. But it landed me a published paper in the American Journal of Physics, so that was cool.

When it came time to do the major project for my CS degree I was the only one in my class not to work on some type of coding project. Instead my project was "Complexity Analysis of the Primitive Recursive Functions." I got all the coding experience I would need being in a Coop program and then staying on to work part-time after that, writing embedded firmware code in Assembly and C and Unix (SVR4) drivers and application code in C. And I think that's the right mix.

(And yeah, I know, with degrees in those two fields you'd think I would've leaned to Quantum Computation or something, but I'm not *that* theoretically minded :-)

It seems to me the argument is around the "S" in CS being "Science". There's a real difference between "Technology" and "Science" that we should recognize.

This is obvious when you look at Physics (which I majored in) and Mechanical Engineering (which I also majored in briefly before switching that one to CS). In ME there is more a lean to technology. No technology in Physics, other than around the instruments for running experiments.

I'd argue that we need just the same type of split (with cross-over training of course) that exists in Physics and ME in the field of computation.

I think there's already been one split that's happened that makes sense, which is in the field of Electrical Engineering with a focus on computers and lower-level programming - I think I've seen this referred to as ECE.

If we then split off "Software Engineering" as a full-fledged major, that feels like: SE is to CS as ME is to Physics.

Let's be honest, there'd be a *ton* more SE than CS majors, but who cares? At WPI when I was there we probably had at least a 10:1 ratio of ME to Physics graduates. Just like ME majors have to start with some Physics courses, SE majors would have to fulfill the basic CS courses.

The upside is that the SE majors would have a clear focus and would probably come out with much stronger industry skills that would enable them to start building things right away. Again, pretty close to the analogy to ME and Physics.

I'm sure there must be places where this split of SE off of CS is already happening. If that is the case, it should just be happening even faster :-).

I was also motivated to write this by a couple mathematically-oriented CS stories that came out in the past week. The first being around the attempted P!=NP proof, which brought back memories to my complexity theory studies. For the latest on that, this blog is following it.

The other story that caught my eye was around a proof put forward that any position of the Rubik's Cube can be solved in 20 moves or less (http://www.cube20.org/).

They served as reminders to me that a CS education is much more than learning about pointers, or whether you can create anonymous classes in Java easily, or how to work with a source control system, or how to provision and manage a Hadoop cluster.

Honestly, compared to when I graduated (it wasn't *that* long ago was it?) all of that can be learned and played with online. With guides, and open source projects looking for you to contribute. And, as a friend reminded me today, things like Google's Summer of Code to really go head down into implementation.

I'm sure there's never been a better time to learn about and become a great software developer. And really I think there's more and more proof that on the "technology" side (as opposed to "science" side) it doesn't even take going to school anymore.

Tuesday, August 3, 2010

Memory Lane

Here's to the launch of the TRS-80 back on 8/3/1977 (Wired article: http://goo.gl/njnJ). I remember the model well because I had a "pre-owned" one back in the early 80's.

At the time it was an awesome upgrade from my first computer, the Timex Sinclair 1000 (although I had the 16K expansion unit for $50 for that baby!)

The funny thing about the TRS-80 is that I liked it because it looked like a "real" computer. More like what you could see in the movies. Given everything started with "War Games" for me (like everyone else at the time?) I think it makes sense.

I regret that I have didn't have an Apple computer back in the 80's. But I did follow an eclectic path from the TS/1000, to TRS-80, Coleco Adam, Leading Edge IBM clone, and then finally 386, and eventually Pentium.

At the same time my online experience started in about 1986 on a teletype we had at school with an acoustic-coupled modem dialed into a small PDP-11 network. High School brought with it a VAX cluster, college was networked Sun workstations (Gopher was all the rage!), and finally the Internet.

Some signposts I can measure my life by.

Tuesday, July 13, 2010

Bootstrapped Travellin'

I'm getting ready for a trip to NYC "on a bootstrap" (I'm thinking this makes more sense than "on a shoestring" in this case, given we're still "bootstrapping" our startup).

Circumstances have me dropping my mother off at Logan airport during rush hour, with a trip to NYC planned for the next day. Having friends that live in Revere (very close to Logan and Boston) and NYC is making for an interesting itinerary.

It won't be "planes, trains, and automobiles" but "trains, buses, and automobiles" (and "air mattresses"). Well, "planes" too if you count dropping my mother off at the airport...

It's looking like:

  • Drive in to airport

  • Spend the night near Boston, where car will be left

  • Train (T) into Boston in the morning

  • Bus from Boston to NYC

  • Spend the night over another friend's place in NYC

  • Bus from NYC to Boston

  • Train (T) back to friend #1's house

  • Drive home!


You can't book that on Kayak.com!

Thank goodness for friends, the T, and Boltbus.

Friday, June 25, 2010

Idea vs. Execution

Last year I was on a flight and the in-flight entertainment switched after the movie to some other types of shows. One of them was around interesting engineering feats and had a feature on a submersible car. It could basically drive into water and then navigate as a submarine (shallow depth naturally) under the water.

A few rows ahead of us I heard a woman turn to her friend and exclaim "hey, I thought of that!"

This betrays, I think, a common propensity to value an idea over execution. Or at least to underestimate the challenges in the execution. Imagine all of the myriad engineering challenges that had to be overcome in order to execute on this idea of a submersible car. And then someone tries to sum it up with "I thought of that too".

For me this story embodies the increasingly common maxim for the entrepreneur that it is the execution that matters. To share your idea. Get feedback. That everyone else has their own ideas. And if somebody pulls off something that you had thought of but didn't execute on - be impressed with them, not with yourself for having the idea too.

Friday, June 11, 2010

Symmetry and Code Refactoring

Whenever I make large refactoring changes within a project I think about it in terms of symmetries. I'm not sure anyone else could find that useful, but it's worth a shot.

While getting my Physics undergrad degree there were two things that really held my fascination, quantum physics in general and the role of symmetry in natural laws.

In my opinion the concept of symmetries in nature as the basis of conservation laws was one of the most elegant findings in Physics. We owe Emmy Noether for that almost 100 years ago (between this, Relativity, and Quantum Mechanics, the early 20th century in Physics was just a ridiculously productive period of progress in scientific understanding).

Since then, I've found it interesting, and sometimes useful, to think about things in terms of symmetries. For instance, I think a fully rational ethical philosophy can be built on top of expressing our existence in terms of symmetries (the ideas behind "walking 1000 miles in someone else's shoes" or "The Golden Rule" I see as rooted in this).

But back to coding...

I've sometimes found myself needing to make major changes to a complex system. This can always, as they say, be "fraught with peril." The first (and biggest) of these started with a monolithic Java app that wasn't built on a framework, represented objects with maps, had manual construction of SQL for database access, used CORBA for Java client communication, had little vertical layering of levels of abstraction and little horizontal separations of logically separate spheres of influence.

Certain types of changes to that type of system were just a nightmare to contend with. A particularly obvious example is how changes to the object model that affected the storage in the database might require changes in several seemingly unrelated places in the code where SQL strings were manually constructed.

The team I led transformed the app (which we already started shipping) to be J2EE based, with an EJB interface, employing an ORM layer, with standard Java communication between client and server, and good horizontal and vertical layering, while adding functionality for continued evolution of the product.

To me, the key to successfully making these changes was symmetry. And the reason why is because symmetry essentially boils down to the invariance of some observable for a given type of transformation to a system.

The simple examples of symmetry are those of geometry. A circle is fully rotationally symmetric because no matter how many degrees you rotate it, its appearance remains the same. A square has a rotational symmetry of the 4th order, because you can rotate it 90 degrees and its appearance remains the same.

And this has to do with code refactoring? Sure. The idea was essentially to map out a series of transformations in the code, with a plan for what behavior of the system was going to be preserved for each particular change. This allowed the ability to test each change to make sure that it preserved the behaviors that it was meant to.

I saw each coding change as rotating the square - and the goal was to rotate it the full 90 degrees so that it still looked like a square. Even if what happened behind the scenes involved major structural change.

It's certainly possible (who knows, maybe advisable) not to think of this in terms of symmetry, but that's just how I do it. The key is really to try not to attack everything at once. But instead, to split the changes you're going to make into changes where each can be tested to not have broken the behaviors that it shouldn't have affected.

For me, thinking about it in terms of symmetry provides discipline in terms of defining how much change should be taken on at any given time. But your mileage may vary.

Monday, May 24, 2010

Small suggestion on Python nested code blocks

I've been coding in Python for a while now, and there's one thing that I've found problematic with regard to nested code blocks. It comes down to the age-old Python debate about whether you like Python's "indentation level" approach to determining what block of code a statement belongs to.

In general I actually like the Python approach. For one thing it removes the debates (going back to at least C) when developing in most languages around what style to use for braces. Especially for people who don't realize that K&R is the way to go.

The problem I have is when I have multiple levels of nesting that ends up being like an overhanging cliff that you can fall off of if you're not careful.

if one_thing:
do_something()
if another thing:
do_another_something()
if third_thing():
do_yet_another_thing()
do_thing_after_cliff()

The two problems I have are that it is harder to keep track of what level of nesting a statement is in for some cases. The bigger problem is if the statement do_thing_after_cliff() accidentally gets modified to be at another indentation level it can be very non-obvious. This can come up when moving chunks of code from one indentation level to another.

I've started using a simple trick to help with this, and for me it really helps visually. Basically I use a double comment "##" where I would normally put the "}" if I was working in another language.

For me this provides the visual cue that helps. And it also should make it obvious enough if statements accidentally get modified to the wrong indentation level.

if one_thing:
do_something()
if another thing:
do_another_something()
if third_thing():
do_yet_another_thing()
##
##
do_thing_after_cliff()
##

I don't use it absolutely everywhere, but it helps in the cases where your eye doesn't immediately feel comfortable with how blocks might line up.

Tuesday, May 18, 2010

First startup nostalgia

Going through the bootstrap process on our company has brought back memories of starting day at my first startup.

It was back in '96. Not everyone was doing or had been in a startup before so it felt really new. I remember being surprised that we wouldn't be working in a garage or a basement. And that there'd be a 401(k) and health plan. I thought it was supposed to be tough?

Though I signed on before the Series A closed I wasn't to start until it did close. That felt like a looooonnngg wait. Probably about 4 weeks in reality.

The great memory that I have of that time was reporting for the first day of work, which was the first day there was office space. Walked into the office space, and there was - nothing. No cubicles. No chairs. No desks. No computers. A big empty room. (Cool! This WAS going to be a startup after all!)

Our VP of engineering brought in donuts that morning along with some chairs and a whiteboard and we were off and running... By the end of the first week we had cubes, desks, chairs, and some plans.

There's nothing like the feeling of starting from a blank slate. I'm on the 4th time with that feeling and it never gets old. There's also an excitement to getting by with less while you help get everything in place. In my second startup my personal laptop running Windows 98 served as our corporate Internet gateway using dialup while we waited for our T1 install!

The first three times there were network devices to install, desks to help put together, and of course fundamental early decisions to make sitting or standing around a whiteboard.

This time that's all replaced pretty much with services to provision in the cloud. No office space, so no office network. Email and collaboration via Google. Product deployment on servers in far off data centers.

One thing remains the same though. That great feeling of the fresh start. Balancing priorities and trade-offs and trying to maximize the value of what you're going to build.

Very addictive - I highly recommend it.

Monday, May 3, 2010

Unintentional Google Voice Humor

Been using Google Voice for a couple months and it can be somewhat amusing when the voice recognition for the voicemail transcription doesn't quite pick it up right. Had a good one yesterday though.

"If you i just wondering if you could give me a favor. When you come back or when you're on your way back. Can you pick me up like I D cap promo much at all at Starbucks just totally wiped out. I have no idea why I feel so it I think I've been drugs. But anyway, I, I'm gonna trying to the blood down for a nap this morning and I think, up opportunity. Thank you. I mean to you later. Bye"

As a friend pointed out - notice that it didn't have a problem picking out "Starbucks". No surprise, since Google's all about the advertising!

The full corrected message isn't worth it, but for the record, "I D cap promo much at all" is actually "a decaf Carmel Machiato".

The best message transcription fail might be this next one. Although in this case it isn't to be blamed because it was my wife and 17 month old daughter speaking in Portuguese.

"I saw what at the cottage for the dangers visa. Thank you. Bye bye these pages knows. Bye bye. Tom O these Aunt Karen these whoa whoa. Hey, but cos he meant 9 bye bye delivering basis hello."

If the system were a human it would have been pulling its hair out on that one!

Saturday, May 1, 2010

"Statistics is the new grammar" - Wired

This article in Wired this month is right along the lines I've been thinking for a while now. Our current education priorities so poorly set our kids up to deal with the world of today.

I truly think it's not useful to have opinions on a large range of topics without understanding how statistics and probability factor in.

If we're clueless about correlation vs. causation, anecdotal vs. statistical, how can we make sense of the world?

This dovetails with the thoughts I put down last month on the Tyranny of Intuition. If we can't make good educated judgments on something, then we're left with making our best uneducated judgments instead. Which I think is setting our selves up for an epic fail.