Beta

Slashdot: News for Nerds

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Are C and C++ Losing Ground?

Soulskill posted more than 6 years ago | from the lots-of-ground-to-lose dept.

Programming 961

Pickens writes "Dr. Dobbs has an interesting interview with Paul Jansen, the managing director of TIOBE Software, about the Programming Community Index, which measures the popularity of programming languages by monitoring their web presence. Since the TIOBE index has been published now for more than 6 years, it gives an interesting picture about trends in the usage of programming languages. Jansen says not much has affected the top ten programming languages in the last five years, with only Python entering the top 10 (replacing COBOL), but C and C++ are definitely losing ground. 'Languages without automated garbage collection are getting out of fashion,' says Jansen. 'The chance of running into all kinds of memory problems is gradually outweighing the performance penalty you have to pay for garbage collection.'"

cancel ×

961 comments

C/C++ is dying! (5, Funny)

KillerCow (213458) | more than 6 years ago | (#23188964)

But does Netcraft confirm it?

Re:C/C++ is dying! (1)

omeomi (675045) | more than 6 years ago | (#23189222)

Since the site is Slashdotted, could somebody post the top-10 language list?

Re:C/C++ is dying! (5, Informative)

SatanicPuppy (611928) | more than 6 years ago | (#23189376)

1. Java.....20.5%
2. C........14.7%
3. VB.......11.6%
4. PHP......10.3%
5. C++.......9.9%
6. Perl......5.9%
7. Python....4.5%
8. C#........3.8%
9. Ruby......2.9%
10. Delphi...2.7%

The other 10 in the top 20 are:
JavaScript, D, PL/SQL, SAS, Pascal, Lisp/Scheme, FoxPro/xBase, COBOL, Ada, and ColdFusion

Re:C/C++ is dying! (5, Funny)

LabRat007 (765435) | more than 6 years ago | (#23189438)

For those of you who can't open the page...

1. Java
2. C
4. PHP
5. C++
6. Perl
7. Python
8. C#
9. Ruby
10.Delphi

Please note, there is no language in the 3rd position this year. Seriously.

Re:C/C++ is dying! (5, Funny)

Tackhead (54550) | more than 6 years ago | (#23189286)

But does Netcraft confirm it?

No, but Stroustrup himself is reputed to have apologized for C++ as far back as 1998.

"It was only supposed to be a joke, I never thought people would take the book seriously."
- From the lost tapes of the legendary IEEE interview [nao.ac.jp] of 1998 :)

Always be there (5, Insightful)

ohxten (1248800) | more than 6 years ago | (#23188972)

C/C++ will always be there. Period. Just look at all of the C/C++ projects on SourceForge. New languages will come and go, but C/C++ are just too stable to go so quickly.

Re:Always be there (3, Insightful)

KlomDark (6370) | more than 6 years ago | (#23189016)

Yep, it'll be right out there with all the Cobol projects on Sourceforge...

not so.. (1, Interesting)

Anonymous Coward | more than 6 years ago | (#23189124)

when we have internet that is as fast as cpu response times c and c++ will go the way of the dinosaur and the internet will be your main application platform and gaming platform, meaning game over for c and c++.

Re:not so.. (0, Flamebait)

PalmKiller (174161) | more than 6 years ago | (#23189162)

AC, your an idiot.

Re:not so.. (4, Funny)

Anonymous Coward | more than 6 years ago | (#23189272)

Coming from someone who can't handle the concept of a contraction, it doesn't carry the weight you think it does.

Re:not so.. (4, Insightful)

ArcherB (796902) | more than 6 years ago | (#23189246)

when we have internet that is as fast as cpu response times c and c++ will go the way of the dinosaur and the internet will be your main application platform and gaming platform, meaning game over for c and c++.
As long as computers need an OS, C/C++ will be in wide use. All major OS's are written in C/C++ and will be for the foreseeable future.

Re:not so.. (1)

omeomi (675045) | more than 6 years ago | (#23189304)

Yeah, somebody just needs to write an Operating System in "Internet", and then we'll be set.

That's a broken way to think of it (5, Insightful)

krog (25663) | more than 6 years ago | (#23189158)

C and C++ are entrenched, but it was never their stability which caused it. Computer languages are theoretical; one valid language is just as 'stable' as another. The real issue of stability lies in the implementation, and that is language-independent.

Anyway, C is going to stick around because it is the most superb assembly language developed by man. C++ will of course stay around as well, but by modern standards it fails as a "high-level" language. The ceiling got a lot higher in the intervening 20 years; other languages reach much higher in a very useful way. I'd be happy to see less C++.

Re:That's a broken way to think of it (4, Insightful)

SatanicPuppy (611928) | more than 6 years ago | (#23189460)

I'm not sure C is up to the multithreading/ multiprocessor support that is going to be required as processors keep shifting from single core to multicore architectures...I know it can be done, but C is hard to program for a single core...Multicore support may take it over the edge.

Mind you, I don't think anything else is really set up for it either (Erlang?) but that's going to be the next big challenge.

Re:Always be there (4, Insightful)

fyngyrz (762201) | more than 6 years ago | (#23189160)

C is perfectly capable of extremely high-quality memory management with significant ease-of-use. However, you get to create that facility, or of course you can utilize someone else's design if you can locate one that fits your API needs, budget and time frame.

For instance, years ago I faced this issue and wrote a module that ensures there are no leaks in any part of an application I write; I also get over-run and under-run detection, named segments, dual-free attempt capture, memory usage reporting, and more. I have debug and end-user levels for the code so that during development, I get enormous detail, while the end user doesn't see that unless I specifically turn it on for them.

I have both pool and chunk level management; I have both pool and individual "free" levels; all of this in very few K indeed.

C is the perfect language to implement memory management in, in fact, because it has perfect fine-grained control over memory.

That goes for other things as well; C is highly capable if you need to build in certain types of OO; objects with built-in methods and variables can be crafted in seconds, with no waste at all; uniform list handling can be crafted (and is an interesting and useful programming exercise.)

C *could* go away as a result of a generation of programmers who really don't know how to deal with such things, but I think it would be a real loss if it happened. The up side is that it'll take a while. There's a whole generation of us who know C quite well, and we're nowhere near dead yet. ;-)

Re:Always be there (4, Insightful)

afabbro (33948) | more than 6 years ago | (#23189470)

However, you get to create that facility

s/get to/must/

Seriously, most people want to sit down and write the logic for their application, not invent (or even copy-paste) memory management schemes.

Re:Always be there (4, Insightful)

SanityInAnarchy (655584) | more than 6 years ago | (#23189278)

Assembly will always be there. Period.

That doesn't mean it will be particularly popular, or very likely that you can get a job in doing nothing but assembly programming.

Really, with C especially, just about every advantage it has over more modern languages are advantages that C itself has over assembly. Assembly is still needed, but no one in their right mind would, say, write an entire OS in assembly.

The day is coming when no one in their right mind will write an entire OS in C or C++, or even an entire OS kernel -- depending on your definition of "kernel".

Re:Always be there (1, Insightful)

Hatta (162192) | more than 6 years ago | (#23189444)

Already you'll find that no one writes an entire OS in C/C++. Look at the BSD init system, written in shell script for instance.

The lower levels will always be there (2, Insightful)

CustomDesigned (250089) | more than 6 years ago | (#23189410)

I do most of my work in Python and Java now. However, I often need to write in C/C++ to create JNI modules for Java or extension modules for Python. Wrapping low level (use 3rd party library) and performance intensive stuff for control via a higher level language is very productive. (C++ is handy for JNI, C is better for Python.) Furthermore, I even occasionally write small functions in assembler for C - usually to utilize a specialized instruction.

Re:Always be there (4, Funny)

rishistar (662278) | more than 6 years ago | (#23189468)

C/C++ will always be there. Semi-Colon. There fixed that for you.

Visual Basic at #3? (5, Funny)

eldavojohn (898314) | more than 6 years ago | (#23188976)

I can handle C and C++ losing ground.

But did anyone else find Visual Basic rising two spots to #3 past PHP & C++ to be a sure sign of the apocalypse?

(Visual) Basic 11.699% +3.42% A
Could someone reassure me that's a mistake before I go home to sit down with a bottle of Jack Daniels and a revolver with a single bullet in it?

Re:Visual Basic at #3? (1)

SatanicPuppy (611928) | more than 6 years ago | (#23189042)

I did actually. WTF? I imagine its due to a certain amount of outsourcing, and possibly the maintenance of legacy apps.

Re:Visual Basic at #3? (3, Informative)

kitgerrits (1034262) | more than 6 years ago | (#23189062)


This might have something to do with this PowerShell thing: ccontrolling the O/S through the use of VB scripts.
It's not exactly the Bourne Shell, but it does show promise.
As Windows admins look at scripting the boring stuff, they will need to learn VB...

Re:Visual Basic at #3? (1)

bigman2003 (671309) | more than 6 years ago | (#23189100)

As someone who uses ColdFusion all the time...I have to say, YES! On the chart! Whoo-Hoo!

No worry that it is below ADA, the important thing is that it is ON THE CHART!

Okay, have your laugh now. But I still think it is good.

Re:Visual Basic at #3? (5, Funny)

Hoplite3 (671379) | more than 6 years ago | (#23189122)

Not a mistake. But if I could make a suggestion, it would be to upgrade your burbon to Booker's. You won't need that money later.

Re:Visual Basic at #3? (1)

QRDeNameland (873957) | more than 6 years ago | (#23189164)

I have another question...with the significant differences between VB6 and VB.Net, shouldn't some distinction be made? In fact, the "(Visual) Basic" heading leads me to think that all versions of Basic might be included.

I always find programming language popularity statistics to be dubious at best.

Re:Visual Basic at #3? (0)

Anonymous Coward | more than 6 years ago | (#23189196)

The question is if that includes VB.NET. VB.NET removes most of the brain dead design decisions that were made for VB. It's not enough to keep people from still making utter crap, but if you know what you're doing you'll have less urge to bash your head in with a hammer if you have to use VB.

Re:Visual Basic at #3? (1)

AKAImBatman (238306) | more than 6 years ago | (#23189206)

But did anyone else find Visual Basic rising two spots to #3 past PHP & C++ to be a sure sign of the apocalypse?

I dunno, there seems to be something seriously wrong with their methodology. According to the current chart, Javascript (which is finally coming into its own) is less popular than Delphi, a language that's all but walking dead. (No offense to our Pascal friends around here.)

I find this to be a highly suspicious turn of events. Especially when you consider that 70-80% of those Java programmers at #1 in the list, have to work with Javascript in order to perform their job correctly. In comparison, Delphi is completely divorced from any other platform or language. Yet Delphi is more popular? I don't think so...

Re:Visual Basic at #3? (4, Insightful)

thermian (1267986) | more than 6 years ago | (#23189228)

I've been C coding for years, and I have to say, even though I like it, the number of things that I can do more easily with, say, Python, is getting larger.

I suspect that soon all I will use C for is writing shared libraries that I can call from some other language.

I wish people would stop banging on about C's memory problems. C has *no* memory management problem. It has no memory management at all, um, I mean, you just have to be careful when writing your code.

C is fast, seriously fast even. For that reason alone it will always have a place. I shouldn't think there will be many coders who only use C left soon though, because the job market for pure C programmers is pretty small these days.

Re:Visual Basic at #3? (1)

Chris Burke (6130) | more than 6 years ago | (#23189238)

Could someone reassure me that's a mistake before I go home to sit down with a bottle of Jack Daniels and a revolver with a single bullet in it?

That depends... are you using a silver bullet only for the sake of poetry, or because you a werewolf or other creature vulnerable only to silver?

Because, being a Hunter like I am, if you are a werewolf or such I'd have to say that Visual Basic is in fact on a steady course to overtaking all other languages, and in fact will likely supplant all other languages in the next few years. There's no hope, end it now.

Re:Visual Basic at #3? (0)

Anonymous Coward | more than 6 years ago | (#23189396)

revolver with a single bullet in it?
Single, not silver.

Re:Visual Basic at #3? (2, Funny)

Chris Burke (6130) | more than 6 years ago | (#23189450)

Single, not silver.

Gah, damnit!

I guess now you know why I'm such a terrible werewolf hunter that I have to try to do it by tricking them into committing suicide over the internet.

Managed code is the way to go (4, Interesting)

KlomDark (6370) | more than 6 years ago | (#23188984)

I haven't written a line of code in C or C++ since I started with C# - C/C++ syntax with no tracking of memory (I detest tracking memory!!) except in the more obscure situations. Both .NET and Mono allow for C#, so you're not stuck on one platform.

Re:Managed code is the way to go (1)

CogDissident (951207) | more than 6 years ago | (#23189040)

I agree, C# is a miracle compaired to those two previous versions.

Yes, I actually code in C# at my job, so I do deal with it 8 hours a day.

Re:Managed code is the way to go (2, Interesting)

QuantumG (50515) | more than 6 years ago | (#23189052)

Lately I've found the biggest advantage of using C# over C++ is compile time. If I change a header file in C++, that's it, I'm off to make coffee, but with C# you can change just about anything and the code is recompiled in seconds.

Now if only the native code generation for C# wasn't so pitiful and unsupported.

Re:Managed code is the way to go (1)

ucblockhead (63650) | more than 6 years ago | (#23189258)

Not to minimize the problem, because it is quite real, but this sort of behavior is often the result of poor design. There are ways to code (like pimpl) that move most actual implementation changes into cpp files, or at worst headers that are only included in a few places that minimize this. Of course, this does take discipline that is not necessary in other languages.

Re:Managed code is the way to go (1)

Chris Burke (6130) | more than 6 years ago | (#23189326)

Now if only the native code generation for C# wasn't so pitiful and unsupported. ...

Yeah, my Python compiles are pretty damn fast too. All I need to do is hit Save in my editor, and my program is ready to run!

I see what you're saying, but yeah, if you aren't getting native code out of the deal then compile time shouldn't be an issue in any case.

Re:Managed code is the way to go (1)

QuantumG (50515) | more than 6 years ago | (#23189484)

The difference is that C# actually gives you code that is remotely close to native performance.. and if you do the extra jumping through hoops, you can actually generate (crappy) native code.

Re:Managed code is the way to go (1)

Yold (473518) | more than 6 years ago | (#23189118)

You can still create a memory leak in C# if a reference to an object is still in scope (and it shouldn't be), as seen in a certain University's UAV project.

Re:Managed code is the way to go (1)

Ai Olor-Wile (997427) | more than 6 years ago | (#23189144)

I hate to troll on your parade, but the existence of Mono seems pretty token at times, as if it were allowed to live only as a way to trick Linux folks into believing that C# isn't going to lock them inside of Gates' magic glass box, which MS would have no fear of revoking via lawsuits if their almighty patentpocalypse against Linux came to be (and wasn't just FUD, fate of Novell notwithstanding.) How sturdy/complete *is* Mono? How much does stuff have to be reworked in order to fly on it? See, 'cause, if it's not 100% compatible, everyone can gawk in horror at how many languages Microsoft has squeezed onto the top 10, and just how firmly entrenched they are in the souls of programmers. (That being said, yay for Python and PHP for combating them.)

Re:Managed code is the way to go (0)

Anonymous Coward | more than 6 years ago | (#23189402)

Not exactly speaking for everyone, but I develop for the Second Life server emulator project OpenSim (opensimulator.org) and we have a code base that handles physics (multiple engines), networking, database storage (again, multiple databases), scripting, and more via modules. So far, most of the time it will compile and run just fine on both .NET and Mono. There are some times where it will fail on Mono, however, since our userbase and developers use both Windows and Linux environments, such events are tracked down quite quickly.

Again, we don't touch any of the 3D graphics or GUI libraries, though, so... YMMV.

I have to say, though, it was a much better experience than trying to get Java applications to run on Linux a while back.

Re:Managed code is the way to go (5, Insightful)

pclminion (145572) | more than 6 years ago | (#23189274)

I'm not sure why you feel you need to "track memory" in C++. I did an analysis of all the code I've written a year or so ago, and I found that there is approximately one usage of a pointer in every 5700 lines of code (the way I write it, at least).

We have this great stuff called containers and RAII. And for when you absolutely must, must use a pointer, you have boost::scoped_ptr and boost::shared_ptr. I have not coded a memory leak or buffer overrun in C++ in over six years.

The best way to not leak memory is to never allocate it in the first place. The best way to avoid overflowing raw buffers is to not use raw buffers. Use the containers. When you think you can't, think harder.

Re:Managed code is the way to go (2, Informative)

sconeu (64226) | more than 6 years ago | (#23189406)

Not to mention that scoped_ptr and shared_ptr are in the next iteration of the Standard (well, shared_ptr for sure, can't remember about scoped_ptr).

Re:Managed code is the way to go (0)

Anonymous Coward | more than 6 years ago | (#23189328)

Too bad the ISO standard Common Language Infrastructure is part of the Microsoft-patented Base Class Library. There's a reason no serious C# development occurs in Linux. I think a few Gnome games are developed with Mono.

That said, with C# forcing object-oriented programming, it does make a better starting point for learning C++ than straight C in my opinion.

Re:Managed code is the way to go (2, Insightful)

Anonymous Coward | more than 6 years ago | (#23189424)

Programmers that have trouble tracking memory typically show themselves to also have trouble correctly managing other resources properly, especially in the presence of non-obvious control structures such as exceptions. If exceptions are present, then your code must run correctly forward and backward. Thinking that "everything is OK as long as I throw a call to close() in after I retrieve the results," is hopeful thinking. So long as the flow is not impacted by an exception, you are fine. Once an exception is thrown and your frame is unwound, then you may have leaked the database connection until the GC decides to come along and pick it up for you.

Most managed languages use exceptions in some form, so the task of resource management is certainly not 'fixed' like proponents of GC would like to think. Languages need good constructs to help the programmer specify the lifetime of an object accurately. One example of this is C#'s using construct, similar to Python's with statement.

While I do not miss manual memory management, I do appreciate being able to have direct control over memory if need be. Unfortunately many languages do not allow manual memory allocation for the rare cases it is needed.

Re:Managed code is the way to go (0)

Anonymous Coward | more than 6 years ago | (#23189480)

I'd never dream of using .NET or mono. Vala [gnome.org] OTOH, is beginning to rock!

um.... (0, Flamebait)

bennomatic (691188) | more than 6 years ago | (#23188986)

C-what-what?

Re:um.... (1)

Entanglebit (882066) | more than 6 years ago | (#23189102)

What-plus-plus?

Finally (0, Flamebait)

m50d (797211) | more than 6 years ago | (#23188988)

I realize companies can't be jumping to the next big thing overnight, but really, the tradeoff was in favour of garbage collection 10 years ago.

Re:Finally (1)

SatanicPuppy (611928) | more than 6 years ago | (#23189190)

Well Java proves that by sitting solidly at number 1.

C's greatest strength is speed, and it's clear from the fact that Java (which is slow as hell) ranks higher that speed is not the primary consideration. Neither one of them are exactly a joy to develop in.

Just as well; I don't trust most people to program in C. It's great if can do it well, but for every person who CAN do it well there are 3 who only think they can.

Re:Finally (1, Informative)

AKAImBatman (238306) | more than 6 years ago | (#23189436)

Java (which is slow as hell)
Stop repeating this. If you want to say that Java is slower than C/C++, that's at least a defensible position. (Though not by much. All the benchmarks are showing Java exceeding C++ performance and giving C a run for its money.) But anyone who states that Java is "slow as hell" is painting a big, fat target on his forehead.

Just a friendly bit of advice.

not really for me (1)

stokessd (89903) | more than 6 years ago | (#23189002)

For simple tasks that I used to do in C I'm now doing in python... But I did start programming more in Objective-C so in my world C have morphed not necessarily gone away.

Sheldon

so what? (2, Interesting)

rastoboy29 (807168) | more than 6 years ago | (#23189010)

Of course C++ is losing ground.  But does it matter?  No.

If you still need optimum performance at any cost--like for OS's, many games, simulations, etc.--you must use the C's.  If you don't, then your Java or favorite scripting language will give you faster development time and easier deployment.

So it just doesn't matter.  I still don't consider someone a proper coder unless they know C++, though.

Re:so what? (4, Insightful)

dreamchaser (49529) | more than 6 years ago | (#23189234)

I consider a proper coder to be anyone who can write a proper flowchart and the pseudo-code/logic for their target application. It has nothing to do with the language they finally use to implement.

That being said, I agree with you otherwise. The first thing I thought of when I read the summary was 'lazy coders' when garbage collection was cited as a driving factor. That's the sad fact; many of the kids being cranked out of schools today can't code their way out of a paper bag without a compiler/interpreter that does most of the dirty work for them.

Yeah I know. Get off my lawn.

Re:so what? (1)

MyDixieWrecked (548719) | more than 6 years ago | (#23189350)

I agree.

The way I see it, a proper coder is someone who can write complex programs that work, are secure and can fail gracefully (or better yet, recover from errors). It doesn't matter if you're writing Java, PHP, C or VB.

I've seen some pretty amazing things done in VB, and I've also seen some pretty amazing things done with nothing but C and the standard library without any kind of GUI (MP3 encoders, etc).

When I first started coding and I was using various BASICs (QBASIC, REALbasic, VB), I didn't consider myself to be a true programmer... when I learned C/C++, I still didn't consider myself a real programmer because I couldn't write something with a GUI. When I learned Obj-C, PERL, Python, Ruby, Applescript, et al, I started to realize what programming was and what it meant to be a programmer.

It wasn't until I started seeing how poorly many applications are written and how hard it really is to write good software. No matter what language you're using, no matter what tools you use, whether you use Eclipse, vi, emacs, wordpad, or textmate... if the end product isn't solid, you're not a good programmer.

Re:so what? (1)

dreamchaser (49529) | more than 6 years ago | (#23189428)

Ah, nostalgia. I started coding around age 12. I did use BASIC at first, but found out very quickly how to POKE opcodes directly into memory, so I started doing most stuff in Z-80 machine language (not assembly, there were no memnonics for the opcodes with what I had to work with). Then came Pascal, then the C's, etc.

Proper coding is language and GUI independant. I'd love to see some 'coders' who are used to doing everything all nice and GUI'ish write a device driver or OS kernel (yes, I've done both). Not all, but many, are not really very good these days and the quality or lack thereof of software and all the bloat it entails stands as a testement to that fact.

Bad news for the human race (-1, Flamebait)

pigiron (104729) | more than 6 years ago | (#23189022)

This could have frigtening implications for the future. Are we getting dumber? After all, everyone knows that C++ programmers are smarter than everybody else.

Dying...not hardly (4, Insightful)

PalmKiller (174161) | more than 6 years ago | (#23189026)

I know I am gonna get flamed for this, but they said web programming, like its the only game out there. Sure its not web 2.0 friendly, and sure most web script kiddies don't use it...mainly because it don't hold their hand, but its far from dead when your are needing to squeeze every last ounce of power out of your hardware, or even that other 25-30% of it.

Re:Dying...not hardly (1, Redundant)

QuantumG (50515) | more than 6 years ago | (#23189126)

No, they said web *presence*. Ya know, like how many web pages there are about the language..

Re:Dying...not hardly (1)

PalmKiller (174161) | more than 6 years ago | (#23189218)

Oops, your right. Surely they jest.

Re:Dying...not hardly (1)

moderatorrater (1095745) | more than 6 years ago | (#23189322)

its far from dead when your are needing to squeeze every last ounce of power out of your hardware, or even that other 25-30% of it.
While this is true, it's also something that doesn't come up that often really. Garbage collection and other automated features for languages can eliminate the vast majority of bugs in software. If you don't have to worry about buffer overflows and memory leaks, your code will be more secure, more stable and cost less to maintain. Being resource hungry is a tradeoff that most companies would make and many consumers as well.

Besides, C and C++ will live on forever in most of the languages that have come since and as the foundation for those languages. Sure, PHP is popular, but the engine's C, same with perl and the other scripting languages.

I tried to reply to this (-1, Offtopic)

Anonymous Coward | more than 6 years ago | (#23189034)

but the new slashdot simply sucks much ass technically.

What about desktop presence? (4, Insightful)

Noodles (39504) | more than 6 years ago | (#23189048)

I develop desktop application software. Right now I wouldn't think about using anything else but C++.

and in other news... (1)

bsDaemon (87307) | more than 6 years ago | (#23189060)

And in other news, slide rules have lost ground to graphing calculators with CAS systems...

We put a man on the moon with less computing power than my TI-89. The morale of the story is, people are just getting lazier in general.

Just use Java (0, Flamebait)

VacaN (1249104) | more than 6 years ago | (#23189072)

If all you C'ers would just stop being afraid of OOP... C is over, just look at the CS departments across the nation. They're all going with Java and rightfully so.

Re:Just use Java (1)

jythie (914043) | more than 6 years ago | (#23189398)

Yet you can do more true OOP in C then in C++... OOP in C is easy, you just don't have the 'work done for you' that you get in other languages. But C's runtime polymorphism is lighter and more powerful then Java or C++.

C programmers don't care (0, Troll)

Anonymous Coward | more than 6 years ago | (#23189078)

C programmers are a bunch of cynical old men. We don't have an irrational love of our favourite language. It's simply a tool for a job.

If python or Ruby or Java does the job better, or faster, or more easily, then use that language. They're just programming languages.

Wow (2, Funny)

ucblockhead (63650) | more than 6 years ago | (#23189080)

Down 0.77% in a year? Alert the presses!


Almost as bad as Jeff Atwood and Joel Spolsky calling them "dead languages" on their new podcast.

How much of those are .NET? (0)

Anonymous Coward | more than 6 years ago | (#23189090)

I wonder how much of the Visual Basic and C++ are the .NET variety?

Sample Sets and Beta (1)

4solarisinfo (941037) | more than 6 years ago | (#23189106)

I really want to know if professional programmers out there think what shows up on the web is an accurate sample set of what is going overall in the programming community.
When I ran a Video Production shop, I was always explaining that what you saw on TV was only a very small portion of the market share of Video Production. There's a lot of things that just aren't for public consumption.

C++ is as good as C# _if_ used correctly. (0)

Anonymous Coward | more than 6 years ago | (#23189114)

C++ manages memory for you, simply use boost shared_ptr/weak_ptr. Also, GC's are available for C++ (and C).

Too bad so many people can't use _modern_ c++

Re:C++ is as good as C# _if_ used correctly. (1)

Nova77 (613150) | more than 6 years ago | (#23189202)

+1. Modern C++ is way different from the old day paradigms. Just look at the boost library.

Re:C++ is as good as C# _if_ used correctly. (5, Insightful)

pclminion (145572) | more than 6 years ago | (#23189324)

GC is available for C++, but IMHO inappropriate. One of the great advantages of C++ is that the construction/destruction mechanism, along with automatic variables, gives you absolute control of the lifetime of every single resource. Whereas a garbage collected language like Java gives you absolutely no control over when (if ever) an object is destructed. I think it is a little wacky to give up this total control of object lifetimes in return for such a puny benefit, a benefit which could easily be achieved through C++ resource management techniques like RAII.

And anyway, garbage collection is irrelevant if you never "new" anything in the first place.

For performance-critical code there is no choice (4, Insightful)

SilentTristero (99253) | more than 6 years ago | (#23189136)

For image processing (film/video), real-time audio or any serious signal processing, the overhead of anything but C/C++ is killer. It'll be news when Adobe After Effects or Autodesk Flame is rewritten in python.

Besides, measuring the popularity of a language by the size of its web presence is the worst kind of fallacious reasoning.

Re:For performance-critical code there is no choic (1)

SanityInAnarchy (655584) | more than 6 years ago | (#23189334)

Which is why most of the "new kids" -- Python, Perl, Ruby (though Perl is getting kind of old now) -- support C extensions.

Would I actually write h.264 encoding/decoding in Ruby? No, not really.

Would I write a video app in Ruby? Absolutely -- just call out to the existing h.264 library (and mjpeg, etc) when I need to do the performance-intensive (and also boring) stuff.

*SIGH* Repeat after me... (0)

Anonymous Coward | more than 6 years ago | (#23189138)

As long as there is such a thing as an embedded computer, C and C++ are here to stay. Or tell me - do you have a plan to make your eight core Mac control the anti-lock brakes and airbag in your car?

Incompetence... (2, Interesting)

HetMes (1074585) | more than 6 years ago | (#23189152)

...I say. If reference counting or basic allocation deallocation coupling is something you cannot do, you're in the wrong business. However, educating students in the art (c.i.t. I know) of programming with Java calls for these kinds of problems.

Re: Are C and C++ Losing Ground? (0)

Anonymous Coward | more than 6 years ago | (#23189154)

>Are C and C++ Losing Ground?

I sure hope so. Honest, I'm not trolling here, I'm just tired of C's religious zealots refusing to consider alternatives. C is a fine replacement for assembly language, but why the hell would you write a web server is assembly? Then why the hell would you write one in C? It's *good* that some languages make it easier to write good code, and harder to write bad code.

C and C++ might die at different rates. (5, Insightful)

jythie (914043) | more than 6 years ago | (#23189170)

I could actually see C++ slowly going away over the next decade as it is replaced by other languages that fill the same needs but better. C on the other hand is probably going to be around for a long, long time.

Re:C and C++ might die at different rates. (0)

Anonymous Coward | more than 6 years ago | (#23189458)

I could actually see C++ slowly going away over the next decade as it is replaced by other languages that fill the same needs but better.
Agreed. Here's hoping it's D rather than C++0x.

Statistics (5, Insightful)

Anonymous Coward | more than 6 years ago | (#23189172)

Measuring by internet web pages mentioning it? Can you say, "worthless statistic," kids? I write code that controls hardware. You bet it's C++. I write code that's IN the hardware. An interpreted language? Are you out of your damn mind? Do I blog about it? Don't be absurd. Am I generating "web presence" for it? Only on slashdot. Go away useless statistic.

Just like Fortan and COBOL! (1, Insightful)

Sta7ic (819090) | more than 6 years ago | (#23189200)

"C++ is dying". Next!

C/C++ won't be going anywhere fast.
  * There's too much code written in both languages.
  * There's NO CHANCE (imo) that anyone is going to write a kernel with code the plays with the memory behind the scenes. That's what the kernel's there for.
  * "If it works, don't fix it." See old FORTRAN, COBOL, Pascal, and other "dead/dying" languages that are still being used in industries because it'd cost more to replace everything than it's worth to update it ~ and in downtime & support costs more than direct dev costs.
  * "Fashionable" languages may affect the language choice, but do not affect task requirements. Construction workers don't wear hard hats because it's fashionable to do so.

I haven't written any real C++ in a long time (1)

Omnifarious (11933) | more than 6 years ago | (#23189212)

I can see cases in which I'd want to write an application primarily in C++, but it would be a pretty rare thing now. Mostly I see C and C++ as ways to make Python faster when it needs to be.

The garbage collection is nice, yes. But what really draws me to interpreted languages is how easy it is to build programs in tiny little scraps that you independently test along the way. And after that, how some of them allow you to have great economy of expression without being hopelessly obscure.

I Hope so Too (0, Flamebait)

turgid (580780) | more than 6 years ago | (#23189242)

C is a systems language, and it's very good at it. Gone are the days of 8MHz desktop computers when we needed C for writing applications.

C has its place, and C++ isn't all it's cracked up to be.

I hope they are becoming proportionally less popular than other languages, because otherwise we aren't making progress.

I write C for a living, and enjoy it, but then I do systems level stuff. I would hate to write a modern application in C. It'd be crazy. Java or C# would be pushing it too, they're just not high-level enough.

Re:I Hope so Too (1, Informative)

Anonymous Coward | more than 6 years ago | (#23189422)

C++ isn't all it's cracked up to be.

It isn't? Let me give a little example of what you can do in C++. The task is this: 1. Transform all the strings in a vector of strings to uppercase. 2. Remove all the strings whose length is a multiple of 3. 3. Sort the resulting vector. 4. Print the strings on the screen.

Here's how I do it:

(cat(stringvec) | transform(strupper) | grep(bind(size, _1) % 3 != 0) | sort() | print())();

Yes, that is actual C++ code, using a powerful generics language implemented with metaprogramming techniques. Now imagine writing entire systems like this. Looks kind of like shell code, doesn't it? Except with the total efficiency of C++.

Don't care for this little language? Invent your own. C++ has the capacity to express an infinite number of such "little languages." Metaprogramming is not a joke. It is probably the most powerful feature of C++. The problem is, few people are genuinely good at it. The boost project collects most of the experts in one place, so we can all make use of their techniques.

But, I suppose, this insanely powerful ability is not "progress." Hrm.

(In case you are wondering, the assembler code generated by the compiler from that single line is very similar to the code I would have written, had I written in assembler myself.)

It's not about the language, it's about the VM (0)

Anonymous Coward | more than 6 years ago | (#23189266)

For 99.9% of applications out there, you do not need C. Nor ASM. For the uttermost techy stuff, like, say, the gurus working on OS kernels or hypervisors, then ASM and C still rule the day. Any day.

But once again, for 99.9% of apps out there, what is really needed is: a bullet-proof virtual machine (it's 2008 and I'm pissed off by all these buffer overrun exploits/null exploits/you-name-it that are simply a thing of the past in a good VM) and great libraries.

It's obvious that this discussion is at the 3GL level, so pick Java, pick C#, pick Scala or any language targetting a bullet-proof VM and you're good to go (that said not too sure about C#/.Net being as robust as Java/JVM... Last time I checked the Real World [TM] --as in bank transaction etc.-- wasn't running on MS technology ;)

I think there's no excuse today to produce something, say in Java or Scala, that runs under a JVM, that is notably slower than the C counterpart.

It's even less forgivable to spout "but Java applets failed" and "Java makes my browser crash" nonsense in 2008.

Did you write a Webapp that comes even close to GMail? What is GMail written in yet? Did you write something that comes close to GWT? What language do you need to use to interface the GWT API yet? Did you write several of the planet's very best IDEs ? What are these written in yet? What is the language that is going to be used by independant developer to port apps to the new Android phones (LG, Samsung, Motorola phones etc.) ?

Can I do remote profiling of your app as easy as 1-2-3 ?

Really guys, wake up. What language/VM is powering the Real World [TM] ?

Specializing, not dying (1)

PenguinX (18932) | more than 6 years ago | (#23189270)

I've noticed this trend as well, however it seems to me as though these languages are specializing rather than dying.

For example, it seems to me that C has a long future ahead of it as the de-facto low-level language. C++ is evolving in many ways, while trying to be true to the 'as close to the hardware' as possible roots. Many of the changes that have been outlined in the C++0x specification are rather interesting indeed.

I've spent the past year of my life using Python every day, and I'll admit that it has excellent utility as a general purpose programming language. However I do not see it replacing C in kernel development, nor do I see systems libraries being re-written in Python. I do however see many opportunities for rapid application development, web development, and other application-centric development in Python.

To be fair, there hasn't been anything earth shattering from the systems level programmers in some time, although the call has gone out to 'fix' threading, and if anyone takes that seriously I am certain that we'll see an increasing number of lines of code written in C and C++ again.

Finally, number of lines written doesn't mean one language is better than another. Frankly that's really silly, and it doesn't hold up to marketability either. I was recently in the job market, and many many people had no clue what Python was. Then again, I live in Seattle.

Cheers
-b

Different markets - different requirements (4, Interesting)

ThePhilips (752041) | more than 6 years ago | (#23189294)

What I love about such studies is that they can confirm any theory you want.

Truth remains that every particular market has requirements which dictate selection of languages.

I doubt that telecom industry (as it is right now) would ever get over C or C++. Just like kernel or system libraries in anything else but C.

If you look at rise of Web - and pleiades of supporting it languages - then both C/C++ are out of question of course. Though again I can hardly imaging Apache or MySQL or PHP being written in anything else but C or C++.

Market for system and telecom programming is definitely shrinking - and consequently their languages. Other markets are now blooming - and their languages are becoming more popular.

My point is that the languages are complementing - they are not competing. After all you have to write hardware, firmware and OS first. Only then your beloved automated garbage collection has possibility to kicks in.

Re:Different markets - different requirements (3, Informative)

krog (25663) | more than 6 years ago | (#23189434)

Just a note -- Ericsson developed the Erlang [erlang.org] language with telecom-style reliability in mind, and using it they have brought to market products like ATM switches with 99.9999999% uptime (that's nine nines, under 40ms of downtime per year). Telecom isn't just C's domain anymore.

There are two kinds of coders... (3, Insightful)

Froze (398171) | more than 6 years ago | (#23189298)

those who can code in binary and those who cant code.

OK, kidding aside.

There are those who write code so that a person can do something on a computer. In which case the users are comparatively slow and the high level languages give you a distinct advantage in development.

Then there are those who write code to make the computer do something, in which case the low level languages give you the ability to more effectively optimize how the computer interacts with itself, this is where languages like C, C++ really come into their own.

In the early days of computing it was all about the later, now its much more about the former, but the later will never go away. So the decrease is reasonable and IMHO does not represent a failing of the language, just a shift in the way computers are being used. I will be very surprised if the high level languages ever get widespread acceptance in the areas that require computational efficiency, ala computational physics, protein folding, etc.

Re:There are two kinds of coders... (2, Informative)

oodaloop (1229816) | more than 6 years ago | (#23189412)

OK, kidding aside.

I thought the joke went: There are 10 kinds of coders...

Fortran! (4, Informative)

frogzilla (1229188) | more than 6 years ago | (#23189330)

Fortran has been dead for ages but we still use it everyday on a variety of architectures. I know we're not the only ones. Many scientists still use it.

Lose A Little Ground (1)

BigBlueOx (1201587) | more than 6 years ago | (#23189346)

C may lose a little ground now and then but don't expect it to go away anytime soon. C is a cross-platform macro-assembler and a cross-platform macro-assembler is such an astoundingly useful thing that C has managed to be widely used since the reign of Henry III. Expecting C to die is like expecting Microsoft to open-source Windows.

In fact, along with ViceGrips and duct tape, C is one of the Three Most Useful Things In The Universe. (BTW, I didn't make that up. It's in The Book)

All I gotta say is (1)

IdeaMan (216340) | more than 6 years ago | (#23189356)

Bjarne! Get off your ass!

Memory management needs to be addressed as part of the language, not as a library call. That this has not been effectively addressed I lay directly at your feet. Don't give me that garbage about memory management being a job for the programmer. If that were the case then why did you even bother with explicit typing? Expecting us to keep the track of where to release memory is just as bad as expecting us to remember the type of every variable in the system. And then you went and added exceptions.

IMO garbage collection is an ugly solution to a general problem that wasn't solved by the compiler. It ruins real-time performance and still doesn't solve the other half of the memory allocation problem: not releasing memory.

Oh and that half-assed new/delete junk you gave us just a friendly wrapper, it doesn't go anywhere near solving the problem.

slashdotted (0)

Anonymous Coward | more than 6 years ago | (#23189372)

Yet another reason not to use a web server written in Java.

Give me a break (1)

sentientbrendan (316150) | more than 6 years ago | (#23189386)

C++ is going "out of fashion"? What industry is this again? Who cares what is "in fashion."

C and C++ let you do things that you *cannot* no matter how hard you try in other languages. Java and Python have their place, and that place has expanded over time, but there are areas that they cannot tread.

No matter how much you improve the JVM, you will *never* be able to write a video codec in java (when the jvm compacts, it has to stop the world, and thus the video too). Nor will you be able to write kernel modules. Nor will you be able to write a large commercial video game. The list goes on and on...

Garbage collection is *great* when you can use it. However, garbage collection has some fundamental performance and memory usage characteristics that aren't going to go away, and thus GC languages will always be precluded from certain domains.

Scheme, ruby, python, lua, and lots of other languages come and go, but C++ is a powerful tool that is here to stay.

Also included on the list. (0)

Anonymous Coward | more than 6 years ago | (#23189388)

What "programming languages" that they didn't include.

The Next 50 Programming Languages


The following list of languages denotes #51 to #100. Since the differences are relatively small, the programming languages are only listed (in alphabetical order).

...Verilog, VHDL...


I guess that we HDL guys have our work cut out. Mark my words-- we will catch up to C/C++.

Surprising charts (1)

DanQuixote (945427) | more than 6 years ago | (#23189432)


With the help of the Standard Template Library (thank you vector and string!), I am 4 to 6 times more productive in C++ than in C. How is it that C is more "popular" than C++?

Perhaps this study isn't showing what they think it is. As long as we can't count lines of production code directly, such a conclusion will be somewhat suspicious.

Wow - D! (1)

Arakageeta (671142) | more than 6 years ago | (#23189462)

Wow. I'm amazed that D made the list. Could this really replace C++ given more time?
Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Create a Slashdot Account

Loading...