Making internet start-up… Advices from Kevin Rose… and me


Have You ever heard about Kevin Rose?

No? He is known for his internet start-ups, like: Revision3 – internet television network, micro-blogging platform Pownce, and probably most known – social bookmarking Digg. Some of you might recognize wefollow.com project, especially If You are heavy twitter users.

I have just watched his excellent presentation at FOWA (The Future of Web Apps London) – found on the Carsonified’s Blog. He shares some ideas how to “take your site from one to one million users”.  Some of You will definitely find this useful.

Taking your Site from One to One Million Users by Kevin Rose from Carsonified on Vimeo.

What Do You think? To be honest – I really, really liked it. Maybe It wasn’t something fresh, something that we were not aware of, but something that allows web start-up creators to take another look at things they currently do or plan to do in the nearest future. And by the way, Kevin Rose is a good speaker and was able to present his ideas clearly, with some well chosen examples.

Let me comment on few of his thoughts.

1. Ego (Give a reward for user’s contributing to my system)

This is mainly concern for all of You thinking about web 2.0 start-up – web site that will gather community. Idea is pretty simple – give a reward for what people are doing, how they contribute to system.

Just look at the Facebook – how people are proud how many friends they have. Or Twitter – how users (or celebrities) compete to have more and more followers. To be honest – I am glad to have spam users following me - it doesn’t matter as long as my counter increases :) Or take a look at StackOverflow – programmers care so much about their reputations and badges in the system. One of Kevin’s new projects (wefollow.com) is just a twitter’s leader board, no more… Whole project just about that.

It was mentioned at the very end of the presentation (during “questions” time) that user’s should not be punished for their improper behavior. I couldn’t agree more. Before you punish someone (by banning user or deleting reputation) make sure that he/she fully understands how web site works… Probably punished user means lost user.

2. Simplicity and Analysis

Some of top community portals are simple and they focus on their certain functionality. Digg is about Digging links, Twitter about Twitting, Google about Googling :) Everyone knows that. So, stop building new Facebook, it will take ages. Focus on your core features. And remember – if you think building even simple features like twitter or digg have, does not take days or weeks if you really want user friendly experience.

Stop thinking you understand your users. Don’t assume that users do what you think they do.

Stop building new features that will take ages to finish, just because you think user’s may like it. Don’t spend time on features none cares about. Do investigation first. Allow user’s to provide feedback at your website, do it yourself or make use of existing projects for collecting user’s opinion, like: UserVoice or Get Satisfaction. Analyze your pages – use Google Analytics – it is for free and can bring a huge value to your knowledge about your customers, visitors. Analyze it – check how they show up on your website, what are they doing, when, from where they live (exit pages).

3. Marketing

Run your own blog, run your project’s blog. Talk to other bloggers about Your project – make them write about your project. Don’t use force!  :) Use Google Alerts – it will help you to respond to articles, entries where they mention your start-up.  Show Your project at conferences, make a demo to visualize your ideas.  Just think about the fact that Digg is where it is without a penny spend on keyword campaigns in internet.

Ugh… I am not really good at that. That makes me nervous every time i think about it. I like to think about myself as one to get job done. I am developer – marketing is fu!

4. Advisors

No matter what You think and how clever you are, there are people smarter than you, more experienced than you – especially if it concerns specialized areas (marketing, recruitment, business model, fund raising).

5. At the end

Most (90%) of web projects collapse. Extinct. It’s not the case with you. But one smart guy once said that:

The only truly failed project is the one where you didn’t learn anything along the way.

Uh… so true…

Share

Making internet start-up… Part 2: Choosing tools


It has been a while since my last entry in this series. In previous one i made decision: what i would like to make and why. To sum up, I want to make something simple, something about travelling, for travellers, something that may follow idea of websites like: Yahoo Answers or StackOverflow.

The next step is to choose appropriate tools, that will help me to build start-up.

1. Choosing technology

Choosing the right technology for web development is crucial.

What I believe, is that MVC pattern suits web and simply – it just the best for the web. So before choosing technology I need to consider if  there is a way to use MVC pattern with it. Python Django, RubyOnRails, PHP Zend, ASP.NET MVC. Taking look at populurity of them gives:

compare frameworks

On the graph, generated with Google Trends it is clearly visible that python django and php zend framework are gaining a increasing interest since middle of 2005. Slightly opposite things happen to “Ruby on Rails”. ASP.NET MVC is relatively new in the group, but it is constantly gaining more and more interest.

