Feed on
Posts
Comments

What My Cats Teaching Me

Note: This is one of failed “let’s start now and finish later” attempts. I decided to publish them even they are not finished. My experience with myself (more than 30 years) if I don’t complete it in a reasonable time, I never will. So here it is, with hope that it will all make sense one day…

Once in a while I decide that I had enough with the cats at home and kick them out. Out to the garden of course, not further. I lock my self in, or them out. When we were in an apartment in Bucharest it was difficult to keep them in. Now in a house with garden, they don’t want to go out. Anyway, I like them out and start cleaning around, and re-organizing. I had all sort of hopeless attempts to organize their living area to minimize the interaction with mine. I don’t really enjoy for example trying not to step on their foot plates, or stare each other in the bathroom. Their sand box and food court are things that I still believe I can control. I lost hope controlling where they leave their hair a while ago.

Leaving them out during re-organization is crucial so they don’t bother me during the process. I take everything somewhere else, clean all around, put them back where I think their disturbance will be minimum. Sandbox is especially important since they like going wild in it.

This time, when I looked back all the work done and pleased with my self, once again thought, it will not take long. Then I realized where I make my mistake (no not that one, they are in already, it’s too late to discuss on it now). A mistake that I tend to repeat during software development (yes, I also felt weird with this connection).

When I nicely isolate their sandbox, even thinking so they will not be disturbed by us in their private moments, I am after my own agenda. I set up everything nicely so they are not on my way. But things don’t stay as you leave. They come and start using it. It would work perfect if it wasn’t the cats around.

Clash of expectations. We all have our own agendas. As a programmer, even when I try to put myself in user’s shoes to design/implement a GUI, I have my programmer agenda. When I don’t pay attention, programmer reaches out and implements a weird hack which makes everything easy. I even feel pleased myself. Until someone else comes and can not frigging understand the beauty in it. His agenda does not necessarily involve all the stuff I have to deal with as a programmer. What do you mean at this stage you don’t have access to selected file he asks for example.

Note: This is one of failed “let’s start now and finish later” attempts. I decided to publish them even they are not finished. My experience with myself (more than 30 years) if I don’t complete it in a reasonable time, I never will. So here it is, with hope that it will all make sense one day…

Note II: “Scalability” here is used as the project size rather than problem size. I noticed that it was not the best choice of words.

I was listening a talk on google tech talks and this came up: This morning I was thinking modularity is key to simplicity at the office. As a developer I love modularity, especially if you are dealing with large scale projects involving tens of developers you appreciate the ability to take a piece of functionality and dig into it knowing it fits all together at some level.

A developer learns to appreciate the modulariy (either for scalability or for simplicity) but hopefully your software has some users, and users do not always makes the connection between lack of modularity and the pain he is facing. Since user has an easy way out (this software suck, let’s uninstall) it is better someone walks him through the logic.

Modularity requires avoiding duplications in functionality. Simpler your modules are, or more specialized in their functionality, the better. However, users like short cuts. Yes I know that command is available there but can’t we put a small button here too he says. Most of the time it is simple to add and developers like that. But then, can’t we have that list box here too he says. It looks like it’s becoming simple at first since number of clicks is getting less and less to perform a certain functionality with each click. But, short cuts start becoming duplicated or worse imitated functionalities since it is not always easy to be that much modular.

I thought about lego blocks this morning. Each block has a one and only one functionality (at least the ones I know). Success of lego comes from the way different blocks work together, not how much additional built-in functionality each block comes with.

Pragmatic Programmer

I am not one. Not yet. I tend to generalize the problems and go for a more complicated solution instead of directly going for a solution. I tend to move the discussion on a more theoretical area. It’s not a bad thing, not always. But if you happen to work with deadlines it might not be the best strategy. This is a critic I receive about my work time to time. Solution is not totally giving up but to know when to generalize and when not to. I am working on it.

