NEWSLETTERS
 

CIO.com updates, insights and advice on technology, management and your career.

 
 
 
SUBSCRIBE TO CIO
 
Are you involved in setting the direction for your company's IT budget or strategy?

Apply today for a FREE subscription to CIO Magazine!

 


Fri, Sep 7, 2007 12:24 EDT

Linus Torvalds: Why C++ Sucks

Topic: Development

Blog: Web 2.0 Advisor

Current Rating: 5 Comments: 11

The War of the Roses had nothing on the language wars. Since the beginning of my computing career, I've watched developers fight over the relative virtues of programming languages... from C versus Pascal to Ruby versus Python. What is it about this subject that brings out such passion?

Linus Torvalds has recently gotten into the fray, posting a message on a techie list in which he says outright that C++ is a horrible language. "It's made more horrible by the fact that a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do nothing but keep the C++ programmers out, that in itself would be a huge reason to use C."

According to Torvalds — yes, the Linus of Linux — C++ leads to really really bad design choices. He says that developers "invariably start using the 'nice' library features of the language like STL and Boost and other total and utter crap," that may "help" you program, but they cause infinite amounts of pain when they don't work and inefficient abstracted programming models.

Far be it for me to argue with Torvalds, or to claim the virtues of C++ (though it was C that got me to quit programming and turn to writing full time). But what astonishes me just slightly is that, after all these years, there's still room in the world for such discussions. I'm not sure that I'd say that any language is truly horrible (and I did, back in my programming days, use several of them). (Operating systems, yes. Languages. no.) Some programming languages worked better for certain kinds of apps than did others; I found it easier to "think" in some than in others. (One coworker once opined that I could write FORTRAN code in any language, probably a reflection of the fact that FORTRAN was the first I learned.)

Whatever happened to "Use the best tool for the job"? If your developers have such strong preferences, how do you convince them to use the languages approved in your shop?


You do not have flash or javascript support.
Average (2 votes)
5
 
 
Sat, Sep 8, 2007 14:38 EDT
Anonymous user
Posted by: glyph
Rating: 70

Linus shouldn't talk about something he doesn't understand. He couldn't have found a better way to advertise his ignorance about C++ to the whole world than this.

He is telling the whole world that "Hey, here I am, you know, the guy who created the linux kernel, the best designed piece of software in the whole universe(don't listen to Tanenbaum though, he didn't learn OS fundamentals), so you better listen to me when I say that C++ _sucks_. Don't give me the BS about how so many large applications have been created in it, because they would have been only better had they been created in C(it's a magical language btw, solves _all_ your problems in the blink of an eye). If you go and read about people like Stroustrup, Sutter, Alexandrescu, Koening, Thomas etc, take it from me that they missed lot of their CS clases, so they don't know a thing about programming. How do I know? They use C++!"

Sage Linus at one point or the other has to wake up to the fact that he is not the guru of all things that is programming and his opinion of the C++ language is taken as seriously as that of my hair dresser.

 
Tue, Sep 18, 2007 21:51 EDT
Posted by: jhx
Rating: 90

Please go read the git forums to understand what actually happened. This story and some of these comments make it sound like Linus was running through the streets with banners that say C++ sucks. A short version of the REAL story...someone posted on the git SCM list stating that git should be reworked in C++ and with no legitimate technical reason other than to make fixing his own problems easier for himself since he is familiar with c++. Linus and git developers retaliated with very reasonable concerns (and with a wee bit of personality:). Most of these comments sound like people need a life or have some different issues to grind on. Please spend time coding something useful rather than making ridiculous comments, OR if you must, please research first!

 
Tue, Jan 20, 2009 18:27 EST
Anonymous user
Posted by: Anonymous
Rating: 90

He's also changed the world to a much greater extent that you will.

 
Mon, Sep 10, 2007 11:26 EDT
Anonymous user
Posted by: BigMikeK
Rating: 70

Lets face facts - there is no one perfect programming language. It is possible to write beautiful Assembler and ugly C++. The language is just a tool. My personal preference for when I have to get down and dirty is Assembler. This stems, no doubt, from the fact that the first programming language I learn was IBM 360 Assembler. The second was COBOL. If the count of large successful projects is how we determine what is the best language then COBOL wins. My preference for writing new code is straight C. Yes, it WILL let me dig a hole and bury myself. But it also lets me to write what I want and it assumes that the programmer knows what he (or she) is doing.

 
Mon, Sep 10, 2007 13:59 EDT
Anonymous user
Posted by: steffcaldwell
Rating: 30

It's always somewhat entertaining to watch programmers stroke their own egos. People like Linus Torvalds, Paul Graham, and few notable other like to hop up on their digital pedestal and proclaim down to the unwashed masses that everything that they say, in their infinite wisdom, is canon.

Linus' thread is nothing but FUD and virulent opinion. STL and Boost are convenience libraries certainly. It's my conjecture that they weren't designed for system-level type project. They help to make some aspects of programming easier and the abstractions that they provide are adequate. They are designed to be general purpose because the authors of STL and Boost can't possibly take into account every possible consideration that someone might have. They picked the lowest common denominator. If you need something specialized -- you write something specialized simple as that.

Additionally, judging the merits of a language based on the libraries that it has is pointless. Comparing "C" to "C++ & STL" is equally arbitrary and is an apples to oranges comparison that does nothing but make the person doing the comparison look as though they can't differentiate between the language and libraries that are implemented in said language.

