Python vs. C#: Understanding Personal Bias

About This Blog

This site is for  entrepreneurs.  A full RSS feed to the articles is available.  Please subscribe so we know you're out there.  If you need more convincing, learn more about the site.

Community

Google+

And, you can find me on Google+

Connect on Twitter

Get Articles By Email

Your email:

Google

Blog Navigator

Navigate By : 
[Article Index]

Questions about startups?

If you have questions about startups, you can find me and a bunch of other startup fanatics on the free Q&A website:

Answers.OnStartups.com

Subscribe to Updates

 

30,000+ subscribers can't all be wrong.  Subscribe to the OnStartups.com RSS feed.

Follow me on LinkedIn

OnStartups

Current Articles | RSS Feed RSS Feed

Python vs. C#: Understanding Personal Bias

 


Warning:  This is likely going to be a series of somewhat lengthy articles, because the topic is complicated and needs to weave in a number of conceptual threads, some technical and others strategic.  It will also include a bit of history to set some of the context for my decision making.  Feel free to ignore these parts if you choose.

This article captures some of my thinking related to the choice of language/platform for startups.  The current discussion was sparked by the introduction of a new member to our development team.  This new member has had some positive experience with Python as a language (and has been doing work that is similar to some of the work we’ve been doing in my current startup, HubSpot).  The deeper I dug into the rabbit hole, the more interesting the discussion has gotten.  I thought I’d bring the discussion to the blogosphere as a way to both refine my thinking and solicit input from the OnStartups community of readers.

Working For A Software Company
 
Before we delve into the issues themselves, I’d like to share a personal anecdote.  In my first real job as a programmer, I was writing code for U.S. Steel.   At the time, I was still working on my undergraduate degree at Purdue (major:  Computer Science).  One thing I learned, relatively quickly at U.S. steel is that those working at the company that were not making steel, moving steel or selling steel were “overhead”.  The programming group was seen as being little different from accounting, finance or HR.  I quickly made the decision to leave the steel industry as I didn’t want to be “overhead”.  I further decided that the only place to go where I wouldn’t be overhead would be a software/technology company where the product being sold was software.  As such, I found my next job at a large software company.  I figured that I’d learn much more and be able to contribute much more value to the organization if their revenues were being generated primarily from software products.  I could not have been more right.  Most of my early training and some of my best lessons came from this first job as a real programmer at a real software company.

Lesson 1:  If you’re a “career programmer” and really passionate about software development,  I encourage you to go work for a software company.  You’ll learn a lot and won’t regret it.

At this new company, the product was a large financial application (written in COBOL).  I was hired on to work on some “next generation” technology to build a Windows front-end for the company’s large legacy application.  Before I was hired, the company had picked Easel (a RAD development platform that was specifically created to easily build front-ends for large, mainframe-based legacy applications).  Most of you will likely have never even heard of Easel, but it was reasonably popular at the time.  Now, at this company we had a brilliant individual who had been with the company since it’s inception and had acted as “chief software architect” ever since.  The flagship product was his brain-child.  We’ll call him Warren (because that’s his name).  He was the programmer’s programmer.  He got it.  He understood the tradeoffs and constraints, he understood the business and had successfully built an application that was the company’s competitive advantage in the early days.  Over the long haul, I am convinced that the company survived (and thrived) in the face of stiff competition, primarily because the software was designed for ease of change as customer needs got more complicated and the market shifted.  The design wasn’t perfect, but it was much better than the competition.  Of course, the application was still written in COBOL so there were limits to what they could do.  One of the issues was that Warren was so good with COBOL development that he could do almost anything within it.  I remember some great technical discussions when we were talking about OOP vs. structured programming and he did some really exceptional refactoring of the core COBOL code that was “inspired” by OOP.  But, the fact remains that for the kinds of things we now needed to do, COBOL just wasn’t a good choice.  The complexity of developing rich GUI applications almost mandated OOP (along with an MVC design pattern and other stuff).  Trying to replicate OOP inside COBOL (which the COBOL vendors were in the process of doing) just didn’t really ever get there.  

One thing I quickly learned about Easel (it wasn’t a hard language to learn) was that what it provided in terms of short-term productivity, it lacked in long-term viability.  After working in objected oriented languages at school, it also seemed archaic and limiting.  My favorite development language at school had been Turbo Pascal from Borland.  So, I did some research and tried to figure out how other smart companies were solving this problem.  I discovered that C++ was a widely used, general purpose programming language for desktop applications.  It had OOP, large third-party support and an entire ecosystem around it.  This was in stark contrast to Easel which was constrained on just about all fronts.  So, I pushed for us to abandon Easel and use C++ instead (I hadn’t written a line of C++ code at the time).  To prove my point, I took a laptop with me on vacation and decided to learn the language and build a new front-end product on my off-time.  The learning curve was a little steep, but not that steep.  

