Managing Up

In which I talk about my experiences and views of "managing up."

I once had a job with Gateway Learning, Inc., the company responsible for Hooked On Phonics. They hired me to run their Web development and systems integration back during the beautiful dot-com bubble. This place, located down in the waterfront area of San Francisco, had the look of a seminal start-up. Their pride and joy, a 120-inch square of paper with the database ERD printed on it, hung in a place of honor so that every employee, visitor, and investor could see it upon entering the developer zone. Their “data dictionary” filled two three-inch binders.

I reported to a guy named Fred. He had the position of Vice President of Being French and Developing Software. We worked together for a month. One day he pulled me aside and said to me, “Curtis, I find it hard to trust you because you speak with such short sentences.”

I quit the next day.

Managing Down

In which I talk about my experiences and views of "managing down."

I have spent a lot of time thinking about leadership and what it means. I have heard people talk about personal and professional leadership, as if the two subjects require different talents or traits. I believe that they do not.

I believe that the following traits can make you an effective team leader regardless of the size of your team. They will not guarantee success; however, they represent important goals and standards toward which all leaders should strive. In their application, you can increase your effectiveness as a leader.

If you do not have a leadership position, right now, but feel like you would want to have one, these traits will garner attention from those that have the power to give you a team to get more done.

BORAX By Example - Part II

In which I clean up the server-side with BORAX In Server (BORIS)

As you may recall from the last BORAX post, I had set up the application to transition to the start state which, for the purposes of our application, means someone needs to login. The application loads its first state as indicated by a linked relation in the header of the launchpad. Now, I sure think we would find it cool if we could handle the authentication.

Interlude - DTOs Ain't No O

In which I express my dismay with nomenclature.

Yesterday, ayende posted some blog about some code with which he didn’t agree. I read it with apathetic eyes. I really go there to read the comments that people leave on his blog. Opinionated people draw opinionated readers. The post, about CQRS in some example app written once-upon-a-time, had people chattering like squirrels since CQRS has become a buzz-worthy thing. (I call it the Fowler Effect.)

About 20 comments in, someone wrote something about DTOs. It goes like this.

This kind of separation [CQRS] sounds good for me, because you can design queries based on UI, with specific DTOs, while I can design commands to affect my domain model, via write side of it, based on user tasks.

I don’t think this guy wrote anything offensive; it has a certain value of insight. I realized while reading it, though, that I can no longer abide the term “DTO”.

For those of you not in the know, a Data Transfer Object provides a typed representation for passing information between two layers of your application. Those layers can physically run in the same process or across the world. A DTO supplies a message contract. Also, we can’t bother most developers to figure out efficient serialization and deserialization algorithms for their objects. They’d rather use the ones provided by whatever their specific runtime or platform has in their communication packages.

I really dislike the “O” in “DTO.” I refer you to my first and second posts where I wheedle on about object-oriented design and falafel. The sum total of those posts: Classes define behavior. Objects perform it.

In object-oriented programming, we have a mantra, “Tell. Don’t ask.” We have that mantra because our objects, defined by classes, have behavior!

A Domain Transfer Object has no behavior. Thus, they do have the defining characteristic of an object.

From now on, I will call them “DT-NO”s: Data Transfer Non-Objects. Also, I think “ditno” sounds kind of funny.

BORAX By Example - Part I

In which I start a simple RIA atop BORAX.

BORAX

Bidirectional Operative RESTful Asynchronous Xeri-programming (BORAX)

In which I try to explain the meaning and practice of BORAX.

My sympathies go out to Dr. Roy T. Fielding. He conceptualized an architecture for network-enabled applications. Then, he formalized that in his doctoral dissertation. Then, some marketers got a hold of his term, REST, and started applying it willy-nilly as marketers do. This led to a dilution of the meaning of REST. When Dr. Fielding attempted to clarify why some services complied with REST and others didn’t, detractors accused him of grasping at purist ideals that no one could realize in “real-world situations.” He vented his spleen in a post entitled “Specialization”.

Before last week, I, too, had an improper understanding of REST. I read Architectural Styles and the Design of Network-based Software Architectures more than once. I thought about it a lot. Then, I started programming Rails, didn’t think beyond its definitions, and failed to continue my analysis. If I had continued, then I wouldn’t have been throwing around the term “REST” so loosely.

I want to change that because, after the little experiment I wrote on my fork of philipmat’s webmvc, I think I now understand the power of REST in all its glory. Moreover, I understand the limitation of browsers to bridge the gap between Rich Internet Applications and the REST-shaped services they consume.

I found that the effort to bridge that gap took just a little of my own JavaScript (EcmaScript, whatever) which, in turn, used the following fairly standard libraries:

  • jQuery
  • JSON2
  • knockout.js
  • underscore.js
  • uri-template (browserified)

