actually pretty simple

code editor feature:

In programming, {braces}, [brackets], (parentheses), "quotes", etc., are always only created and destroyed in pairs.

In the same way that a word processor would not create a <b> tag without creating a matching </b> tag, a code editor should not allow blocks to be unbalanced.  So, in the same way that you make text bold by pressing ctrl-B, you should make code into a block by typing {.  And when you delete one bracket, it's the same as deleting them both, because it doesn't make sense to have one without the other.

Making the editor smart enough to do this correctly when you don't have anything selected is a bit of a trick, but I think it should be solvable.

So, perhaps my short term personal goal shall be to download scintilla and SciTE source code, and to see if I can hack it up to act this way.  Eventually the goal is to take the job of managing blocks and whitespace away from the programmer entirely.*


*Currently there are lots of editors that will tell you, "hey, your blocks are unbalanced here", but I think that's lazy and insufficient.  Software tools should never be lazy, they should let their users be lazy.  Whenever a program tells me that I have a problem and how I should fix it, I look for the button on the dialog that reads "fix it yourself if you're so smart."  I never find it.

a programmer's nomadic life

I don't have a home language; I hate them all.  I'll use whichever one is least annoying for the task at hand.

Is there a better option than C++ for writing a performance oriented text editor with no extraneous requirements?

learning from debuggers and word processors

Continuing on the subject of a code editor.  I'm calling it "ned," for Nate Edit.  What?

When debugging code in a modern debugger, there's a window called a watch window that shows you the state of various relevant variables.  You can use this to visually inspect the state of the program as it runs.  Is there a place in the Ned UI for a similar collection of symbols?  In many editors this information is exposed through autocomplete, and I think that's a good feature, but is it quitting early?

  • Maybe things that are in tooltips or autocomplete windows now, should have permanent real-estate in ned.

On the topic of debuggers, and what we can learn from them: many editors, notably eclipse (which I hate for unrelated reasons), continually compile your code as you work, so that it's ready to run at a moment's notice, and so that errors are highlighted on the fly.  Is this quitting early?  

  • Maybe instead of just constantly compiling the code, we should be constantly executing it in a sandbox, and putting breakpoints at the cursor so that you can see the state of execution as you code.*

I don't like managing white space, brackets, and navigation; I hate getting lost in a project.  The editor should do as much of this as possible by itself.  Many editors have automatic beautification, white-space removal, and browser controls, but the programmer is still in charge of managing the tags, the text, the markup.  This is quitting early.

  • Maybe we can apply some of the lessons of WYSIWYG html editors to writing code; the markup that creates the logical structure is not important; visualising the logical structure is.

*OK so, this sounds totally implausible at first, but hear me out... what if when the program is executed in the debugger, we capture and remember the most recent program state and parameters that were passed in to each function.  Then, when I'm coding that function, we automatically compile and run just that function, in the context of the saved state.  It might not always work, but I think most of the time it would give you more insight into what's going on as you work on the code.

a code editor that isn't

We had a discussion at work today about the process of programming, and programming tools. Mike made the observation that many times instead of coding you end up typing. That is, just spending time entering text. We agreed that the ideal code editor would eliminate the task of typing, and would allow you to work at a level of abstraction higher than the literal lines of code that make up your program. We want a code editor that is not simply a smart text editor.

See, today we look back at the state of programming 40 years ago and say, how could they use punchcards.  40 years from now we will say, how could they use text files?

So I've got a bug in me now to write (or at least design (or at least talk about)) the next generation of programming tools.  A lot of it won't be groundbreaking things; a lot of this stuff exists today in various different programs, but what I've never seen, and I'm convinced doesn't yet exist, is a unifying vision that is strong and grand enough to sweep up our collective imaginations and change the way we think about how we work.

great news everyone

We have a name for the house now, it's Frontier Town.

It fits, I like it.  All this talk about the economy has got me thinking about the mindset of the people that grew up in the Great Depression.  They had different virtues.  Thrift and self-reliance were emphasized.  In many ways those virtues became obstacles when times were better, but I think they're interesting, if we're to be heading into a rough few years.

Will we see another generation that never throws anything away, that plants gardens and repairs their own cars, and complains about the wasteful attitude of their children?  People are funny, and I mean that in the best way.

asterisk

INTP FTW

relief

I'm really relieved to be done with all of the Christmas gift stuff, at long last.  It got hectic, and I felt like I wasn't able to give everyone the attention they deserved... but I guess that's just how it goes.  I blame my Meyers-Briggs  type.  Looking forward, I'm excited about putting some of my gifts to work; the crock pot, the skillet, and the miter saw specifically!  I can't think of a project that uses all three though.  Maybe an outdoor kitchen*.

I'm working on some self improvement things; getting more exercise, feeling less rushed or hurried, thinking ahead more, that kind of boring stuff.  Ouch, am I really that disinterested?  Apparently.  Actually, I'm writing a time-management game at work now, which gives me a good opportunity to meditate on a lot of these issues.

It occurred to me the other day that I have a lot of hobbies that take up less than 1 percent of my time, even less than 1 percent of my free time.  Things like welding, sewing, woodworking, making jigsaw puzzles, baking bread, making candles, selling tshirts, etc..  Lately even programming (for fun) is under 1%.  This seems weird to me, but maybe it isn't...?  I bounce around a lot, but I like to think that there's an over-arching theme to it.  (The theme is awesomeness ;-)  

I guess what *actually* ties it together is the concept of the castle.   The castle is really just an environment that enables a lot of these dumb hobbies, because in my conception of the castle I can participate vicariously in everyone else's crazy hobbies.  It's an environment for shared exploration of active creative lifestyles.  If that makes any sense.  The shape doesn't really matter, but the shape of a castle seems to inspire the kind of people I'd like to attract.

ok back to work.


*This is what you get today on my blog: stream of consciousness.

so angry

Right now I make my living by using Adobe products, specifically Flash and Flex.  So it's unfortunate that I can't stand Adobe products.  Flash CS4 is almost completely unusable.  Its performance when editing medium to large flash files is unforgiveable; when I click to select an object, or to edit a symbol, I can wait 10 seconds for the interface to respond.  Not acceptable.

What am I gonna do about it?  Probably nothing.  I only mention it here to record my displeasure, so that I don't forget it, start coping, and forget to be angry about it...that would mean losing a part of my soul--the part that cares about good interface.

correction

Actually, if you've let the wick of your candle be sucked down into the wax as it cools, you can get it out again, if you have a soldering iron.

cs theory question - wrapping inheritance

non-programmers may skip.

I'm curious; is there a language that allows you to extend a class by wrapping it?

That is, a language that lets me type:
class ExtraFunctionality wraps BaseSystemObject
{
  ExtraFunctionality(BaseSystemObject wrapped_object)
  {
    wrap(wrapped_object)
  }

  //override
  void do_an_awesome_thing()
  {
    super.do_an_awesome_thing();
    do_extra_things_too();
  }
  
  void do_extra_things_to()
  {
    //...
  }

  void do_a_lot_of_things()
  {
    super.do_easy_thing(1);
    super.do_easy_thing(2);
    super.do_easy_thing(3);
  }
}
So that I can then write 
ExtraFunctionality my_obj = new ExtraFunctionality(api.get_base_system_object());
my_obj. do_an_awesome_thing();
my_obj.do_a_lot_of_things();
my_obj.another_base_class_method();
api.use_base_system_object(my_obj);
I can't simply extend the class because I'm not constructing it myself, I'm getting it from the system, so it won't cast.  If I wrap it using a conventional class, then I either have to override everything myself, or else expose the wrapped object and let the caller decide how to deal with it, which is ugly.  Either way though, I can't pass it back into the system, because it's not the right type.

So, I want to inherit the type in the form of a lightweight, easy to write wrapper.  I think this case is getting more relevant these days as APIs and SDKs are coming to dominate the coding landscape, as opposed to working mostly within code you control yourself.  Comments?

obnoxiousness

1. chipotle hummus bread with sesame seeds
2. honey pecan whole wheat bread with sunflower seeds
3. purple 'vineyard' scented candles poured into red wine glasses
4. coffee scented candles poured into glass mugs
5. thousands of dead zombies

That's what I did with my day off.  Some of you may get homemade candles as belated xmas gifts.  The chipotle bread came out a bit parbaked, (I took it out early 'cause the crust looked done--this is why I am terrible baker), but it tastes great, so I won't complain.  I haven't opened the other bread yet, but I think it'll be more done.