Finally, I especially take offense to the denigration of C++ (or any programming language ) by basing the quality of a language on the quality of its users. That's about as dumb as me saying "Trucks are stupid. The features that they add over cars are crap and poorly thought out, in my highly exalted opinion. They are especially useless because their drivers keep crashing them" (I'm sure this analogy is broken, but I hope you get my point).

It's a guilt by association fallacy and an ad hominem attack all rolled into one. Celebrity programmer do nothing but piss me off.

About this Blog

C.G. Lynch chronicles what matters (and what doesn't) in the world of social networking, Web 2.0 and consumer applications.

Start a Conversation
Click to post

Got something to say? We want to hear it! Click the Post button to get started. GO»

EXPERT ADVICE
See our roster of experts.

Advice & Opinion from more than 108 of IT's most insightful thinkers.

  PARTNERS       WEBCASTS    
 

Preparing for the Next Cyber Attack

Ensure you are up-to-speed on the latest security technologies available to keep your network safe in this Executive Guide. Get a thorough assessment of the corporate security threat landscape. Protect your network with data leakage protection, NAC and other technologies explained in this report.

Sponsored by Qwest  Read this Executive Guide »

 

Cloud Building: 8 Ingredients for Internal Clouds

Cloud computing: a fundamentally new way to deploy IT services and functions cost-effectively and quickly. Learn how the VMware vCloud initiative dramatically improves how consumers access their information and experience applications as well as the 8 ingredients to get you going.

Sponsored by VMWare  Read this White Paper »

 

Investing in Business Analytics Technology

You're thinking now is the time to take the plunge into business analytics, but you still have some unanswered questions. This research summary addresses the most common questions and concerns surrounding the successful launch of a business analytics initiative. It also includes real-world examples of organizations already getting return on their investment.

Sponsored by SAS  Read this White Paper »

Resource Alerts

Get instant email notifications by topic when white papers, webcasts, and case studies are added to our library.

Resource Alerts

Get instant email notification when white papers, webcasts, and case studies are added to our library. Don't just be up-to-date—be up to the minute with our new Resource Alerts.

Improving Transparency and Accuracy in IT Cross Charging

During this Webcast you'll learn how KBC Group implemented SAP BusinessObjects Profitability and Cost Management and realized many benefits.   View Now »

 

Cost Savings and Risk Reduction with Effective Systems Management

Join us and see how Novell can help you respond to today's economic challenges by increasing productivity, reducing costs and aligning IT initiatives with overall business goals.  View Now »

 

Capitalize on Your SAP Content

Learn ways to improve your content management by viewing these Open Text webinars today.  View Now »

Resource Alerts

Get instant email notification when white papers, webcasts, and case studies are added to our library. Don't just be up-to-date—be up to the minute with our new Resource Alerts.

 
NEWSLETTER

Sign-up for the Blogs & Discussion Newsletter

 
FEATURED SPONSORS
 
 
 
SPONSORED LINKS
 

Introducing the new HP ProLiant G6 server family

Accenture: Outsourcing for Competitive Advantage. More...

Better spam protection with Postini for just $1/user/mo

Introducing the new HP ProLiant G6 server family

infoBOOM! - The Mid-Sized Company CIO's Exclusive Community

Accenture IT Consulting: Logical meets technological. More . . .

The Fraudster Economy Model: Operating a Business in the Underground

Trade in your old laser printer and get up to $1000 back!

Taking the Service Desk to the Next Level

Revolutionizing Enterprise Application Deployment

Why Data Loss is Increasing--and What You Can Do About It

Data Loss Prevention: A Better Way to Approach Security

Learn how to managing client systems in the enterprise.

Build a High-Performance Open Web Platform

Mid-Sized Company CIO Community: infoBOOM!

Enterprise PBX Comparison Guide

Getting Value from Outdated Networking Equipment

Losing Ground: 2009 TMT Global Security Survey

Stop Application Fraud at the Source with Device Reputation

Learn about the VMware vSphere (TM) & Intel (R) Xeon (R) Processor 5500 Series

Learn how a virtualized enterprise can help your company reduce costs

Why Isn't Server Virtualization Saving Us More?

Learn how to save 30% through project & portfolio management.

How Open Source is Changing the Face of Enterprise Software

8 Key Ingredients to Building an Internal Cloud

Accenture IT Consulting: Enabling high performance. More...

Top Five CIO Challenges

Insight makes it easy to spend your Microsoft subsidy check.

Five minute business analytics assessment. Immediate results.

Dangerous Collaboration Practices: 5 Ways IT Can Minimize Risk

Accenture: Outsourcing for uncertain times. Click to learn more.

The Case for Investing in Business Analytics Technology. Read white paper.

Live Webinar: Applying Business Analytics. Click here to learn more

Seven Ways ITIL Can Help You in an Economic Downturn

Developing A Dynamic, Real-Time IT Infrastructure

Maximizing the Business Value of the PC Infrastructure

Communications and Collaboration Needs at Business Organizations

Using Open Source to Deploy Web Applications

Cloud Computing: Read about VMware's compelling vision & set of products

Enterprise PBX Buyer's Guide

Secondary Market Primer: Your Network at Half Price

How Interactive Viewer Reduces the Effort to Meet Visualization Requirements

Top-line Performance that's Bottom-line Efficient

White Paper: 8 Key Ingredients to Building an Internal Cloud

Read about virtualization and consolidation effort best practices

Building the Virtualized Enterprise with VMware Infrastructure

The Global Marketplace Today: Strategies for Tough Times

Top 10 Business and IT Drivers for the Wealth Management Sector

5 Steps to Automating Accounts Payable

Bottom-Line Benefits of Virtualization