At the end of about 6 weeks, I had a semi-working application.  I had built it all in my spare time and demoed it to management.  They loved it.  They productized it.  They started selling it to customers.  That’s how C++ got introduced into the company.  Easel (both the company and the product) is now pretty much dead.  There’s nothing at the website, and I’d be very ,very surprised if it’s still around (a quick Google search doesn’t turn up anything useful).

Lesson 2:  Closed languages owned by a single company without the resources to build out an ecosystem can and do fail eventually.  Sometimes a lot.  Sometimes completely.  (But, open source is a different ball game.)

Fast forward about 9 more months.  I ultimately decided to leave the company and go off on my own and kick-off my first startup.  Not because I didn’t like the company (I did) or that I wasn’t learning enough (I was), but it just “felt right”.  I’ll spare you the details of this decision in this article since that’s not the focus.  I picked C++ as the primary language for my new startup.  The reasons were obvious:  I already knew it, it was an expressive enough language, and I still liked the growing support within the community.  Lots of people were doing interesting things with C++ so I thought the language was not likely to die anytime soon (I was right).  C++ continued to serve us well and my startup built several successful commercial products (web and desktop) and we ultimately sold the company last year.  It was a happy ending.  At the time of the acquisition, our choice of C++ easily removed what could have been one point of discussion and contention.  I think the fact that we had used a mainstream language and that the acquirer already had programmers that used that language (and understood it), helped.

Lesson 3:  If you’re a startup looking to be acquired someday, your best case scenario (when it comes to technical platform choice) is not to be able to convince the acquirer that you made a good language/platform choice.  Your best case scenario is not to have the discussion in the first place.  Also, it is unwise to assume that the acquirer has the same passion for technology that your startup does or the same willingness to “evolve” to your line of thinking.

In my most recent startup, I originally decided to use C++ (on Microsoft’s .Net platform).  I felt this would give me the most “flexibility” (as I could do just about anything I needed).  Within a few months, I switched over to C# because of all the merits of a “contemporary” language that had things like garbage collection, reflection and a clean component model that actually worked.  So far, I’ve been pretty happy with my choice.  But, am I missing something?  If I could do it all over again, should I have picked Python?  That’s what we’re going to get into next.

Current Concern #1:  When looking at the C# vs. Python question, I am trying to get a handle on whether by bias towards C# is driven by my familiarity (and success) with C++ or by the true merits (both technical and business) of the choice.  Further, if a given language/platform choice, even if it is less popular, provides bottom-line results to the company, isn’t that going to raise the value of the company much more than picking the “safe” choice?  I don’t know, we’ll take a look at this.

That’s it for this installment.  Next time, we’ll take a look at some of the arguments and counter-arguments on both sides.  I promise it will be more interesting than this article, which just established some context.

Posted by on Mon, Jul 24, 2006

COMMENTS

I think you have to strongly consider the domain here as well. This conversation is for your web product, correct?

I think the discussion is very different depend on the following:
* is it a desktop, web-based, or real-time product?
* do you need persisent appserver, or is database persistence good enough?
* is it a financial or healthcare product?

I think that these question mandate very different 'right' answers.

posted on Monday, July 24, 2006 at 11:22 AM by Shannon


Why just C# vs Python? Why not include other languages in the argument? Ruby comes to mind. If you're doing mostly web development- PHP has to be considered.

It can be toxic to a startup to just choose whatever you're most familiar with. There is not a overall "best" language/framework out there. You need to consider all of the options and then pick the option that works best with your problem domain.

HubSpot is a web app, and I've launched successful applications in C#/.NET, PHP and Ruby on Rails. Despite web being a huge RoR evangelist, I must say that the C#/.NET project went significantly better than any project I've ever developed before. But was that the main factor determining it's success? I'd lean towards "No", but the fact that we rarely grappled with the limitations of the language and framework cannot be ignored.

posted on Monday, July 24, 2006 at 11:24 AM by


Agree with both comments so far. Domain of the problem is indeed important (in my case, it's primarily business web applications with some destop tools in the future).

On the Ruby On Rails front, from what I have heard, it seems that Python and RoR can be thought of "similar" (that many of the arguments for one would apply to the other).

As it stands, I'm simply trying to surface the issues and questions. RoR is a great environment (from what I've heard), but it just turns out that the discussion I'm having now involves Python.

posted on Monday, July 24, 2006 at 11:30 AM by


