IT DRILLDOWN
 
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: Information Collective

Current Rating: 3 Comments: 9

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)
3
 
 
Sat, Sep 8, 2007 14:38 EDT
Anonymous user
Posted by: glyph
Rating: 30

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!

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

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: 70

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.

 
Tue, Oct 7, 2008 16:30 EDT
Anonymous user
Posted by: Anonymous
Rating: 10

I recently inherited a C++ application that I've had to modify. It has been a baptism of fire... I've plenty of coding experience, mostly on VB and .NET so I know what I look for in a language. I found C++ like going on a trip to the middle ages, it's full of antique syntax and utterly alien concepts. A good example is allocating memory... I dont know if that is common in C++ but why on earth do I have to do stuff like that? I just expect any modern language/platform to handle that kind of stuff seemlesly and behind the scenes. I want to get on with coding my app and not deal with the mundane chores that I have to semm to have to explicitly code, or get from add-on engineered libraries.

Simple tasks like opening and reading a file involve obtuse syntax and lots of potential for error. It shouldn't be like that in 2008! We have moved forward, and C++ should, IMHO be consigned to the home for retired languages. It had its day, but that has gone... time to move on..

About this Blog

Tips, hints, and interesting tidbits for information technology professionals as collected by the editorial staff of CIO.

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 96 of IT's most insightful thinkers.

advertisement

  PARTNERS       PODCASTS       WEBCASTS    
 

From Laggard to Leader: Transforming the Data Center

This webcast offers an understanding of how customers are transforming their data centers, the successes and challenges of each approach, and how IT can become the driver to provide real business value and competitive advantage.

Sponsored by HP  Register for this Webcast »

 

Raising the Bar on Business Service Delivery

Applications drive every business, but as networks become more complex and dynamic, performance has become a key tenant in service delivery. In this CIO webcast, Forrester and Fluke Networks offer advice and best practices for ensuring high delivery with better application performance.

Sponsored by Fluke  Watch this webcast. »

 

The Universal Wireless Client

Learn how replacing multiple wireless clients with one Universal Wireless Client can cut support and help desk costs, increase end user satisfaction, improve security, and help implement Network Access Control.

Sponsored by Fiberlink  Read this White Paper »

Resource Alerts

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

NAC launch from HP Procurve Podcast with Lippis Report, Part 1

ProCurve Networking by HP joins the Lippis Report to announce major product and organizational additions to their ProActive Defense strategy.  Read More »

 

Accenture's View on Web 2.0 and its impact on business

Publisher at CIO magazine, Bob Melk, talks to Accenture's Blair Jones about the emergence of Web 2.0...  Read More »

 

A Best-Practice Framework for Virtualization

This podcast offers insights and perspective on the various issues that relate to virtualization...  Read More »

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.

CIO Viewpoints on Exchange 2007 Risks and Mitigation Strategies

Knowing where your peers have found limits and workarounds in areas including high availability, archiving, recovery, compliance, e-Discovery and storage growth can be essential in planning your successful Exchange 2007 migration.  Read More »

 

Find out what Forrester says about mobile endpoint security and its management.

Mobility raises productivity. But IT departments are hard-pressed to protect mobile data and to manage security software, wireless clients and regulatory compliance for mobile workers...   Read More »

 

Get Forrester's take on simplifying mobility with the universal wireless client.

Mobile workers want to use all types of wireless networks: WiFi, 3G cellular networks, corporate WLANs and home wireless networks. But how can IT support...  Read More »

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
 

Build up or Tear down? See how UC makes sense with Nortel. Calculate your UC ROI

Predict the future with HP Insight Power Manager

Drive Business Value with Enterprise Social Computing - whitepaper

See how IBM helped Bharti create a new business model

Read how IBM helped Hughes enhance security

HP LaserJet M3035 MFP series starting at $1,599. » SHOP NOW. www.hp.com

NEW HP Color LaserJet CM3530n MFP starting at $2,499. » SHOP NOW. www.hp.com

Affordable technology-no compromise. HP server solutions

Make IT Work As One@novell.com

Learn about the software-based VoIP solution from Microsoft

CIO Starter Kit includes useful resources created by top CIOs. Free Download>>

Rolling the dice with your security? Take the Self-Assessment Test now

Request a Novell/Microsoft deployment workshop and kit

Request a Novell/Microsoft deployment kit

Compuware.com - See how we make IT rock around the world

SOA Educational Library at the TIBCO SOA Resource Center

A fresh look at the impact of customer intimacy.

The Right and Wrong Master Data Management Strategies to Start Small and Grow Big

Learn how to leverage virtualization for a 74% savings in TCO.

Find out how you can affordably consolidate applications with VMware.

ESG Research on Server and Storage Virtualization

Webcast: Mitigate Operational Risk- Real Answers for Tough Times

Laptop Security: Where Do CIOs See Weaknesses?

How RFID Improves Data Center Efficiency

Paving the Way for Trusted Collaboration

SAS a Leader in Forrester BI report. Click here to see evaluation.

Protect data-HP All-in-One and Disk-Based systems

Microsoft SQL Server 2008. Read Case Studies, Watch Demos, & Download for Free

The 2008 CEO Study: Implications for the CIO

HP LaserJet P4014n printer starting at $799 after $100 IS. www.hp.com

NEW HP Color LaserJet CP3525n printer starting at $699. » SHOP NOW. www.hp.com

Predict the future with HP Insight Power Manager

A new level of interoperability. Make IT Work As One@novell.com

Businesses Transform with VMware Virtualization

IT Service Management: Metrics That Matter

Download the free CIO Starter Kit to access useful resources created by top CIOs

Log onto Hitachi True Stories, films inspired by the next great achievement

Request a Novell/Microsoft deployment workshop

Strong Authentication. Secure USB data storage. One Device

Discover PMI's credentials and career path tools

Learn how companies are changing how they reach out to their most profitable customers.

Discover what you need to consider when evaluating virtualization.

Webcast: SOA Brings Backend Systems into the Future, Rapidly & Successfully

Find out why IDC thinks virtualization is changing operating environments.

Explore the impact virtualization can have on your bottom-line.

Save with 0% Lease Offer on HP Servers and Storage

The Customer Communications Management Platform - Key Functionality and Best Practices

Data Center ROI with RFID Asset Tracking

Learn how the new Quad-Core AMD Opteron™ processor improves performance

Get help navigating the management challenges of virtualization.