thoughts comments

I found a very interesting question on Programmers (a Stack Exchange Q&A site):

Is programming your passion or is creating your passion?

This made me think. Here’s my answer:

For me, creating and programming/coding exchange the roles of passion and medium. Let me elaborate that a bit. I have 2 things that get me going - an idea for a project or a puzzle. Puzzles are pure coding challenges for me and while I usually feel intrigued by them, most of the time I get a guilty feeling of procrastination. I’m talking here about coding puzzle like Pex4Fun where the only thing you get from solving a puzzle is self-confirmation. If I start with an idea coding is my medium to release the creative energy that has built up inside of me while playing around with the idea in my head. I’m not one of those programmers who just write code to create and say they’re done when the application has all the functionality they envisioned. No, I also want to make my code pretty, clean with lots of cleverness in it. I hate spaghetti code and I love refactoring. I also love code architecture and patterns. This is where creativity becomes a medium to my coding passion. This is also where puzzles come in. As I said, I love solving puzzles and this time I don’t feel like I’m procrastinating. When I feel happy about the code I start implementing new parts of the idea and here the roles changes again. I get the feeling of completion when I feel happy both about the product and the code behind it.

thoughts comments

Timeboxing

On the 13th of December I’ll have my penultimate exam. It’s nothing I’ll be looking forward to, but it’s necessary evil. The only thing that matters is that I get it done and over with. I want to start living my life and finally start working on my ideas and projects that have been growing in my head for a while now. That and the fact that after 17 years or school I’ll actually get a real and more importantly an official profession are the only two things that keep me going. I know there’s a diploma I’ll have to write after I finish the exams to be able to graduate, but I’ll be treating that as one of my projects, so it should be fun.

As you can see I have my goal set and the reward for completing it is very compelling. This keeps me somewhat motivated. The problem isn’t the reward though. It’s that it is far away. 2 weeks can be a long time. If you’ve read my post Time is a Perspective you should understand that 2 weeks with so much things to learn can seem like at least a few months. This is way the ultimate reward of being school free has a very limited motivational value.

To make studying an easier job I needed to find a way of getting more motivation. I found it while reading a great article my friend suggested - Steve Pavlina’s Overcoming Procrastination. In section 6. Poor Time Management Habits he suggest an idea he calls timeboxing. You can read more about it in his article, but the main idea is to take a fixed amount of time and make yourself do something for the duration of it. After you’re done, you reward yourself. For example I made myself write for 30 minutes and then I rewarded myself by watching an episode of House. I’ve tested it with studying and it works quite well. I did come up with a few variations though. They depend on the type of the task you want to do and how much time can you allocate for rewards.

Closed and open ended time frames

There are two types of time frames - closed and open ended. When using the closed ended version you stop doing the task when the time runs out. This is useful when you want to limit your output. I use it when writing the first draft of an article. This helps me focus on the most important parts of content I want to include. For these types of tasks you should use an alarm clock. When it goes off stop what you’re doing and claim your reward.

For tasks that you need a push to get going an open time frame is more appropriate. You can use a clock or a stopwatch to know when the time is over. An alarm clock is not suitable for this as you don’t want to get distracted when/if you get the momentum going. The time frame is there for you to know that even if you fail to accomplish anything in it you can enjoy your reward guilt free. This is really suitable for studying. For example I give myself a 45 minute block of time. After a few blocks like this I can study for 60 to 90 minutes before I feel a craving for a break. I then enjoy whatever reward I promised myself.

Limited and unlimited reward lengths

You will notice that I didn’t mention what kinds of rewards you can choose. That’s because it doesn’t matter. Anything from taking the rest of the day off, eating something or a TV show will do. The only condition is that you find you reward enjoyable. That will a motivation boost inside of you and you’ll feel less reluctant to take up the task at hand.

An additional condition can arise when you don’t have a lot of time to get something done. Unlimited length rewards are just not an option in this case. When you have a due date of some kind limited length rewards are the way to go. These types of rewards are essentially closed-ended timeboxed rewards. The best kinds of rewards here are the ones that take up only a limited amount of time by their very nature. Watching an episode of House takes about 45 minutes where as something like browsing the Internet can easily take up a few hours without you even noticing.

Progressive Timeboxing

I also like to employ a technique I call progressive timeboxing. What I do is I gradually increase the duration of time blocks. This is comes in handy when trying to find the optimal amount of time for timeboxing. I usually start with 30 or 45 minutes add see where it takes me. I usually get up to 60 or even 90 minutes. I depends on the type of task I’m trying to do. Pick a short enough block so you don’t have to shorten it later on, but also don’t make it too short as it won’t bring you much closer to accomplishing your task.

