Startups and Raising Money

It is interesting to notice that when most media outlets discuss the world of startups, they mostly address the issue of fund raising. In some way, it looks cool, especially to magazines and newspapers, to brag about millions of dollars being raised from VCs by a new company. However, what is often not said is that raising money is usually a consequence of making a cool product, and not the other way around.

It is just like the way people look at successful people and see only the money they have. Money is only the consequence of success, not its cause. It is something that comes along with success. There is plenty of people that have large sums of money but unsuccessful (and unhappy) in their lives. By focusing only on the money, there is no way to understand the process that is really going on.


Focus on the creative side

I prefer the strategy used by some new startups. Instead of focusing on the funding part of the equation, try to put your effort on the product and team building first. This has two advantages: (1) it is a more relaxed way to work, since you are not putting pressure on the creating process; (2) it creates value immediately, instead of a debt that has to be repaid with future value.

Now, there is the issue of feasibility for this approach. It clearly depends on what kind of product you want to create. In more traditional industries, product development takes massive amounts of investment. This is not the same in software: one person or a small group can do a lot, if they are experienced and determined.

In the software industry, getting external funding may be more of a hassle than an advantage, because of all the strings that are usually attached to an external investment. Is that what you want to your starting company? Starting with a low profile reduces risk and increases the upside for the founders.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • HackerNews
  • Reddit
  • StumbleUpon
  • Twitter

Tips to Read Other People’s Code

Reading code is a basic skill that working programmers need to acquire in order to work on development teams. It is really hard to expect that you will work in isolation of other people’s code. Therefore, reading code is a skill that can make you much more productive.

Although it not easy to learn this quickly, a few tips can help with getting the most of any piece of code. Some of these ideas have helped me to understand large projects over the years.

  1. Understand the program first: it is pretty difficult to understand code for a program if you don’t know yet what it does in the first place. You should try to get used to how the program works before digging into its code.
  2. Read with a goal in mind: the same way it is easier to understand a book if you are trying to answer a concrete question, a similar state of mind will work for reading code. Start with a specific goal and try to answer it. For example, a question such as “how is the screen repainted” can lead you to understand better what you are reading.
  3. Understand the conventions of the platform/language: the way code is organized depends heavily in the language used, and on the requirements of the platform. For example, the way C++ code for Windows is organized is different from C code for XWindows. If we talk about web applications, this is even more dependent on the framework used.
  4. Use a debugger to acquire dynamic information: a debugger can be of great help in understanding code paths that are difficult to grasp (especially in OO languages). Just put a breakpoint in part of the code you want to study. When the breakpoint is hit, check the call stack. This will show you how a piece of code was called and how objects communicate.

Further Reading

The idea of literate programming was promoted by Knuth in his book Literate Programming.

The Linux kernel is a classic example of code that has been read for its own qualities. Understanding the Linux Kernel is one of the many books that explore this fact.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • HackerNews
  • Reddit
  • StumbleUpon
  • Twitter

The Way a Program Starts in Windows

If you write a program in C/C++ for Windows, you are very close to the interface with the operating system. For this reason, it is also interesting to have some idea of what it is doing.

There are two main types of Windows programs: graphical programs and console-based programs. The way Windows determine what kind of program you are trying to create is by a flag it stores inside the executable. This is also called the “subsystem” in which the program will run.

To determine the subsystem in visual C++, one has to set an option in the linker section. This will determine what Windows will see as the subsystem for that program.

Depending on the subsystem, Windows will call one form or another of the C library function that starts a program. The name of this function is also configurable (usually it is __tmainCRTStartup), and it can be changed from the linker section of VC++.


First Steps of a Program

The initialization function in the C library does just a little bit of work that is required by the C run time. One of the most important is to initialize the heap, so functions like malloc and the operator new can work properly.

The initialization function also sets some common values used by the system, such as environmental variables, and the version number of Windows.

Finally, __tmainCRTStartup calls the main function declared by the Windows program. Usually this is called WinMain, but it can be some variation of this depending of the version of Windows and if you are using ANSI or Unicode.

When a program returns from the main function, the initialization function cleans up the heap and returns to the operating system.


Reference

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • HackerNews
  • Reddit
  • StumbleUpon
  • Twitter

Understanding const pointers and variables in C++