Before making decision I need to consider couple more factors. That is going to be a tough decision. Up to now I had very little experience with framworks beside ASP.NET. It so tempting for me to choose Django framework – not only it is so far the most popular framework following MVC patters – which tells something about community, it is nicely documented as well. It has a brilliant administration panel, and build-in ORM.  Moreover I love to learn, I love to play with something new. But on the other side – let’s face the truth. It would take far longer to make new web site. I had experience with python during my studies – but assuming some things have changed during last years, it will take some time for me to adjust – to make full advantage of it’s features. Moreover, there are some environments for python django that i am not really familiar with – like eclipse. Overall, after a lot of brain storms i decided to stick with ASP.NET MVC (wit Visual Studio 2008). I know it, I work with it. Also it looks like this project is under constant development – notice that after few months since ASP.NET 1.0 was released we already have APS.NET 2.0 preview.

Decision: ASP.NET MVC (but would like to play with Django… :) Maybe next time…

2. Database and ORM

I had experience with both SQL Server and MySql. Like both of them. But since decision concerning main technology/framework was made on advantage of microsoft technologies i decided to choose MS SQL Server for this task as well.

Second choise is for object relational mapper. Here, knowing we are going to stick to .net we can choose among: NHibernate, SubSonic, Entity Framework, Linq to SQL. Lets play with Google trends again….

orms in google trends

As expected NHibernate is a leader. It is no surprise as NHibernate is a quite mature – especially in IT world (5 years , wow, that’s a lot!). Another interesting ORM is Entity Framework – as according to some Microsoft officials this is going to be a main line in the future. For me is no much difference. There is some buzz recently concerning new release of Entity Framework – version 4 – should be released together with .net 4.0 and visual studio 2010. There will be a “model first” approach and POCO classes. I’m excited. VS 2010 + .NET 4.0 is about to come in few months so i guess i will play with 1.0 version of EF and then immediately switch to newer one as soon as it is ready…

Decision: Entity Framework

3. JavaScript framework

Here, answer is the pretty simple. Comparing some of popular JavaScript frameworks…

javascript_frameworks

No doubts this time. jQuery is the most popular one. Plus you can use Google’s CDN. Plus it ships with Visual Studio on MIT licence.  Plus – it is just brilliant and has thousands of plugins….

Decision: jQuery

4. Rich JavaScript text editor

I want to enable heavy posting, answering, commenting on the web site. For that i need some rich text editor.

There are generally two types of rich text editors: WYSIWYG (What You Sea Is What You Get) and WYSIWYM (What You See Is What You Mean).  From development point of view WYSIWYM editors are an obvious choice.  Why? Simply because most of WYSIWYG editors produce code of really poor quality, not to cal it sh**y. But for majority of users – WYSIWYG editors are more natural – simply because most of them are familiar with MS Word.   And it is a user that we really care about making internet web site. And I plan to make an application for all. Including my grandmas… How would i explain them how to use markup editors? 

There are some mature WYSIWYG products, like  tinyMCE and CKEditor (previously known as FCKeditor). The only problem with them is that they are so heavy (above 100KB). That is way too much. Especially when I don’t need new MS Word. I just need few basic actions: bold, italic, list, link. That’s it. Nothing more. Why would i need some advanced features for posting questions or leaving comments?

Since i already decided that jQuery will be my JavaScript framework I took a look at some plugins that can serve editor’s functionality.  I have managed to find some: jwysiwyg, jquery RTE, jhtmlarea, RTE light. I have no bloody idea which one to choose. I will start jwysiwyg, play with it a little. If i am not happy, i will try other one. Let me just give it a try. I read somewhere that JQuery UI team is working on text editor… might consider that in the future….

Now, the tricky part with WYSIWYG editors is that you might get a poor html code. Moreover, this code might differ depending on user browser – as most of previously mentioned editors make use of some browser’s build-in features. Making library that will help me to parse and “fix” user code – to change it info semantic html is very, very difficult and tricky. So note for everyone – don’t do it yourself.  There is a library that might help you with that: HtmlAgilityPack, and it will definitely help me! Hey, check – after few quite years there is a fresh release of 1.4 beta.

Decision: jwysiwyg for now. Changing that shouldn’t be a problem…

5. Summary

