Browse: Home / how much does a line of code cost?
By Dani Berg on August 17, 2009
This past week I stumbled upon a nice tool: sloccount. Sloccount was written by David Wheeler and is a set of tools to count lines of code. Wheeler also has some really interesting papers regarding the linux kernel size and its development cost.
After installing sloccount* I immediately started to harvest data on all projects I currently have on my hard drive. I was really impressed by the first results. The costs are too high, I thought. A small project with 2,000 lines of PHP code like the Autoresponder has a development cost estimated at more than US$55k.
After reading sloccount’s user manual and pondering about the Awake Autoresponder I started to change my mind. 2k lines of PHP code encompass a lot more work than the number suggests. A few reasons for this:
- The code was updated every time a customer submitted a bug. As you know, fixing a bug does not necessarily imply more lines of code
- Out of the box sloccount doesn’t compute HTML, CSS or Javascript
- Technical support
- Documentation
It took me a few thousand commits, I don’t know how many emails and several hours of night debugging the script on customer’s servers to reach 2k working lines of code. It may sound like cheap advertisement or self promotion but I must say that US$49.90 for the script is a bargain!
* if you are running Ubuntu it’s easy as
sudo apt-get install sloccount
Posted in autoresponder, Programming |
By Dani Berg on August 13, 2009
I’m living a transitional period. One might say that life is always on transitional mode. An eternal deja-vu. Cheap philosophy apart, I’m slowly starting to seek for a new job here in the US. I’m still working for my former employer but since currency exchange rates are not on my side (as of today I need R$1.83 to buy US$1.00) I need an extra income. A part time job maybe? I don’t know yet.
Anyway, chances are I’ll be devoting fewer hours developing for my current employer so I decided to improve our documentation base.
Documentation includes how to properly setup a working environment, main concepts of the system, shell scripts that do black magic, coding guidelines, etc. I’m also writing down a lot of ideas to improve the current system we have and formating TODO lists that only make sense in my head into prose.
The problem is that part of the system was first developed and discussed only in non-formal meetings. Yes, productive and get to the point meetings. We didn’t have the chance to properly document everything as dictate theory and common sense.
So, right now I’m writing. A lot.
One of my main goals is to make the life of future developers joining the team easier. What are the first steps? What is all that code supposed to do? What needs to be done? How it can be done?
It forced me to stop and look back. Stop being a GTD code maniac and look back at everything that was done in 3 years.
It’s unbelievable not only the amount of things we’ve got done (lines of code in my case…) but also how much we improved. It was crazy, it is still crazy, but we fixed bugs, released updates and new features almost every day. Ohhh… s t a r t u p s.
Posted in Programming |
By Dani Berg on August 10, 2009
As crazy as it may sound to most people, I like Mondays. The main reason for this is that my mind is refreshed after the weekend and I’m excited to get back to my regular job source code and get things done. Monday is also a good day for novelty.
Well, this morning I did put into practice something that is most certainly not new for you: the post-commit SVN hook. As an experienced developer you can stop reading the post right now.
The post-commit is now active and all developers (the development team is small) receive an email after a commit is done. The email contains the revision number, author, log message and the diff generated by the commit.
I learned about this procedure reading the book Producing Open Source Software.
The goal is to help everyone involved in the code to have a better idea of what is being done. Who is working where and most importantly, if someone is touching part of the code that is of special interest to you.
After a few commits and just skimming through the code you’ll see the benefits.
You start to police yourself to make small and well documented commits. Good.
It’s also easier to comment about code that was introduced/updated by your peers. The diff is right there in your email box and the changes are still fresh in the author’s head. Just hit reply!
Posted in Programming |
By Dani Berg on July 28, 2009
I’m writing this time to announce a minor release of the Awake Autoresponder. Version 1.4.0 is now available. Update is free for all 1.3.x customers. This release contains some small bug fixes + one new feature. It is now possible to be emailed when a new Lead subscribes to the Autoresponder.
As noted in a previous post, version 2.0 is now in the main branch of development. The first phase is almost complete and the script is now using CakePHP as a framework. New features will be added in phase 2
Posted in autoresponder |
By Dani Berg on June 16, 2009
In theory it would be good to test web applications on several different browsers but I must admit that I’m mainly concerned about Firefox and Internet Explorer. Well, now that I have a “Windows Day” during the week I included Google Chrome in my tests. It is such a nice browser and since it uses Webkit I can fool myself and pretend that everything running on Chrome is perfectly fine for Safari users.
Couldn’t wait any longer to have Chrome on Ubuntu so on Sunday night I checked out the Chromium source code files, installed depot tools and all software dependencies, typed hammer and voila! Binaries up and running after a few hours. Gosh, I need better hardware.
I did not expect for it to run at all but I was able to navigate through most of the websites I needed. I was quite amazed by the results. It is more than a plausible promise after all.
Posted in General |
By Dani Berg on June 11, 2009
I’m an Ubuntu fan. These guys at Canonical know how to get things done. They release 2 Ubuntu versions per year full of improvements. It should be a case of study on how fast Ubuntu gets better.
This week I decided to add a second monitor to my notebook. I first thought I was going to have a hard time. Check manuals, forums and alike. Especially because the 2nd monitor and my notebook have different resolutions.
Surprise. It was too easy. Plug and play.
Well, almost. I could not set the 2nd monitor to a higher resolution. I had to open /etc/X11/xorg.conf, increase the Virtual resolution and restart gnome.
Anyway, having fun with 2 monitors again. Wohooo!!
Posted in General | Tagged ubuntu |
By Dani Berg on June 6, 2009
I’ve been involved in a C#/ASP.NET project for a few weeks now. It is my “Windows Day” during the week. It is exciting to be in a completely different environment and trying different things. I feel refreshed when I’m back to Ubuntu and getting things done for my employer in Brazil.
The learning curve is demanding though. It is not just a matter of learning a new language like C# and the .NET platform. There are also tools like IIS, SQL Server and Visual Studio. Took me a while to print “Hello World” in the browser.
I did add 2 books to my Safari account at O’Reilly. Learning C# 3.0 by Jesse Liberty and Brian MacDonald and Programming ASP.NET 3.5 by Jesse Liberty, Dan Maharry and Dan Hurwitz.
The ASP.NET book was a good choice for me. It’s hands on and the examples are really easy to follow. Nice start.
Learning C# is a great book only if you are learning your first language. I skimmed through most of the chapters to get the information I was interested in. I’ll try Programming C# next week.
Posted in books | Tagged books |
By Dani Berg on June 1, 2009
I can only hear the sound of tapping while I type on my stupid keyboard. No scales, chords or notes. Even so, I treat the keyboard as a musical instrument.
To improve typing or playing one should avoid unnecessary motion. If your hands stand still while only your fingers move you save energy, time and visual distractions.
Emacs key bindings are a great deal to move around text or code. You don’t need the arrow keys. You don’t even need page down, page up, home, end, delete or backspace keys.
There is a learning curve though. You should memorize key combinations, I mean, chords. It is a small price to pay for what you get in return. After you master it you will feel pain to type in a word processor without key bindings.
The good news is that Emacs key bindings are available not only inside Emacs but also in your favorite applications. I use the same key bindings at the terminal, Firefox and even in Gnome. That is a lot of fun.
Posted in General | Tagged emacs |
By Dani Berg on May 20, 2009
Although I’m no prude I generally don’t write offensive words. I have to make an exception though: Brazilian keyboards are stupid! Die!
I’m a programmer (at least I try to be one) and typing a lot everyday gives me the right to say that.
My previous laptop died in the middle of the night. I needed another computer the next day while I was still living in Brazil. I could only find laptops with Brazilian keyboards for prompt delivery.