I’ll spend the remainder of this post explaining BORAX in a little more detail and, then, the components of a BORAX-compliant Web application. Tomorrow, we can spend some time reviewing code to figure this out.

HATEOAS: A Follow-Up Discussion About Rest

In which I take my friend's advice to engage in more pedagogy about REST, and the New Web programming style BORAX.

A friend, @optimizedchaos, over on Twitter, recommended that I write an entry here to address HATEOAS.

What I Did Today

In which I use my blog as a Web log.

Just the list of stuff I did, today.

Fielding's REST for R33LZ

In which I consider Roy Fielding's definition of REpresentational State Transfer.

Note: this discussion primarily centers on the HTTP; REST over other protocols exceeds the scope of this article.

[Updated with link to philipmat‘s blog.]

My friend philipmat over at his blog has published a novel approach to building Web applications that use the server as a REST service and use the browser as the controler and view in the MVC triumverate.

That idea, in and of itself, does not represent a “new idea.” The fine developers at Sencha and Yahoo! have already developed in-browser MVC frameworks that usually use some proxy as the Model to fetch/write data stored on a server.

philipmat takes this at least one step further. And, in that step, I find a favorable pace toward Roy Fielding’s notion of REST. First, I’ll go on about REST for a little while to cure any confusion about what REST means. Then, I’ll examine the step-toward-REST that philipmat‘s proposal makes to us.

60-Hour Work Weeks

In which I speak an empty word.

The agile dream: 40-hour work weeks. If you work more than 40 hours, don’t do it two weeks in a row.

I have not complied with that directive over the past three months.

Instead, my minimum work week has consisted of 60 hours.

My mind does not want to create. It merely wants to rest.

Alas, this post is nothing. Mere filler.

It is my empty word.

empty word, noun (especially in Chinese grammar) a word or morpheme that has no lexical meaning and that functions as a grammatical link or marker, rather than as a contentive.

How To Run Python.NET on Mac OS X Lion with Mono

In which I set up Python.NET with Python 2.7 and Monodevelop on Lion

Install subversion : I used homebrew.

Install Python for .NET Source : Pick a nice directory for installation. I put it in ~/dev/pythonnet. I ran these commands.

1
2
3
mkdir -p ~/dev/
cd ~/dev
svn co https://pythonnet.svn.sourceforge.net/svnroot/pythonnet/trunk pythonnet

Install Monodevelop : I installed version 2.8.5 because they don’t have a release for 2.8.5.1, yet.

Open Python.NET Solution : Start Monodevelop, answer its stupid questions, and open the solution. I found mine at ~/dev/pythonnet/pythonnet/pythonnet.sln.

Configure Build for Python 2.7 : Double-click the “Python.Runtime” project to open its optiosn. In the dialog that appears, select “Build > Compiler” from the navigation pane on the left. For each configuration in the Configuration dropdown, change the PYTHON26 in the “Define Symbols” input to PYTHON27.

options

Link the Python Shared Library to the Test Output Directory : Create a softlink from libpython.2.7.dylib to libpython27.dylib in the output directory of the “EmbeddingTest” project.

1
2
3
mkdir -p ~/dev/pythonnet/pythonnet/src/embed_tests/bin/Release/
cd ~/dev/pythonnet/pythonnet/src/embed_tests/bin/Release/ libpython27.dylib
ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib

Patch the Import Unit Test : In the “EmbeddingTest” project, open the PyImportTest fixture. In the SetUp method, you will see on line 28 a line that looks like a path to a “tests” directory. You need to change that because Python on Mac OS X does not know about those backslashes. So, change it to the following. (I’ve already submitted a patch to the project, so you may not have to complete this step if they choose to apply it to the source.)

1
2
char c = System.IO.Path.DirectorySeparatorChar;
string s = string.Format(@"..{0}..{0}..{0}tests", c);

Build Solution : You know, CTRL+COMMAND+B.

Run the Unit Tests One Fixture At A Time : This kind of blows. However, the Unix pipe used to communicate with the tests doesn’t do well with the embedded cPython runtime. They should all pass.

Now, you can use Python.NET in your Mono development. Just remember to link in that shared library or put it in your MONO_PATH environment variable.

Emergency plates Update (2012-01-13) for To-Do List Application

In which we revisit the <b>plates</b> functionality.

The flatiron library is no more. So, other than reading stuff, there just isn't all that much relevant stuff, here.

Back in Story 4, we used plates to generate the HTML that we used. It seems that since I wrote the entry, hij1nx had the audacity to make plates much better. Kudos!

Making a To-Do List With flatiron.js (Story 5)

