Google Analytics

Wednesday, November 24

You cannot borrow trust

If you ever find yourself saying, "If you don't believe me, you can ask <insert a trusted party>", stop. It is already too late. You cannot make up for the lack of trust by borrowing it from someone.
On the other hand, you can borrow money in a time of crunch. So when faced with a choice between keeping somebody's trust or saving some money, choice should be obvious.

Friday, November 12

How to get Google to fund your startup right after college!

If you are a hacker and a student in India and you are interested in doing a startup, you have a golden opportunity in your hands.

The Google Summer of Code (GSoC) program offers $5000 for a 4 month project you do for one of the participating open source projects. You get a mentor, hands on experience of implementing something which will potentially be used by real users and also get to be a part of an ever growing community of hackers in India.

Now let us say, you were able to get into the program. So you have access to:

At today's conversion rate, $5000 translates to Rs.2,22,000/- approximately. After paying taxes (which comes at max to about Rs.6500/- assuming male and no other income), you are left with 2,15,000 in your hands. For a college student, 4 months expenses can be as low as Rs.10,000 when living on campus. But let us keep it at Rs.25,000/- assuming you really decided to live it up. Still there are ~Rs.1,90,000 in your account.

Excellent Pool of Co-founders
If you are on any of the mailing lists like OCC, HeadStart or follow the forums like, NASSCOM Emerge, you can find any number of would-be-entrepreneurs looking for co-founders, especially technical co-founders. Through the GSoC community, you know a fine set of technical geeks who are willing to spend their summers working on arcane parts of free software projects. Guess what! These are the guys everyone is looking for but is unable to find. Grab one of them and find something of mutual interest. Bonus: your seed fund just doubled. If you want to be extra secure, just find one more co-founder. :)

Experience of actually building something
Assuming you participated in GSoC out of love of hacking and not for money, you already have more experience at building real things than most of the graduating students and most of the alumni of past 2-3 years. 

Initiative & Timing
There will not be a better time. Do GSoC in the final year of your college and then use the money to work on your dream startup immediately afterward. You will be in the flow and free of other burdens and worries. If it doesn't work out after 1 year, just think that you took 1 year extra to complete your degree ;-). With the skill set you develop, you will find a good job any given day.

So don't let this golden opportunity pass you by. If only GSoC had existed while I was in college!

Monday, November 8

Python - A good introductory programming language?

First a little experiment. The other day, I needed to count words in a string. One straightforward method for this is to break the string into tokens and count them:
def count_words_split(sen):
    return len(sen.split())
This is nice since split automatically takes care of multiple consecutive spaces if present. However in my case all the words were guaranteed to be separated by 1 space only. So following should get the job done with a little less work:
def count_words_count(sen):
    return sen.count(' ') + 1

This is essentially a single pass over the string with no need to create an intermediate list of strings and so should run faster. Surprisingly, on Python 2.5, the first method is twice as fast as the second one. I have no idea why. However sanity is restored on Python 2.6 and the second version is not only faster but also gets better with increasing size of input.

This got me thinking about a good introductory programming language. I learned programming with C and algorithms with Java. Many people have argued that Python makes a better introductory programming language. I have also liked Python in the one year I have been using it. One nice feature of CPython, the primary Python implementation, is that the critical parts of your program where you have need-for-speed can be written as C extensions thus getting a significant performance benefit. Many standard Python modules are written as C extensions.

To a newcomer, however, it is not always clear what is implemented in C and what is not. Most of the time it is OK for somebody who is only learning to program. However an important part of learning to program is to learn about various data structures and the algorithms and how they compare on problems. Now if it so happens that an algorithms that should run faster in theory ends up slower because it uses parts of language implemented in pure Python while the other algorithm silently makes use of parts ported to C and runs faster, it can be confusing. This was the situation I found myself in while running my 2 algorithms on Python 2.5.

In fact, even beyond python, I would argue that a good introductory programming language should be consistent in the results it generates even if they are not the fastest. Perhaps Jython is a better bet in that sense since it will make sure that there are no optimized C modules skewing the timing results. Perhaps it is possible to create a dumb-down version of CPython which will not use modules written in C, using pure Python replacements instead.

PS: In fact, given that algorithms often have a space-time trade-off, even GC might play spoilsport. So does that mean going back to C? :)