I've been slightly appalled at my burn rate for money; I really need to cut back, so I'm going to stop eating out for a while, and try to get into the habit of making lunches and saving leftovers and so forth.  Life skills, you know?  Oof.  It's not really that I have expensive tastes or hobbies, it's more that I just don't ever try to save money; if I've got it I tend to spend it, on this or that.  So my resolution, if you care to call it that, is to learn the ways of thrift.  It's all a part of the larger plan...

Ohio was great, even though we didn't get snow.  I felt right at home.  Too, I really, really needed the down time, and I feel a lot better now than when we left.  Time to get back on top of my life, instead of being dragged along beneath it, is how I always think about.  I think I feel a few schemes coming on.

So candles.  I thought, oh, I'll make some holiday candles, it'll be easy and fun and make a great gift.  Mostly true I think, but wow wax is funny stuff.  When it cools from a liquid to a solid it shrinks quite a bit, and so the centers of the candles sink in.  If you've removed the support for the wick already, the wick is pulled down as the wax sinks, and you can't get it back up again without reheating the whole thing so... don't remove the support for the wick!  You need to wait at least like, 6 hours for the wax to cool, and then fill the sinkhole with more wax, and then wait again, and then fill one more time, and then wait again.  Then you can remove the support.

Lesson learned I guess?  I'm sure I could have gotten that advice from somewhere, but I probably would not have listened, that's just how I roll.  Not proud, just sayin.