Timeboxing can be a very effective motivational tool when used correctly. By completing a session you also get a sense of achievement which boosts your motivation even further. I suggest you try it out and see if it suits you. I would of course like to hear what success you’ve reached while employing this technique. And if you came up with your own derivation of it don’t feel hesitant to share :smiley:

aspnet-mvc, openid comments

Last week was quite a productive one for me. Pulling in about 4 to 5 productive hours a day as you can see from the graph below. I’m happy about that.

Productivity Week 3 November 2010

So what was I up to, you might ask. Well I’ll tell you. I decided to publish my first open source project. It’s an OpenID Starter Kit for ASP.NET MVC. Essentially it is an ASP.NET MVC empty project with the added functionality that handles users logging-in with their OpenIDs. I’m still at a very early stage, but the core is there. I plan to break the project into 3 parts - Basic, PopUp and AJAX. The difference is essentially in user’s experience when logging-in. Basic and PopUp have a separate page for login. After entering you OpenID the Basic method will redirect you to your OpenID provider’s page while PopUp will open a smaller PopUp window. AJAX approach will have a box popup wherever on the page you are. I’m still unsure how the user gets to OpenID provider’s page with this approach, but I’ll get to that when I get there. Each of these 3 parts will be implemented using Razor and ASPX view engines.

As I’m not a reinventing-the-wheel kind of a developer my project is using a library called DotNetOpenAuth by Andrew Arnott. It is a very extensive library for OpenID, OAuth and InfoCard for .NET and I’d be a fool not to use it. The project also uses Entity Framework 4. I’ve also added a guide how to convert the project to get the new features of Entity Framework CTP4 like code-first. But I couldn’t ship that as the CTP license does not permit it. As far as I came to understand from that lawyer talk.

And speaking of licenses, was that a pain to choose. I spent 3 or 4 days just reading articles, forums and of course licenses themselves. I really liked what Jeff Atwood wrote on the subject in his article Pick a License, Any License. Choosing a license is a very crucial step when publishing an open source project. Without it people can’t do much more then look at your code or they’ll violate your copyrights. This is where your chosen license steps in and let’s them know how they can use your code, where are the limitations when publishing their code that uses yours and if/how they need attribute you or the project. When choosing a license I found that the answers to these three questions will leave you standing with just a few choices. That’s a good thing.

After reading around I was left with Microsoft Public License (Ms-PL), Apache License, version 2.0 and a MIT-style license. I looked what similar projects use. By similar I mean written for the Microsoft’s .Net framework and preferably an ASP.NET MVC related project. It seemed that most of them used Ms-PL so I chose that one, but switched to Apache License v2.0 soon afterward just because it seems to be more widely used so more people will know what’s it about and how to use the source that’s licensed that way.

That was pretty much it for last week. If you’d like to check out the project itself there’s a few ways to do that:

  • MvcOpenID on CodePlex - this is the primary hub for the project. Any discussions and issue tracking will take place here. You can download the code or use Mercurial (Hg).
  • MvcOpenID on GitHub - this is another repository I push the code to. It’s mostly there for git users and also because the GitHub site has a lot of awesome features.
  • MvcOpenID on Ohloh - I’ve also submited MvcOpenID to Ohloh. It’s a free public directory of open source software and people.

Check the project out and I hope you like it. Any feedback I can get is of course very welcome.

git, mercurial comments

So yet another post that is meant mainly for myself, but maybe someone else will find in it as well.

The ignore pattern I use for Visual Studio projects is the same for both Mercurial and Git:

build/
*.suo
*.user
_ReSharper*
*.csproj.user
*.resharper.user
*.suo
*.cache
*.trx
Thumbs.db
[Bb]in
[Dd]ebug
[Oo]bj
[Rr]elease
[Tt]est[Rr]esult*
_UpgradeReport_Files
*[Pp]ublish.xml
*.project
*.metadata
logs
*.generated.cs
T4MVC.cs

The only difference is how to set global ignore rules for each of them. I found these two great tutorials for this:

UPDATE (16/11/2010): After using Hg for a while with my ASP.NET MVC projects I’ve added a few things to the ignore list.

Copyright © 2024 - Goran Gligorin

Blog content licensed under the Creative Commons CC BY 4.0

Unless otherwise stated or granted, code samples licensed under the MIT license