For example I wrote earlier that I gave up my pet project when Enso went open source. That was a very logical decision. At the end I wanted the functionality in the first place. Although writing your own gives a different satisfaction I had one of that rare moment and think about “cost/benefit” ratio. After all I would still write my own commands and taste that satisfaction anyway. So I put things on hold and wait for the windows code to come out. Meanwhile I re-installed Enso and start playing with developer prototype. First wall I hit was the way user commands are handled. User commands and Enso communicates through RPC and firs you need to write your own RPC server. It’s not something big but that means your command is actually another application which communicates with Enso rather then embed itself in Enso and share the same process. I don’t know you but since I read few articles on OLPC I changed the way I look at the resource usage (CPU and RAM mainly), having enough CPU power does not justify the unnecessary CPU load for example. Think about, when you are shopping you pay the money based on how much they worth not how much money you have (I will not go into some branding and actual worth discussion here, but it’s the basic idea at least). I already have problems with Enso using some extra memory (an issue addressed before and promised to be solved hopefully). There is a Command Server implementation to ease the developing of user commands, which I tried, but still it is an extra python process which should be started manually in addition to Enso. By the way, Enso open source version promises a different way of command handling so this issue will be absolute soon. I ported one of my own commands to Enso, the one I use to write accent characters (from Turkish and Romanian) without switching to keyboard language or using insert symbol menu. It was pretty straightforward but I ran into few problems. It was mainly how Enso handles the commands (they are all lower case) and how the command server was propagating Enso calls to user commands (dropping command name argument from execute function for example). Nothing too major but like a piece of stone in your shoe… I guess I am trying write down all my excuses to re-start my pet project. So I can keep it short as well.

Yes, then I decided that writing my own was a nice learning environment and if I had to loose time on such issues anyway, I could waste that time for my own code. So I started back. Of course after playing with Enso, first thing I wanted to make was changing the GUI. I used wxPython for the first version but GUI itself was quite small (a frame, application icon, one text editor and one list box in total) and wxPython was the major contributer to the memory usage (over 14MB out of 20). I spent quite a time looking for a light wight alternative. I also checked the Enso’s code to get an idea. And somewhere I woke up… I was wasting quite a time which does not really change the functionality. OK, it would give some memory back but memory was not the main concern at this stage, it was the functionality. Although I still say you need to justify the resource usage, being a single developer, you also need to make up your priorities. So I decided to use a single HTML window to display the user entered text. I will not hide the fact that colors are inspired from Enso, another issue that I decided to postpone. This tiny little decision greatly affected rest of the process in few ways:
- Limited development resource (me) can be used for more important stuff
- Application got a more professional look and it boost the motivation (sort of turbo mode for coding)
- Look on my wife’s face changed so I didn’t feel like I had to give excuses why I am wasting my time on this stupid looking text editor and list box

With this quick gain, I decided to do few more changes and ended up almost redesigning all on the fly. I had few more places where I thought application should support but I never actually needed. For example it supported states for commands. When it is activated all commands are listed, but then when user makes a selection and confirms (using tab to commit the selected command) command can provide a list of arguments if it has any. User can give an argument, use tab and go to next state still in the same command. This way a command can provide several options for each argument level. Handy if you need to provide several arguments for the command. But it created usability problems and managing the states were problematic. Also when I start using the application I noticed that for this application trying to provide multiple arguments was not really a good idea. If your command needs more than one argument, then better to go for a GUI solution (IMHO). So I cleaned up all this generalization form the code. Code size reduced remarkably and it was a lot easier to maintain. Also writing user provided commands become easier.

I decided to keep working on this tool and use it as a glue application for my quest on software development process. There’s plenty of things to do and learn with this tiny application. And now it’s fun to use and develop even better.

I didn’t put a link to my pet project yet because first installation process is still not pain free, second I don’t have a good name for it yet, Enso is already taken :-)

And no before/after screen shot yet since I just noticed when application is activated print screen does not work, I minor issue to fix. Later.

Visiual Studio Automation

Few days ago I had one of my coding week-ends. They are getting rare and rare so I make a big deal out of it. I was back to my pet project, reshaping and adding some make up. I am hoping to write some about it soon. Good thing with having pet projects, you don’t have to play by the rules. You can start with changing a tiny GUI element and end up re-writing all. That’s what happened more or less. Before I started feeling dizzy and shaking I managed to come to the point where everything started working again (sounds familiar?).