the (zombie) hookup

Is anyone playing Left 4 Dead on 360?  I've actually acquired some competence at this game, and I'd love to play with friends.

By way of game review slash encouragement:

This game doesn't do a lot of new things, but it is executed *perfectly.* (in this sense it's the opposite of Dwarf Fortress.)  The sound work is amazing, the graphics are cinematic, and the pacing and level design are flawless.

This is a game that rewards teamwork and severely punishes going it alone.  What I love best about the game is the effortless multiplayer communication.  Your in-game characters talk to eachother, and it's always relevant.  Stuff like, "I'm reloading," or "hey guys I need to heal" or "there's a pipe bomb over here."  Also, "why are you shooting me?"  I don't have a headset microphone for my 360, and I find that with this game I don't miss it.  The team notifications, and being able to see where your teammates are even when they're behind walls, means that a whole layer of basic communication is handled automatically, and well.  

Aside from enjoying the genre, there's something about the co-op experience that I find really addictive.  The only other co-op game I've played that hooked me this well was Natural Selection.  I think what the two games have in common is a focus on co-op interface design; NS does it with the commander and hive sight, and L4D does it with frequent in-character voice cues.  Both succeed because the tools allow you to create great little stories, over and over again, that the whole team participates in.

There's something about being a part of a well functioning team that we humans love (and the social tools we use can make or break the experience).  Some people get this team experience from sports, or from a game like Counterstrike or what-have-you, but I think that what Valve have done with Left 4 Dead is lower the barrier to entry.  Now you can have that team experience without having to have first mastered the game, and without having to ACTUALLY TALK TO ANYONE.  That is impressive.

and timing is everything

The timing is perfect to write a book titled "In Defense of Junk."  If this book does not exist in one year I will be severely disappointed.

economy

There's an entire alternative economy of people who don't work jobs, or at least who don't earn their money from their day job.  Not all of these people are are wealthy, but everyone who is wealthy is one of these people.

I'm feeling bitter because I was never taught about this economy.  I don't have any experience with it and it's difficult to know how to start, because by it's nature it is ad-hoc and specialized.  But this is where I am going to try to go.

Jobs are for suckers.  Oh sure, there's dignity to work, and it's not a bad way to pay the rent in the short term, but if you look to your job to take care of you over the span of your life and your children's lives, you will never be free; you will work until you no longer can.

That thought terrifies me.

Every time I meet one of these people, who live outside of the daily grind, I feel simultaneously ashamed and jealous and bitter and indignant.  But I try very hard not to be angry at them, because instead I need to learn from them.  

Swallowing my pride is very hard, but hopefully I can be honest with myself, at least.  I am not currently where I want to be, and I should start learning what I need to do to get there.

alternative currencies in practice

Interesting.

Homegrown Evolution: Time Banking
So what is money but an abstract representation of misery, time spent doing things we'd all rather not be doing? How about an alternative? How about taking all of our hard earned capital away from the Wall Street types? Get ready for time banking.

With time banking, you get together with your local community members, friends and family and exchange hours rather than currency. Time Bank USA describes the concept succinctly:

'For every hour you spend doing something for someone in your community, you earn one Time Dollar. Then you have a Time Dollar to spend on having someone do something for you.'

Time banking isn't defined as barter, so you don't have to pay taxes on services or goods exchanged. And time banking is egalitarian--everyone's hours are valued equally--an hour of digging a ditch is the same as an hour of legal services, or acupunture or whatever.
The castle project has a lot of similar ideas, but ties it together with a shared purpose and an xp system to reward long term participation in the system with greater than zero-sum rewards.

Time currency, like dollar currency, may be an important component of the castle building model, and it might make sense to just use Time Bank directly, rather than try to replicate it.

thanks jared