This article is not a comparison of technologies. Remember, that i do not compare asp.net with python, mvc with django. I just choose tools to work with. Having Google Trends as a way to help me make a decision is a tiny add-on. Just to make sure some technology/framework/library – thus community – is not dead already. As i need help, like most of the developers.

Life is brutal – although i would like to play with some alternatives i need to face the truth and i choose those that i feel most comfortable with and will enable me to deliver app in certain period of time.

Uh, long post. time for ice-creams … :)

Share

ASP.NET MVC 1.0 issue within HtmlHelper.GetModelStateValue method


It all started innocently… :)

I had the simplest form ever. Just a few text inputs, and one checkbox. State of one of the text inputs was determined by status of one the checkbox. If checkbox was not checked (or “on”) input was set to be disabled. As simple as that.

The problem arrived when someone was trying to view web site with javascript turned off. Because input was set disabled at initial stage there was no way to enable it – no matter if checkbox was checked or not. I know, mea culpa.

As you probably know, controls that are disabled are not treated as valid for submission. So there was no form element for it at server side (Request.Form had no entry with such a key). During validation phase i was checking for this input – since it was not send and then null, validation failed, and i was adding model error. Like that:

if (notify && (string.IsNullOrEmpty(notifyEmail)))
    _modelState.AddError("notifyEmail", "Pleave provide email....");

Notify value represent checkbox and notifyemail – text input. So, the problem arrived when i was trying to redisplay form – due to errors in model state. I had error under:

< %= Html.TextBox("notifyEmail") %>

System.NullReferenceException: Object reference not set to an instance of an object.
System.Web.HttpUnhandledException: Exception of type ‘System.Web.HttpUnhandledException’ was thrown. —> System.NullReferenceException: Object reference not set to an instance of an object.
at System.Web.Mvc.HtmlHelper.GetModelStateValue(String key, Type destinationType)
at System.Web.Mvc.Html.InputExtensions.InputHelper(HtmlHelper htmlHelper, InputType inputType, String name, Object value, Boolean useViewData, Boolean isChecked, Boolean setId, Boolean isExplicitValue, IDictionary`2 htmlAttributes)
at System.Web.Mvc.Html.InputExtensions.TextBox(HtmlHelper htmlHelper, String name, Object value, IDictionary`2 htmlAttributes)
at System.Web.Mvc.Html.InputExtensions.TextBox(HtmlHelper htmlHelper, String name, Object value, Object htmlAttributes)

It looks like there is a problem because there is a model state error and no original value being set. It is used for some of controls under HtmlHelpres. It is rather serious issue. Just imagine it may happen for radio buttons (without any of them being “on”) as well. Simplest possible solution (or rather workaround) is to set different modelstate key and then use it as validation key message under textbox, like:

if (notify && (string.IsNullOrEmpty(notifyEmail)))
    _modelState.AddError("notifyEmailErr", "Pleave provide email....");
< %= Html.TextBox("notifyEmail") %>
< %= Html.ValidationMessage("notifyEmailErr") %>

Hope it will help someone….

It looks like ASP.NET MVC 2.0 preview 1 has this one fixed…

Share

Joining “IE 6 no more” campaign


It is not the first campaign when someone is trying to kick out IE6 from our life.  I guess it all started with some Scandinavian portals encouraging  bloggers to put “IE6 warning” on their web sites.

I was rather sceptical about whole idea.  Especially at the very beginning. Most of IE6 users are either forced to use “mature” solutions (i am talking about large corporations) or does not understand meaning of words like standards or security (so called “mature” users). Like my mom or dad! Until today they double-click “IE” icon saying “i am turning internet on”. Brilliant …

So, what is the point of joining such a campaign? IE6 will die anyway. According to recent browser statistics IE6 drops by 0.5-0.6% every month. Having 14.5% nowadays it will take roughly 2 years for it to drop below 2-3% (I assume it will take far more to completely get rid of it). Such a level, I guess can be neglected.automatic_voting_machine

Let us ask each other: Are we going to change much? Well, I believe that questions is inappropriate. It is a little bit like with democracy and elections. We know that our vote is just a tiny fraction of all votes.  But still we believe in it, we go and vote (or at least most of us). We know that each decision consist of such small steps. If You believe that IE6 should be abandoned you should treat it as your obligation. Obligation to vote, to demonstrate your objection.