Story 5: Each item in the task list will have a &quot;Delete&quot; link next to it so the user can remove the to-do item from the list.

The flatiron library is no more. So, other than reading stuff, there just isn't all that much relevant stuff, here.

This post continues the creation of a to-do list with flatiron.js.

Previous Stories in this Series

Making a To-Do List With flatiron.js (Story 4)

Story 4: When a user issues a GET to / after session creation, the HTML page continues to show the input and button while showing the task list beneath it.

The flatiron library is no more. So, other than reading stuff, there just isn't all that much relevant stuff, here.

This post continues the creation of a to-do list with flatiron.js.

Previous Stories in this Series

Making a To-Do List With flatiron.js (Story 3)

Story 3: When a user POSTs a form to /, it creates a new ToDo item, adds it to the session, and redirects to /.

The flatiron library is no more. So, other than reading stuff, there just isn't all that much relevant stuff, here.

This post continues the creation of a to-do list with flatiron.js.

Previous Stories in this Series

Making a To-Do List With flatiron.js (Story 2)

Story 2: When a user first issues a GET to /, it serves an HTML page that shows an entry text box for a to-do list item and a button to POST the item to /.

The flatiron library is no more. So, other than reading stuff, there just isn't all that much relevant stuff, here.

This post continues the creation of a to-do list with flatiron.js.

Previous Stories in this Series

Making a To-Do List With flatiron.js (Story 1)

Story 1: When a user first issues a GET to /, then it creates a new session.

The flatiron library is no more. So, other than reading stuff, there just isn't all that much relevant stuff, here.

This post continues the creation of a to-do list with flatiron.js.

Previous Stories in this Series

Making a To-Do List With flatiron.js (Old School)

In which I walk through making a primitive to-do list Web app with flatiron.js.

The flatiron library is no more. So, other than reading stuff, there just isn't all that much relevant stuff, here.

The makers of flatiron.js bill it as “an unobtrusive framework initiative for node.js.” It consists of five major components that the creators want to behave “isomorphically,” that is, similarly in the browser and on the server.

sqlcop is Way To Big

In which I cry, "Uncle!"

Well, I’ve spent three weeks on sqlcop and haven’t even made it out of the JOIN statement. I knew writing a parser for T-SQL could take a while; however, I did not realize that T-SQL has so many forms!

Running nunit-console Under mono on OSX

In which I share how to run nunit-console under mono.

I continue to program in C# even though I don’t consider it my favorite language. The experience of starting a VM on my Macbook Pro to use Visual Studio 2010 on Microsoft Windows 7 quickly paled. I downloaded and installed Monodevelop 2.8.5 so that I could compile C# without a VM.

Runtime Class Mixins with Python

In which I show you how to do runtime mixins for classes in Python.

Say you want to mix in a method into an existing class but can’t get to the class’ definition. In Python, you can use the following decorator to do that.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# mixin.py

import inspect

def mixin_to(cls):
def f(fn):
if inspect.isfunction(fn):
setattr(cls, fn.func_name, fn)
elif inspect.isclass(fn):
for name in dir(fn):
attr = getattr(fn, name)
if inspect.ismethod(attr):
setattr(cls, name, attr.im_func)
return fn
return f

This method handles mixing in a single method as well as another class’ methods. You can even mix methods into a class after instantiating it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class Unadorned(object):
pass

# Instantiate an Unadorned
u = Unadorned()

# Mixin in methods from a class
@mixin_to(Unadorned)
class MixinClass(object):
def mixin_method(self):
return "mixin_method calls " + self.mixin_function()

# Mixin a function
@mixin_to(Unadorned)
def mixin_function(o):
return "mixin_function!"

# Use the method mixed into the class
print u.mixin_method() # PRINTS "mixin_method calls mixin_function!"

Wow! That’s nice. You can download mixin.py for your use.

The Visitor Pattern in Python

In which I implement the visitor pattern in Python with decorators.

I’m a fan of the visitor pattern for its emulation of dynamic dispatch and its ability to extend functionality of a tree of objects.

Happy New Year

In which 91 ways to become the coolest developer confuses me.

Today, a friend sent this link to me 91 Ways to Become the Coolest Developer in the World. He wrote, “You should read this because you’re the coolest developer I know.”

That’s a nice compliment, so I started reading it with a smile on my face. The further I read, the less I smiled until, as I approached the end of the long, long list of lists, I no longer smiled.

The best programmers that I know do not really like computer programming. They like solving computational problems in a deterministic framework. They like to figure out the smoothest integration of human-computer interaction. They covet the experience of watching other people using their software in a productive or entertaining way.

Programmers that love to program for the sake of programming, they tend to write crap. And burn out fast.