Along the journey I came where python meets automation objects. I thought it would be cool if I add few touches to Visual Studio which I use daily for development. Although it is not as popular as Microsoft Word, few attempts in google returns pretty reliable results. You can retrieve an automation object to talk with Visual Studio from your script. The problem is I often run multiple instances of Visual Studio jumping from one another it for anything useful I should be able to create an automation object for a specific Visual Studio instance. Unlikely, Visual Studio is a bit different than Microsoft Word. In Word you actually have a single instance with multiple documents, so accessing a specific application instance is not your concern. Long story short, I spent quite a lot of time trying to figure out how to access a specific application instance, for example the one which has the focus at the moment. I tried both google and google code search (which is one of my favorite while working with python) with all alternative queries that I could think of.

Did you know that google search might become addicted? With each query you come close to the answer than it falls away from you again. Finally when I was going old school (asking real human beings around) one of the queries returned something. Unfortunately I was so happy I forgot to record the lucky query. Below is the piece of code that made its way to my application. It traverses a list of running objects checking their name to find the visual studio instances. If a list of candidate process IDs are given, it tries to eliminate the running instances by the process ID. Display name of the running instance contains the application class together with process ID. Using python windows extensions you can get the window handle for the active window and check for the process ID for the found window handle (this function returns a list of process IDs).

Let’s see if this one will end up in somebody’s lucky query…

pids = win32process.GetWindowThreadProcessId(hwnd)

ctx = pythoncom.CreateBindCtx()
rot = pythoncom.GetRunningObjectTable()
for mk in rot:
   name = mk.GetDisplayName(ctx, None)
   if name.find('VisualStudio.DTE') < 0:
      continue

   pos = name.rfind(':')
   if pos < 0:
      continue

   name = name[pos + 1:]
   val = int(name)
   if val in pids:
      obj = rot.GetObject(mk)
      interface = obj.QueryInterface (pythoncom.IID_IDispatch)
      dte = com.client.Dispatch (interface)
      break

Enso is open

That’s it. When they made it free I hesitated but still didn’t give up my pet project, my very own command line utility. I liked the idea to shape it myself and add the commands that I like to have. But now they went open source as well..

I liked Enso since the first time I met the site and the application. I listened/read Aza in few occasions. I even attempt to buy the application after playing around the demo some time and lost fate on my own development. It was just before they went free.

Enso is one of the few softwares that I really enjoyed playing with. And also one of the few that I really felt jealous. I had two major concerns with it:High resource usage and missing development SDK. They did something on second part but I was not comfortable so far. Now I hope this move will help on both sides. I already checked out the software but only the OS X back-end is available, so I have wait some more. I might use this time to warm-up with Enso, again.

Don't Break The Chain

I am not much in favor of web applications. It might be just I couldn’t get use to the fact that actually most of my time my computer is connected. A left over feeling from my days in Turkey where I was using dial-up modems to connect and count the seconds. But also I find web applications a little bit slow and limited in a way. Limited within a web browser for example.

And yet I decided to create a category for the software I like after a web application: Don’t Break The Chain. I am not even sure if you can call this an application, a simple web site where you can mark your days. You can check the details (nothing much anyway) in their web-site.

I found the website during my daily morning read session. You know when you try to convince yourself that there’s a long day ahead and you should start doing something, but then postpone the real action to enjoy rest of the coffee. Life hacker had a post about tools to help with your new years resolutions. Having few myself I decided to have a look at it. This one and Joe’s Goals were interesting and decided to give it a try. I guess I will stick with this one since:

- I am familiar with idea from the days I was trying to quit smoking. You count the days you last smoke. Bigger the number you are less likely to smoke and start from 0 again.
- I like the feeling when I looked at the web site: let’s see how this things work… that’s all?
- There is a nice iGoogle gadget so I can face my marks frequently.
- Such tools should not stand between user and the task (valid for all software but especially for productivity tools), you should not waste your time playing with the application. There is nothing to play in this one…

… and yes, I don’t smoke anymore…

Time Tracking

I mainly worked on project based companies. There are few things I like with such companies:

* Projects last from few months to a year, a year and a half at most. They might be similar but not identical. You get to learn/experience a wide variety of things.
* Changing projects are like pressing reset button on your computer, you get fresh starts.

Beside changing the scene, resetting time to time has many benefits. You get rid of the accumulated errors from the development phase. You might know that feeling, you go home after few long nights in a row (nights connected to the mornings) have a nice shower, come back to the office next day and everything is as new as the first day.

One of the things I am struggling is about scheduling. When you need to manage a schedule for few months, it is easier. It is like you don’t need to see the girl again.