Don’t Play Hurt - Push cx:
"One of the most important articles I’ve read on the c2 wiki wasn’t about a programming technique. It was PlayHurt. The core debate of the page is whether software developers can produce good code even when their hearts are not in it. Because development is a creative mental activity, it’s profoundly affected by the developer’s mental state.

...

I felt terrible because I didn’t understand why I didn’t want to go to work in the mornings and why I had to push myself to fix every bug and complete every feature. I didn’t have the perspective or experience to recognize all the things I just listed that had gone wrong, so I felt like a failure because I couldn’t develop on command. I found some of that understanding on the wiki. I couldn’t Play Hurt anymore. I was just plain tired of being hurt. I quit that month.

If you want to write good code, you can’t play hurt. If you want to be proud of your work, you can’t play hurt. If you want to feel you’re making something of your life, you can’t play hurt. The best work is powered by passion and meaning, not obligation. Play hurt if you’re getting through the occasional frustrations that every job has, if you need to pay the bills, if you’re setting up someone you like to do motivated work. But don’t play hurt if you can avoid it. Find something you love. Create something meaningful. Encourage an environment that allows people to work at their full potential. And take risks to do it."


It sometimes takes me a while to get back to full health, so to speak, but it's always the right decision to move on when you're feeling like this.

brilliant

And everything goes on hold again while the future sorts itself out. >_>


At least I'll always have you, videogames.

that was fast

I'll be flying up to San Fransisco on Monday to talk to Zynga.

Also talking to Facebook via phone on Tuesday, that was a pleasant surprise.

Relief mixed with fear, and not a little weariness, but I think it's gonna be good.

So, that's two for the Bay Area, and nothing yet for Los Angeles.  The EA thing may have fallen through.  I hope not, because I'm not sure I want to move.  I hope I get a chance to compare a couple of options, but if not I'll live.  I'm looking forward to working at a high paying job for a little while, and putting some money in the bank.

Perhaps I'll be ready to go back to something more speculative in a couple of years (Castle).

but also

I want to write this down now while it's still fresh in my mind.

I've been following this election closely for almost a year now, and I've been invested in politics since early in the 2004 cycle.  By invested I mean I've given money to candidates.  Howard Dean, John Kerry, Barack Obama, Al Franken, and a few others.  I read the blogs and followed the polls.  I followed the issues and I got as angry as I could over a parade of abuses and outrages.  I have had a sense of national pain and shame.

Now, though there have been some disappointments, my side has won a stunning victory.

I don't even know how I feel about this.  I'm relieved and happy, sure, but those feelings are somehow muted, much more than I expected them to be.  Perhaps that's because the grim reality of the national hole we've dug ourselves into is weighing me down.  In 2004 I thought things were terrible.   They kept going along that trajectory for another 4 years, and I no longer even feel outraged.  We have so much work to do, as a people, to correct our course.  I know that president Obama will disappoint a lot of his supporters, even if he really is the best person for the job, the best president we could realistically get.  There is just so much to be done, and undone.

On the other hand, I think there are so many reasons to be optimistic at this juncture.  The internet and other emerging technologies are going to drive change for the next decade.  Green energy, nanotechnology, and genetic engineering will fold themselves into the global network.  It is an exciting time to be a part of the creative class in this country.

From a personal point of view, I feel better about my own future than I ever have before*.  As I get older my goals shift.  Right now I feel like I'm going to achieve them.  I feel good about my next 20 or 30 years, in the same way that I felt good about this election.  Even though it was hard fought, even though there were disappointments, and even though we have a long hard road ahead (I'm looking at you, prop 8), things are going to get better.

I want to be able to look back and read this blog, when I'm old, and remember what I was thinking.  I want my kids to be able to read what I was thinking, when we elected Barack Obama.  I tend to keep a lot of my politics between myself and my wallet, because I feel uncomfortable sharing it publicly, but this is really important stuff.  It has more of a place in my record of myself than many of the things that I do end up talking about.

Today, Wednesday November 5th, I feel drained and dog tired, but very, very hopeful.


*even though I don't have a job!

what's up

I'm in the process of looking for a new job.  Our little company is not going to make it through, which makes me sad.  I invested a bunch of time and a bunch of sacrificed salary in order to work here, and I'm disappointed.

On the other hand, my salary will almost certainly rise by quite a bit in the next couple of months, assuing I can find a job.  I'm pretty sure I can find a job, since I have about half a dozen prospects right now.

San Fransisco:
-Zynga
-Three Rings
-google

Seattle:
-Microsoft games
-other

LA:
-EA
-google
-Applied Minds/etc?
-other

It's exciting times all around.  At least I don't have to worry about the election any more!