Python and Ruby can indeed be considered "similar", I suppose- there are definite distinctions and advantages/disadvantages between the two, but when comparing them against something like C#, they can be lumped together.

The real difference in Python and Ruby is that Python doesn't have a good web development framework. Rails really makes Ruby a viable alternative- ActiveRecord is by far the best object persistence framework that I've ever used. Testing is also very, very nice in Rails. I'm not too huge on how Rails handles MVC, but it is most likely better than anything else out there. What does Python have? CherryPy I believe is the most popular, but I haven't heard anybody implementing it and having nice things to say about it afterwards. .NET, while a nice framework, forces you to essentially roll your own version of ActiveRecord.

The major question is this:
Which language/framework will let me concentrate more on business problems and less on technical ones?

For me, that answer is Ruby on Rails for most web applications. Python just doesn't have a good enough Web framework for it to really be a contender- if you used Python without a framework, you'd essentially be rolling your own, which is a lot of overhead before you can even begin to concentrate on your actual business problems. .NET probably lies somewhere in between, with the only two big things being object persistence and testing.

(Side note: I've found that .NET is vastly superior when it comes to storing things in sessions. If you think your app might be storing quite a bit in memory, you might want to give .NET a bit of a bonus)

posted on Monday, July 24, 2006 at 12:00 PM by


I have used all three of the languages under discussion for several years. I have launched Web Sites with ASP/VB/COM, C#, and Ruby on Rails, (never found a web framework in Python that I liked). I have found the coding and development work to go significantly faster in Rails than in C#. I still use C# at my day job, and I go home and use Rails, so I'm very current at both of them. There is no doubt about it, Ruby is a *much* more expressive language than C#.

The determination about which language to use boils down to what you are building, and how much traffic you are going to handle. In many ways I look at C# and Java as the new C, they are the lowest level languages that you should be building something in for most cases (there are exceptions where actual C or even assembly makes sense, but they aren't the rule). I'll give you an example, I work in an industry that has to handle massive amounts of transactions at a time. One of our clients spikes up to about 15,000 api calls and 10,000 database calls per second. The application written in C# handles that traffic very nicely on a single 8 processor box, and we have the capability to scale horizontally if needed.

I'm sure given the appropriate hardware configuration a Rails app could handle that much traffic as well.

The real question for me is this, where is the appropriate trade off between ease of programming and hardware? To build the said system we have a team of around 40 C# programmers, and in looking through the system a great deal of the LOC could be reduced by using a more flexible architecture.

If we could reduce our programming staff to 20 or less we could easily afford vastly more hardware if it was needed. Writing a more performant application at the cost of having to have more programmers doesn't seem like a good trade off to me. Hardware and computer power is extremely cheap compared to good development talent. So for me the choice is clear, in my startup I use Rails in order to maximize my development time.

Oh and as an aside, I know for a fact you'd have to justify the use of C# to many potential acquirers. Over the years, many a client has questioned the use of C# and MSSQL instead of Java or C++ and Oracle.

posted on Monday, July 24, 2006 at 1:10 PM by Doug


Just a quick note: Python does have good web frameworks, there just isn't a canonical one, nor one with as much hype as rails. Django (djangoproject.com) is plenty nice and as mature as Rails (it's been used in many production sites, comes out of a newspaper project that is as old as Rails.) Turbogears is another offering.

posted on Monday, July 24, 2006 at 2:18 PM by Ben


When I readThe title in reddit i thought my co-dev wrote it. We are facing pretty much the same question with our startup. While he comes from a company where he wrote everything in C#/.net i am much more happier with the python/ruby approach which somehow makes me feel more in control(I like to be able to see the fw classes). So far i have come to the conclusion that the approach "best tool for the job" is the most effective. Some things are easier in .net some in python. Python is the quick solution while .net the heavy impressive fw application. I am very excited about your future articles on the topic..

posted on Monday, July 24, 2006 at 4:55 PM by Nemlah


http://boo.codehaus.org/

posted on Tuesday, July 25, 2006 at 3:27 AM by boo


looks like you've got a bug in your comment system's url conversion

posted on Tuesday, July 25, 2006 at 3:29 AM by boo


I think that the topic should be widened definitely to cover more languages. My own experience is to look at what it is you need to do and then assess the languages on their merits. I do this now after failing terribly using PHP for something - basically we've used PHP for years as most of our development has been web-based. We recently had to create an application to compare webpages for changes (I'll not go into the detail) and we used PHP to do this, including some web crawling. The result was that PHP just didn't cut it and after a large amount of money had been spent on development we ended up having to completely rewrite it (In Python) and it works very well now. PHP is a great fast language for developing front-end sites, but when you need powerful parsing its not great. This has resulted in us now using PHP for the front end display to this particular product, but using Python at the back-end for the intensive parsing and analysis work that we're doing. What I'm trying to say, in a not very good way, is that:

1) Does it necessarily come down to just one language? Why not utilise more than one based on their strengths

2) You need to evaluate what you want to actually do and then see which language(s) fit

posted on Tuesday, July 25, 2006 at 6:09 AM by


There is a more deeper issue, already somewhat identified by your experience with Easel. I see the argument as C# or non-C#. By choosing C#, essentially you are committing yourself to Microsoft technology, on being a Microsoft 'partner'. This is not a bad thing in itself of course. Many successful and hugely profitable and acquireable companies have been built on MS technologies and there is no reason to believe this will stop anytime in the next decade or two (unlike Easel you mentioned). Incidentally the non-C# is further divided into Java or non-Java. Non-Java is further... you get the idea.

posted on Tuesday, July 25, 2006 at 6:27 AM by


Mr Fixit I think the selection of the two languages is more to represent two points:
- Different language/technology orientation and how to deal with it in a startup.
- Lightweight/heavyweight development environments.
So far the writer introduced mostly the first point, while i am hoping he will touch the second point too.
So basically he could have mentioned any number of languages. The languages he chose are in my opinion very representative of the current mainstream programming world.

posted on Tuesday, July 25, 2006 at 8:46 AM by Nemlah


Ismangil c# has a free Mono port which is quite active. Even if MS decided to close it's upcoming C# 3.0 specs, we would have a fork for free use. Mono is quite nice and some very good applications have been written using it (Novell mainly). I see a much wider division in the programming world. One among heavyweight and lightweight languages/fw. Nowadays you can do anything with every language. Python can be used for desktop applications, network scripts, webframeworks etc.. so can .net. The main difference for those languages is the heritage they bring with them, mainly an open or not framework, community, development principles, development environment etc. etc...

posted on Tuesday, July 25, 2006 at 8:51 AM by Nemlah


While I think lesson 3 is true I think it's a fundamentally flawed perspective to use when choosing a language. It assumes that you're a company whose sole goal is to be aquired and not to write great software. If you are strategizing based on some long term goal of "being aquired" instead of being a great company worthy of being aquired you'll never produce great software. If you're planning on being a great company then you really should be focusing on doing what it takes to be a great company. If the best language for that goal happens to be a buzzword compliant one then great. If not, is it really worth choosing one that is and knowing you'll be hurting your productivity and working in a less enjoyable language every day really worth that?

posted on Tuesday, July 25, 2006 at 9:53 AM by masukomi


the whole article isnt even written yet and already theres a rails v. python flamewar.

python has a lot of great and successful web frameworks, suiting all different tastes: django, pylons, zope, turbogears, etc. It also has a much more flexible ORM than ActiveRecord available called SQLAlchemy, which embraces the reality of difficult real-world database schemas - as opposed to ActiveRecord's philosophy of "you shouldnt need to use those things" (i.e. composite primary keys, etc). in addition, Python's engine is more mature and high-performing than that of Ruby, is widely used by Google, Redhat and others, and also has threading and unicode support which Ruby lacks.

interestingly, there is also a Python interpreter that blends in excellently with .NET called IronPython, downloadable off of Microsoft's site, which includes native support for .NET concepts. That alone makes Python a better choice than Ruby for a developer migrating from C#, or integrating an existing .NET application with Python scripting.

posted on Tuesday, July 25, 2006 at 4:55 PM by mike


Mike, I agree; I have just started using IronPython and it is a good compliment to C#. To be honest, .NET is a must for any of my projects, and if I can't use the .NET Framework, then I will just use Python (compile it with py2exe) or C/C++. Besides that, C#, Python, and PHP (for .NET) all share something that is a necessity: ease of use.

P.S. I realize this is an old arcticle.

posted on Friday, October 27, 2006 at 9:22 PM by Mark


Some time i think it is crazy but i am working on a project to develop a new language. initially i developed it like interpreted c++ then i changed my mind and make it like php. It will not do everything but my aim to have a simple language to develop a website. i decided to make this like dotnet that will support php and c++ scripting. this language has database like mysql, xml regexpression all buit in.
Please have a look at my web site and make some comments.
www.ashnah.com
php like ashnah programming language

posted on Saturday, January 06, 2007 at 8:34 PM by ashraf


I think Python is great for Web development, along with PHP which is already doing great in this field. Time of C++ was different and here situation is totally different. Although C# would be great choice but for what cost? can you enjoy being freelancer with this language? are you ready to pay for VS?

posted on Friday, April 17, 2009 at 7:54 AM by Dhawal


Comments have been closed for this article.