In modern C++, we are used to see const pointers. They are a useful way to avoid changes in memory passed to a function. As such, they are very common in function declarations.

The const word, however, has other uses. It turns out that when the const keyword is applied to the pointer itself (instead of the contents of the pointer), the const modifier is also very useful.

When we say, for example, const Type *t, we are saying that the contents of the object pointed by t cannot be changed. However, we can just as well say Type * const t, which means that the pointer t is unchangeable.

For example, check the following code:

int main() {
   int i, j;
   const int *p = &i;
   // *p =0; // ERROR: cannot modify the memory pointed by p
   p = &j;

   int * const q = &i;
   *q = 0;
   // q = &j;  // ERROR: cannot modify the pointer q
   return 0;

   int const k = 0;
   // k = 1;   // ERROR: cannot modify the variable k

}

See that Type * const t may be a syntactical clue for how the code is organized, because in short methods we usually don’t want to have variables and pointers changing. Thus, in such a case we should avoid having variables that are not const.


Understanding const Syntax

The reason for the difficulty of understanding the behavior of expressions such as Type * const t is due to the complexity of the C++ syntax.

Notice that the example const int k can also be written as int const k (as shown above). This denotes that the const modifier is intended to the variable.

When we have a pointer, however, we can also have a const memory location, which is represented as Type * const p. The const attribute is now referring to the content of the pointer, and this is indicated by having it after the * operator.

To simplify the notation, a better way to write const attributes is to make this difference explicit as in the examples bellow:

Type const * p; // can't modify what p points to
Type * const q; // can't modify q itself
Type const * const t;// can't modify neither t or point value

As a quick tip to remember the correct syntax, always keep the const close to the * operator, to make its meaning easier to understand.

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • HackerNews
  • Reddit
  • StumbleUpon
  • Twitter

Why is Twitter More Interesting Than FaceBook

I recently read a blog post [1] commenting on how twitter gives a better user experience than FaceBook. I hadn’t spent a lot of time thinking about the difference, but I suddenly realized that there is really a big shift in focus and tone when I use Titter or Facebook.

First, there are the obvious differences in interface. For example, when using Twitter there is the advantage that you are not required to follow what other people are saying. You are expected just to check one or another comment. Certainly, you can use Twitter as a two-way communication medium, but you can just as well concentrate in something unique about the person that is posting. This was the main point made by Scobleizer.

For Facebook, on the other hand, one has fewer ways to filter the contents of the conversation. Also, there is the annoyance of having comments mixed with the main information.


When Is FaceBook Useful?

There is clearly a context where this is useful. And this is exactly where Facebook was born: a group of friends that want to exchange news, comments, pictures, and videos. If that is the case, then Facebook is the right solution, but it works only if you do this with a small group of people that you know well. People are naturally receptive to what their friends want to say, even if it not useful for you.

You can’t say the same, however, when people that are not a close friend join your conversation. You can quickly become annoyed by what they say, especially if it is not something of your immediate interest.


Content Issues

Also, the content that works on Twitter may not work on FaceBook. For example, I use twitter to comment about my work, which mostly involve technology. But this is not something that all my friends enjoy. I don’t want to fill their Facebook first page with stuff that may not be of common interest.

Conversely, I feel better talking about personal matters on Facebook, because this is where my friends are. I feel that is difficult to mix both networks, but both have important use cases.

Personally, my conclusion on using Twitter and Facebook is that Twitter is much more scalable as a communications medium. You can basically talk anything you want on Twitter, and you will eventually find someone interested on it. This is hard to do in Facebook, unless you spending a lot of time to cultivate the right group of people as Facebook friends.

Facebook is better to keep in touch with people that you have something in common personally: either from the same school, neighborhood, or family. It is a great tool, but doesn’t go much further than that.

From the business point of view, I think FaceBook’s position is weaker, because people can get tired of the typical use cases (unless you are talking about a very young demographic group). Twitter appear to be more suited for business applications.

We still don’t know how the business will play out for both companies, but it look to me that their roles are starting to become easier to feel. Only time will tell, though, if they will change as quickly as necessary to continue growing.

[1] http://scobleizer.com/2009/11/02/the-chat-roomforum-problem-an-apology-to-technosailor/

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • HackerNews
  • Reddit
  • StumbleUpon
  • Twitter