But you know, all good things have an end. Now, I work in a product based company. Although we have release schedules and it gives us a sensation of starting new it is not the same thing. Scheduling is not that girl you had your fun anymore, she remembers all the mistakes you do.

Scheduling and time tracking are closely related concepts. Once you have a schedule you will want to know where the hell you spend all your time and missed the deadline.

I started checking for time tracking utilities when I was working as a freelancer. It was mainly for billing purposes and I didn’t really care more than how many hours I worked on a certain task. After all freelancing is still project based. Current challenges require a lot more then that. So I came back to google.

There are plenty of tools available and I tried some of them. Most lack at the initial point. When you work on a certain issue you don’t really want to go through many UI elements. All you need is to start something, or pause your time and continue working.

I put these three dots nearly a week after I wrote the last sentence. My quest to a time tracking tool is just like this. I know I am very close to it, but it is like behind something which I can’t jump over. I have a feeling about it, but that’s it. I guess this makes it an interesting topic. I will come back to it again…

Boxes

I have something new for my therapy after a long days work: Some cutting, folding and pasting. A personal touch for presents. I made a couple of these:

Last night, thinking that I don’t have enough time my new design I decided to make something simple. I needed a protected cover for my small booklet. Being an easy project I thought I would take it easy and avoid all those mistakes I made in previous ones.

Although it seems simple enough I went through the draft design process first. I draw the expected results on a draft paper, then cutting schema and write down the measurements. Then from draft paper I moved to the actual paper draw carefully. Now, from draft to final drawing I changed the design in two points which required almost total re-drawing. I felt lucky to have the change ideas before I get to the scissors part. Ah also, I made two mistakes in measurements but fortunately I find it out before I start the final drawing. See, I managed to avoid buying a proper ruler, I have two, the ones used in construction, let’s say little house improvements. Certainly not good for fine paper.

Anyway, all these slowed down the process but I managed to come to the cutting part without loosing any paper. Folding part was also pretty straight forward, the part that I didn’t mess up much in previous ones either. When I finished the box I noticed that folding order would have been better. There is a small piece inside the box which creates a little problem when I want to put the booklet in. But it is not something I can not live with, just a reminder that it would have been better.

Google Video

Having Fun

I thought this topic deserves its own category, so here we are: is there a life before…

If somebody asks so what do you want, my automated answer would be to have fun. Don’t get me wrong, you don’t have fun if you don’t have money. At least up to some amount. So let’s skip that part of discussion and focus on fun part.

To me there are two ways for having fun: You have fun while you are making something and/or you have fun with what you are doing/ what you have done. If you put those two in two ends of a line, I think by time, I am moving from one end to other. While it was fun just doing something and not really caring what will come out at the end (like my university degree) now I feel pity seeing what would come out (like my university degree). I am not at the other end yet but I hope one day.

Think a sunny day at beach. You are playing with sand and making a castle. Think that you are with friends and every now and then one starts a sand war which will end up total destruction of what you have done so far (which is not much anyway). You are going back home leaving a pile of sand behind looks like anything but castle.

Now think another beach, quieter then first one. Still a nice day with sun and sea and lots of sand just for you. You work on your big project and when you leave, you leave one of those masterpieces behind .

Now, considering that you found both of them nice, here is what is wrong with being an employee: You don’t get to choose what you are making, which beach you will be, or what you will use. But this is still OK. It is just some bigger challenge. And I believe that there are ways to affect what/where/how… Problem is you don’t get that quite nice beach. You will be on one of that public ones. People will come, watch, comment even join in some sense. But they will not be the ones from the first beach, I am sorry. At least most of the time. Not all of us are that lucky. Being an employee you can stay close to neither ends of that line. And on top of it situation is a little bit more complicated for you: You are with some people which you didn’t choose, and you are making something again you didn’t really choose. So, that’s what I call challenge my friend.

Finding your self in such mid point, you need to work your way out in both side. Finding the good in what you are doing is one challenge (which I can humbly advise try to do it good to find good in it). finding a gang is another (I will not comment on this).

I remember using the term “art” for software development, not very often but you know the times I get over excited about what I am doing. When I think about it tonight, art is on a very special point on that line. You choose to stay in that beach alone, enjoying what you are doing, while you are doing without thinking what will come out at the end and yet you come up with something good. I am far away from that point.

Older Posts »