Every day i lose my precious time to fix problems with IE6. Fixing css, javascript… Time that I could have spend with my family or simply relaxing. I just cannot afford not to join this campaign! Even if it is going to save extra couple of days of work during next couple of years I would say that it was worth it.

Just imagine people like me and you… How much time could have been saved… spent doing something meaningful… adding new features instead of fixing browser compatibility issues…

From now on every visitor that uses IE6 browser will notice panel at the top of this blog encouraging to install some of the alternatives to old IE6, like IE8, Firefox or Chrome.

P.S. I can bet we will see “IE7 no more campaign” during next 2 years :)

Share

Tips for jQuery validation plugin


Because I currently work with a couple of projects where I extensively use jQuery framework, together with it’s plugins I decided to write a post in which I can gather all of my ideas, tips that i have arrived during my work with this library.  I am a kind of guy that has a huge mess not only on his computer’s desktop but even within project files. It happens that when I arrive a problem, and I am sure I have figured it out in some other project but it usually takes me ages to dig through all of them to find even simplest solution. That is why I decided that I really need a place for all my tips and tricks, so I can find them easily.

This post focuses on jQuery Validation plugin, as i think this is the second thing i add to my project – after jQuery core file :) . I will add more and more tips from time to time as soon as I find something worth to write down.

Ever worked with one of most popular jQuery validation plugins? This is extremely powerful and yet flexible plug-in that  makes form validation in javascript really easy.

Beside that fact that it already contains most popular validation rules, like checking field length, validating email or url format, it enables you to write your own “rule”.

1. Adding new method

Plugin supports method called ‘equalTo’. It is widely used – especially we request password confirmation. What is not supported is ‘notEqualTo’ method. Not that popular but can be useful from time to time. Let us say we have a field that needs to be different from other field, like new password has to be different than old password – maybe not the best choice but draws the picture.. OK, I guess recommended way to do that would be to add new method to jQuery validation plugin:

  jQuery.validator.addMethod("notEqualTo",
                             function(value, element, param) {
                                  return this.optional(element) || value != $(param).val();
                             }, "This has to be different...");
  $("#change-password-form").validate({
                rules: { ... newPassword: { notEqualTo:'#currentPassword' } },
                messages: { newPassword: { notEqualTo: "New password has to be different than old one" } }
  });

2. Preventing double form submission

Another common issue every web developer arrives sooner or later is so called ‘double form submit’. Or going further on ‘multiple form submit’. It happens when user accidentally presses submit button couple of times, causing form to be send multiple times. If we have validation plugin for our form we can make use of submitHandler method to disable button after form is submitted.

  $("#sample-form").validate({
                submitHandler: function(form){
                    if(!this.wasSent){
                        this.wasSent = true;
                        $(':submit', form).val('Please wait...')
                                          .attr('disabled', 'disabled')
                                          .addClass('disabled');
                        form.submit();
                    } else {
                        return false;
                    }
                }
            });

3. Turning on/off validation under certain conditions

It happens quite often that we require input in certain field only when some other element is selected. I just finished making web page that allows users to subscribe to newsletters on their request.  If user selects certain check-box – it means he want to subscribe and we require from him to put valid email in other field.
Otherwise, we want to keep validation turned off. To do this, we use :

<label for="cbxSubscribe"> Would you like to subscribe?</label>
<input id="cbxSubscribe" type="checkbox" />
<input id="txtSubscriptionEmail" name="subemail" />
$("#sample-form").validate({
  rules: {
    txtSubscriptionEmail: {
      required: "#cbxSubscribe:checked"
    }
  }
});

As simple as that. Element ‘txtSubscriptionEmail’ is required depending on evaluation of ‘#cbxSubscribe:checked’ expression.

4. Use CDN from Microsoft AJAX

Surprise, Surprise! ASP.NET MVC 2 (since preview 2 i guess ) includes jQuery validation plugin to provide client side validation. Definitely good news!

Moreover, Microsoft now provides CDN for plugin:

As well as documentation for visual studio – this would allow IntelliSense to work under visual studio (2008 and up):

You should make use of CDN wherever possible. It saves you bandwidth, most probably Microsoft serves content faster and there is always a chance your visitors will have it cached already. Note that Google offers CDN for jQuery and some other libraries: Google AJAX libraries API.

Stay tuned for more updates….

I will keep on adding more tips in future.

Share

ASP.NET MVC 2 Preview 1 released!

YES! YES! YES!

Great news for all MVC lovers, check it out on Phil’s blog

Share