The first annoyance is the right Alt key replaced by Alt Gr. It makes me feel handicapped.
If I need the ? or / character I need to combine the keys Alt Gr + q or Alt Gr + w. Great. Great idea.
Typing in Emacs is like playing guitar. You have chords. Now I can’t type M-f and avoid physical therapy. Normally I would press my right thumb in the right Alt key (where did it go??) and my left index finger in the f key. If you play any instruments you know what I’m talking about.
Another problem. The Ç character. C cedilhado in Portuguese. The name implies it. It is the same C character genius!! You don’t need a unique key for it the same way you don’t need a separated key for Á, á, É, é, Ô, ô, etc. Just add a dead key for the cedilha.
With the addition of this unnecessary key they moved the location of crucial chars like ‘ and “.
Really? Bear with me. WHAT WERE THEY THINKING?
I could go on and on but I should stop. That is enough for my karma today.
Posted in General |
By Dani Berg on May 7, 2009
I’ve been using WordPress for 2 months now. I was reluctant at first to adopt it. My main concern was having a whole system in the way in case I ever needed to code an unusual feature for my website. Then I listed several reasons why I was definitely wrong about not using WordPress in my personal website:
1) Turns out I don’t have time to deal with code in my own website. The shoemaker’s son always goes barefoot.
2) How many times I have to remind you: don’t reinvent the wheel. At the moment you just need a tool to blog. Go for a ready made solution.
3) “Unusual feature“? Really? Please, list one that is crucial! A feature that you need to implement right now! The answer was… duhh…. none!?
4) WordPress is under GPL. If you ever need a fancy feature you can actually code it! … although I doubt I will ever need to do so.
These should be enough reasons to have WordPress installed. There is one more important reason, though: Plugins.
People should be able to extend the functionality of the software. If you add well documented procedures on how to write plugins and build an environment for people to share them, then you dramatically increase your chances for a hit. A killer app. Programmers and designers will write plugins and add-ons so cool that you won’t be able to live without their functionality. The competitors will have a hard time changing your mind.
That is why it will be hard to leave killer apps like Emacs, Apache, Firefox, etc.
Right now I have only 4 plugins installed on WordPress but they all came out of pure necessity. They were easy to find, install and use. Things that work out of the box? Magic.
Posted in General |
By Dani Berg on May 6, 2009
I have just finished reading a really good book: Producing Open Source Software by Karl Fogel. The text is enriched by examples taken from the Subversion project where the author used to be involved. The book covers a wide range of topics found in Open Source Projects including Technical, Social and Political Infrastructures, Money, Packaging and Releasing, Licenses and etc.
It is a good source of information if you are trying to improve or understand all the processes and overhead demanded by software development. Recommended even if the project you are engaged is not free/open source.
Posted in books |
By Dani Berg on May 4, 2009
Seems that the Intel Graphics will have to be updated to work with version 2.6.28 of the Kernel running on Ubuntu 9.04. Performance is not good.
I followed the instructions to use UXA instead of EXA and it improved the perfomance on how graphics are rendered in my notebook. It is still not fast as it used to be though.
Note on Jun/23/2009
I was happy to notice this morning that the list of updates from Ubuntu 9.04 included the kernel (2.6.28-13) and compiz. All visual effects are back and working fine with the Intel Graphics card.
Posted in General | Tagged ubuntu |
By Dani Berg on May 2, 2009
I finally decided to devote some time to learning elisp and get rid of the shame I have every time I copy and paste code into my .emacs file. I’m now reading Programming in Emacs Lisp (Second Edition) by Robert J. Chassell. It is really good reading. Not only to learn elisp but also because the author is a great writer and I have the feeling he is interested in the history of words. Etymology is a fascinating field.
The text mentions, for example, where the word buffer comes from:
The word `buffer’, by the way, comes from the meaning of the word as a cushion that deadens the force of a collision. In early computers, a buffer cushioned the interaction between files and the computer’s central processing unit. The drums or tapes that held a file and the central processing unit were pieces of equipment that were very different from each other, working at their own speeds, in spurts. The buffer made it possible for them to work together effectively. Eventually, the buffer grew from being an intermediary, a temporary holding place, to being the place where work is done.
Posted in books | Tagged books, emacs |
By Dani Berg on May 1, 2009

Awake Autoresponder version 1.3.4 released. This is a micro release with some small bugs fixed. Next version is on the trunk right now. It is going to be a major release since I’m rewriting a lot of code and compability is broken.
I’m also making some experiments with some 3rd-party libraries and even frameworks like CakePHP and Rails. Having a good time
Posted in autoresponder | Tagged autoresponder |
By Dani Berg on April 25, 2009
I installed Ubuntu 9.04 this morning and for my delight I had proper wireless connection with just a few clicks. The nightmare is gone. Another great improvement in this release is performance. It only takes a few seconds to boot. A new OS release running faster on the same machine? Great.
The only drawback for me is that the Intel Graphics built into my laptop is not supported. No fancy visual effects right now. I have to check it later though. I’m using a Sony Vaio VGN-NR330AE that I bought while I was still living in Brazil.
As noted on my previous post I’m back to Gnome. KDE versions 4.0 and 4.1 didn’t work for me although KDE 4.2 seems to be really good. I might be wrong but I just have the feeling that Gnome is more stable. I also noted that I spend most of my time with 3 tools: Emacs, Firefox and the terminal. The first 2 are built upon GTK and the 3rd is great at both graphical platforms.
Posted in General | Tagged ubuntu |
By Dani Berg on April 19, 2009
I like tech novels but I’m not always on the cutting edge of the books. I just finished reading Microserfs from Douglas Coupland. The book is from 1995 so I’m almost 15 years late. Shame on me.
The narrative is in the form of diary entries which guides you into a very personal and introspective reading. The plot starts in Redmond, Washington then moves to the Silicon Valley. This was really attractive for me since I’m now living in California. It was great to read about the cities, places and roads across the valley and be there the next day.
Can’t wait to order more books from Coupland!
Posted in books | Tagged books |
By Dani Berg on April 16, 2009
It is time to celebrate. Awake Autoresponder version 1.3.3 is ready! Some minor adjustments have been made including a better leads list visualization, which was a request from most users.
I also took some time to improve my bash programming skills. I wrote a few scripts to build the final product in a zip file. Shipping has never been easier.
http://awakeautoresponder.com
Posted in autoresponder | Tagged autoresponder |
By Dani Berg on April 3, 2009
Just launched the Awake Autoresponder website. The address is:
http://awakeautoresponder.com.
I needed something simple that I could hack later. I’m playing with Rails and Ruby a lot and that is why I decided for CakePHP as a framework for the autoresponder website. One server language is enough mess for a project. So let’s just keep PHP in this domain.
Seems that CakePHP and Rails share the same philosophy. Good bet because I never tried CakePHP before but could have it up and running with the main webpage in less than 15 min in the production server.
I’m also trying the YUI CSS files. Seems nice although there is a small bug with IE6 for the columns width. If you are using IE6 you have been warned.
Did not add any JS library yet but I’m sure I’ll be working with JQuery. Awesome.
Posted in autoresponder | Tagged autoresponder |
By Dani Berg on March 17, 2009
The history behind the Autoresponder.
In 2003 I was working in my home-office in a small town in Brazil while trying to get a college physics degree. To pay my bills I was basically building websites in PHP after I left the Perl world. I was part of the staff for a project designed and managed by a grumpy old man in New York. God, I should have sent him a copy of Peopleware (Peopleware: Productive Projects and Teams (Second Edition)
). One day he subscribed for an autoresponder service. It was not cheap and the service was not good at all. I thought I could code the same features and add the others we needed in no more than 2 days. I did it in a weekend and started to share it for free. Back then I had no idea what FSF or OSI were. I started the professional version a while later since it was taking crucial time out of my day night to give support and add new features.
Since the release of the first version I receive emails daily from people reporting bugs, asking for new features, giving suggestions or simply wanting to say hello. Well, although it might not help me to sell more copies, I must be sincere about my efforts into this project. Time to work on it is scarce. I switch between my regular job (there are always new projects at a startup) and research mode at night.
Releasing is not easy. I suffered from it and some symptoms I believe are shared amongst a lot of developers. One is frustration. You know you can do better but time is against you. Another problem is loss of focus. I learned how to manage and maintain this project (more on this some other day) in the hard way. I made all the common naive decisions like trying to rewrite it from scratch or adding a new feature to make a new sale.
Not everything wrong though. I’m still working on it, right?
One major key: Releasing.
It taught me a few lessons.
The first version was small and built to do only one task. It solved one problem of mine but it also worked for a few more users.
The main benefit: Feedback.
I not only read and pay attention to all the emails people send me, but also take note of each one. There are two possibilities here.
1. add a ticket to the bugtracking as a feature to be built or a bug to be fixed.
2. take notes in my to-do log for random idead.
After a few tickets and paragraphs I started to notice patterns and features people wanted most. This way I avoid writing fancy features and make better use of my time writing features that people actually want.
The downside of this approach is, unfortunaltely, the elimination of these “fancy features”. One of these features could turn out to be innovative and a killer feature for the app. Right now, I think this is not a concern. I have all these crazy ideas being developed and written down in my notes. Today these features are expensive for me to code. Meanwhile I have fun building a more mature version of the autoresponder.
Posted in Programming | Tagged autoresponder |
By Dani Berg on March 7, 2009
Version 1.3.2 of the Awake Autoresponder is ready. Fixed some small bugs and made some modifications in the code to make development easier for future versions.
Posted in autoresponder | Tagged autoresponder |