Slashdot Mirror


Are C and C++ Losing Ground?

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.'"

160 of 961 comments (clear)

  1. C/C++ is dying! by KillerCow · · Score: 5, Funny

    But does Netcraft confirm it?

    1. Re:C/C++ is dying! by Tackhead · · Score: 5, Funny

      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 of 1998 :)

    2. Re:C/C++ is dying! by SatanicPuppy · · Score: 5, Informative

      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

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    3. Re:C/C++ is dying! by LabRat007 · · Score: 5, Funny

      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.

      --
      "Capital punishment makes the state into a murderer. Imprisonment makes the state into a gay dungeon-master"
    4. Re:C/C++ is dying! by dfiguero · · Score: 3, Interesting

      Funny that, according to the site, Javascript is losing ground. I was thinking the opposite should be happening now that Ajax is so popular.

      --
      My penguin ate my sig
    5. Re:C/C++ is dying! by lgw · · Score: 4, Interesting

      Do they somewhere discriminate between VB and VB.Net? Claiming that VB is not even a programming language is ... probably reasonable. VB.Net is just C# without curly braces, however.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    6. Re:C/C++ is dying! by intangible · · Score: 3, Insightful

      A musket isn't as useful or respectable when everyone else has M1A2s though.

    7. Re:C/C++ is dying! by Anonymous+Brave+Guy · · Score: 4, Insightful

      Popular as in people using it, or popular as in lots of people writing about it?

      Personally, I'm not convinced AJAX is that popular on the people-using-it count. It's a very useful technique for a particular niche, but it is only a niche.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    8. Re:C/C++ is dying! by neokushan · · Score: 5, Insightful

      Surely it's not really a fair indication just because it's web presence is dropping? I could easily argue that Java is only so "popular" because more people are posting with problems they're having using the language and that C\C++ are only loosing ground because better information on using the language is already out there.

      --
      +1 IDisagreeSoHeMustBeATrollOrAnAstroturferOrAShill
    9. Re:C/C++ is dying! by jd · · Score: 4, Interesting
      ColdFusion should be shot with a silver bullet, stabbed through the heart with a stake, be stuffed with garlic, and be buried at a crossroads at midnight in a holy water-filled lead coffin with elder signs on all sides, inside and out. Other than that, I have no idea why it ranks in the top 20.

      Delphi and Pascal are other puzzlers. Pascal is great as a teaching language, but there are later iterations of that family of languages - Modula-2 and Modula-3 - that arguably provide better rigor if rigor is what you are after. And I see no obvious reason to use Pascal or related languages if you're not after truly rigorous code.

      C seems to be holding ground, the slight loss seems to be within the fluctuations other languages that are holding steady are seeing. It's too powerful, too close to bare-metal programming and too close to the actual machine architecture to fade for some time yet. C++ might genuinely be losing ground - C# and D provide a lot of the power and object-orientedness of C++ but make an effort to learn from the complexity of C++. Personally, I suspect D might stand a better chance as C# is still very much tied to a single vendor in people's minds. I don't see C++ vanishing, rather I see them reaching some common point and staying there.

      VB is quick-n-dirty, and it's popular because it's so easy to write something in it. If it ever became unlawful to have a website that was dangerously insecure or a hazard to Internet traffic (in much the same way cars have to be inspected every so often in some places to ensure it meets certain minimum safety standards) I imagine Visual Basic would lose appeal. Well, that or the EU eventually raising the fines to the point of driving Microsoft out of international competition.

      Given that so much new scientific code is still produced in Fortran, whereas not much is really written in COBOL although a lot of legacy code is maintained in it, I'm surprised COBOL is there and Fortran is not. (Fortran is popular enough that there are TWO competing front-ends for GCC for it. There are open-source COBOL compilers, but as far as I know, all work has stopped on all of them. To me, that says something about the level of interest and serious usage.)

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    10. Re:C/C++ is dying! by ATMD · · Score: 3, Interesting

      I wouldn't say it's a niche. I recently got around to learning AJAX and proper DOM scripting and now I want to use it for everything. It makes the UI so much nicer not having to reload the entire page every time you have anything dynamic.

      --
      Nobody else has this sig.
    11. Re:C/C++ is dying! by Bozdune · · Score: 5, Funny

      VB not a programming language?

      Yes, because:

      1) Only noobs and losers use VB.
      2) It's not object-oriented and I took an OO class and they said everything should be OO or it sucks, so VB sucks.
      3) I have to create global variables sometimes and I was taught that I should never use global variables for anything because they're bad.
      4) Only noobs and losers use VB.
      5) VB lets me create classes but they don't work the way classes are supposed to so I hate them.
      6) I don't like VB controls, they're ugly, I like to make little hexagonal corners and stuff and piss away weeks of development on cute little clickable thingies.
      7) Only noobs and losers use VB.
      8) I don't like VB because writing Windows applications should be really hard.
      9) "Hello, world" only takes one line, and that can't be right, because I learned in Java class that it should take pages and pages of setup code and stuff.
      10) Only noobs and losers use VB.
      11) Some idiot can build a simple windows app in about 30 seconds and it's not fair, that same app took me two weeks in C++ class.
      12) The dweebs in Accounting are building VB apps and they shouldn't be programming, they don't know what they're doing.
      13) Only noobs and losers use VB.
      14) I heard Ruby is where it's at, I only want Ruby jobs now because it's kewl.
      15) I heard that VB is wicked slow, but then I found out it compiles and stuff which totally isn't fair.
      16) Only noobs and losers use VB.

    12. Re:C/C++ is dying! by leenks · · Score: 4, Informative

      Lots of us (in enterprises at least) are realising (or rather, we are able to convince the project managers now) that webapps aren't the solution for everything, and that overall development time is often increased by the difficulties when developing in javascript / html.

    13. Re:C/C++ is dying! by Anonymous Coward · · Score: 2, Insightful

      I know your troll is a mockery of the groupthink, and I don't want to spoil your momentum, but I think this bares saying. Visual Basic, before .NET style, was as turing complete as any other language I have had to use. Meaning, I CAN solve any solvable computational problem. Classes might NOT be like C++ or Java or whatever... but it isn't an inferior way of doing it. It is the COM way, which just about no one is comfortable with. Sure, error handling sucks, but seriously, do you REALLY think that try/catch is any prettier? I can call any DLL function with only half of my brain.

    14. Re:C/C++ is dying! by utopianfiat · · Score: 3, Insightful

      I was convinced that in the scientific programming world, people were still into Fortran as it grants a slight increase in speed over C for certain algorithms. Of course, this wouldn't have a broad _web presence_ due to the fact that realtime and mission critical applications aren't posted on the web. I think the limit of the fortran that still exists publicly would be the open source ATLASes and MATLAB clones (ie:matplotlib), as well as, of course, Linux itself.

      --
      +5, Truth
    15. Re:C/C++ is dying! by smellotron · · Score: 5, Funny

      If they really are dying... I'd say only one thing:

      FINALLY!

      There is no finally! That's what destructors and the RAII idiom are for, duh.

    16. Re:C/C++ is dying! by jd · · Score: 4, Funny
      Answer to Coldfusion's longevity - MySpace.

      Ok, build crossroads at the bottom of a deep oceanic trench, bury ColdFusion as specified there along with MySpace, plate the bottom of the trench with Osmium before filling it with molten rock from the planet Mercury. You gotta take these menaces seriously.

      --
      It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    17. Re:C/C++ is dying! by ibbie · · Score: 2, Insightful

      I was surprised D was in the top 20. I did have to check if this was not a joke. D is pretty spiffy though, especially with the tango package. I'm not surprised that it's gaining in popularity.
      --
      The wise follow a damned path, for to know is to be forsaken.
    18. Re:C/C++ is dying! by billcopc · · Score: 5, Insightful

      I agree with you on Coldfusion, simply because I'm forced to work with it on a daily basis. As a longtime "real" programmer, CF is an insult to my skill and experience, but sadly I need to eat.

      Delphi though, slow down! Everyone keeps repeating how Pascal is a teaching language, yet it was my official language for many years. Back in the 90's I was developing commercial games with little more than Borland Pascal 7 and Turbo Assembler. I did the speedy bits in assembler, and the logic in Pascal. My development time was extremely short and my code was very reliable and reusable.

      When Delphi happened, well honestly the first few versions stank, but I remember writing all sorts of apps in Delphi 4 (yes, even DirectX games). Delphi today has turned into a schizophrenic marketing clusterfuck thanks to Borland/Inprise/Codegear/TrendyNameOfTheMomentInc, but I think Delphi as language is just right for a large number of situations.

      It's right in the sweet spot between useless VB and painful C, plus it compiles crazy fast and performs very respectably, given how easy it is to develop. In fact, its qualities closely resemble those of C#, only Delphi did it over 12 years ago. It's no coincidence, Microsoft hired the creator of Turbo Pascal, Anders Hejlsberg, to create C#, J++ and many key architectural features of .NET. If Borland hadn't gone mental in the mid-90s, .NET would not exist today, instead we'd have Borland's equivalent and people would be praising Delphi, just as they praise C# in today's reality. It would probably run a helluva lot faster too!

      --
      -Billco, Fnarg.com
    19. Re:C/C++ is dying! by MBGMorden · · Score: 3, Interesting

      I agree. My educational background was in C/C++ programming (command line on Unix systems) and during and immediately following school most of my hobby programming was in Borland C++ Builder. About 2 years ago I discovered PHP and went wild with that. It was fun, but that old saying started becoming true: "When all you have is a hammer, everything starts looking like a nail.".

      Web apps are nice and quick to develop, but I'm definitely starting to come back around to the idea that there is definately a place for local apps, and most certainly for fast compiled code over interpreted.

      --
      "People who think they know everything are very annoying to those of us who do."-Mark Twain
    20. Re:C/C++ is dying! by Anonymous+Brave+Guy · · Score: 2, Insightful

      Everyone benefits from not having to reload all the sidebars, etc. on a page when they click a link.

      Not if they're writing the firmware for a washing machine, the operating system for a telephone switching system, the back-end of a corporate database application, the latest FPS blockbuster, the drivers for a new Linux file system...

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    21. Re:C/C++ is dying! by CastrTroy · · Score: 4, Interesting

      Well, as a VB developer, you have to remember that when people talk about VB now, they are talking about VB.Net. Which is exactly the same as C#, with a different syntax. Comparing VB.Net to VBScript or even VB6 is like comparing Java with Javascript. VB gets a bad name because it used to be pretty bad, and there's a lot of non-programmers using it to do a lot of stuff they aren't qualified to do, and messing it up royally. But that doesn't mean VB.Net is a terrible language. I wouldn't fault PHP for all the insecure newbie websites created with PHP.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    22. Re:C/C++ is dying! by PocketPick · · Score: 4, Interesting

      I completely agree - You know why I like C or C++? Because I only need to know one thing to do 90% of everything - C or C++. In the world of web development, I must no only be proficient in an equivilant amount of libraries found on a desktop platform, but also any number of scripting languages (PHP/JavaScript/Ruby/etc), HTML/XHTML/XML/SGL/DTD/RelaxNG/XMLSchema, perhaps ColdFusion, or maybe Adobe Flex/SilverLight - And I'm probably only scrapping the complexity of this odd little world.

      Why the pain? Why not keep it simple? In spite of our advancement, it's amazing how much more practicality and common sense some software academics had 20 years ago compared to today.

      When are web standards comittees or intellectuals going to quit trying to one up each other and start consolidating some of their standardizations?

    23. Re:C/C++ is dying! by Planesdragon · · Score: 2, Interesting

      A musket isn't as useful or respectable when everyone else has M1A2s though. It is when all you've got is gunpowder and lead. The average soldier can't make bullets for his M1A2 in the field. The musketeer... can.

      Which is exactly why VB has the staying power it does.
    24. Re:C/C++ is dying! by The+Master+Control+P · · Score: 4, Funny

      I know that I'm not the only one who read that link as "Dalek Scientific."

      Which would be the most goddamn awesome name for a scientific supply company ever.

    25. Re:C/C++ is dying! by Count+Fenring · · Score: 2, Insightful

      How is a scripting language not a programmer's tool?

      And how, in that case, does PHP not have the same caveat attached, since (in capability) it resembles a sped-up but limited subset of Perl?

    26. Re:C/C++ is dying! by joggle · · Score: 4, Insightful

      It really comes down to different tools for different jobs. Having a vast number of tools at your disposal for free is not a bad thing, just get a cursory knowledge of each tool and what it's good for so that when your next project comes up you can make an informed decision on which one(s) to use.

      Also, you make it seem like only knowing the C/C++ languages is sufficient to accomplish anything. That's really not true--at a minimum you need to know the STL for C++ related stuff, some GUI library for doing graphics, an XML library for doing XML manipulation, a database library for interacting with the database of your choice, a cross-platform library to write portable code, etc. Even if you're using something that does all of that (such as Qt) you still need to learn about XML, XMLSchema and DTD if you are using those technologies (just as you would for web programming).

    27. Re:C/C++ is dying! by asc99c · · Score: 2, Insightful

      For most apps of any size, having a 'separate' GUI is no bad thing. It encourages you to simplify the back end processing and keep if efficient and easy to understand, with a limited number of hooks for a GUI to hook into.

      The stuff I write at work has multiple user interfaces possible. Little has to change to swap our Windows only C++ / Visual Studio GUI to a multi-platform web based GUI.

    28. Re:C/C++ is dying! by TapeCutter · · Score: 2, Insightful

      "Our team takes it the other direction altogether. Our engine is in C++. Our GUI is in Swing. As long as they're going to be different, may as well really make them different."

      Conceptually that's exactly how it should be, decouple the engine from the display as much as possible. Many enterprise projects learnt this lesson the hard way when they spread the engine across a multitude of MFC dialogs and widgets under Win31, many of the same enterprises are still learning the same lesson with web apps.

      --
      And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
    29. Re:C/C++ is dying! by Haeleth · · Score: 2, Informative

      $ cat > hello.java
      System.out.println("Hello world");
      $ javac hello.java
      hello.java:1: class, interface, or enum expected
      System.out.println("Hello world");
      ^
      1 error
    30. Re:C/C++ is dying! by GeckoX · · Score: 3, Interesting

      Agreed. VB.Net is not VB. Still a tad behind C# for language features, but barely. Worked in C# for the last 4 years at my last job, and dreaded having to use VB.Net at my new place of work. But now that I have been for a year, other than syntax, there's really zero difference between the two. Catch is to turn off the 'features' that let you write more vb6ish bastardized code. Make sure Option Strict and Option Explicit are on, and throwout the Microsoft.VisualBasic namespace, and you're good to go. One great benefit over it is that the 'perceived' challenge for a VB6 developer in switching to .Net is greatly removed when they can be introduced to VB.Net rather than C#. I've mentored people that would never have attempted anything in C# in moving to VB.Net with great success.

      I still prefer the syntax of C#, but that's mostly just personal preference.

      --
      No Comment.
    31. Re:C/C++ is dying! by somersault · · Score: 2, Interesting

      I think Delphi is great for a 'do anything' language - I use it basically for any non web based app requiring a GUI. I'm not sure how cross platform compatible it is as I haven't ever tried out Kylix or anything like that. I've used C/C++ for doing command line code, DLLs and OpenGL apps, but I've never actually used it for GUIs as it just looks like a royal pain in the ass compared to Delphi. For web based stuff I used to use PHP as that is what I learned at Uni, but I've moved to perl now, it's a lot more pleasant to work with, and encourages more secure practices IMO (I submitted an Ask Slashdot question about PHP security ages ago and the answers convinced me to girl Perl a go :) ). Knowing Perl will also be useful for doing any random scripting I may want to do in future too, I highly recommend it to anyone who hasn't tried it yet..

      --
      which is totally what she said
  2. Always be there by ohxten · · Score: 5, Insightful

    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.

    --
    Need an automatic screenshot taker? Try here.
    1. Re:Always be there by KlomDark · · Score: 3, Insightful

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

    2. Re:Always be there by fyngyrz · · Score: 4, Insightful

      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. ;-)

      --
      I've fallen off your lawn, and I can't get up.
    3. Re:Always be there by SanityInAnarchy · · Score: 4, Insightful

      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".

      --
      Don't thank God, thank a doctor!
    4. Re:Always be there by rishistar · · Score: 4, Funny

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

      --
      Professor Karmadillo Songs of Science
    5. Re:Always be there by afabbro · · Score: 4, Insightful

      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.

      --
      Advice: on VPS providers
    6. Re:Always be there by wkring · · Score: 5, Funny

      Cobol projects go on the Share tape.

    7. Re:Always be there by fyngyrz · · Score: 5, Insightful

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

      Yes, I understand that perfectly. I'm a huge fan of Python for that very reason.

      However, in C, writing memory management only needs to be done once; while writing the "logic for the[ir] application" is done many times. Consequently, the apparent load of writing memory management is much lighter than one might initially recognize. Or to put it another way, once it's done, it's done and represents no load at all.

      Further, there are huge advantages to having 100% control over the memory management of your application; speed advantages, fewer wasted/tied-up resources, and all the downhill consequences of those things -- if you don't waste resources, they're available for the user, or for other aspects of your programs. Likewise, if you get things done faster, more CPU is available elsewhere.

      Another thing: Depending on an external agency to manage your resources is a two-edged sword. If there are bugs in *your* code, you can fix them as fast as you are competent to do so. Considering you wrote it in the first place, the presumption that you are competent to fix it is usually on target.

      If there are bugs in an external agency, you typically get to report them... and wait, bugs happily chewing on the users of your applications, until said external agency gets around to fixing whatever it was. If indeed they ever do.

      Same thing goes for list management, etc. Write it once, learn all about it (which is interesting AND increases your Leet Skillz) and now you have a generally useful tool that is as fast as you can make it, totally amenable to fixes and updates, and invulnerable to the ass-draggery of outside influences. I have used my list management module in AI apps, ray tracers, image processing, file management, and even in dialogs to control layer types in various (what I think are) clever ways. I have huge confidence in it, but, should it turn out to be broken... I could fix it in minutes. At which point every app I've written gains ground, all my customers win, etc.

      There's something else that has always remained in the back of my mind. As languages get more sophisticated, there is a trend for them to generate much larger and much slower resulting applications. It isn't uniform, and it depends on what you're doing, compilers as compared to interpreters, etc., but the trend itself is pretty clear. For instance, a Python app seems small, until you realize that the Python interpreter is loaded for your one-liner. C++ apps tend to be huge compared to C apps. And so on.

      This trend - basically - tracks the increasing availability of memory and CPU power. Seems reasonable enough. But the funny thing is, if you take an app that was designed to run at adequate speed on hardware from, say, 1992, keep the technology behind the app the same if you update it - that is, keep writing efficient C and so on - then the increase in memory and CPU resources serve to turn the app into some kind of blistering miracle implementation instead of the run of the mill performance you get from depending on the latest and greatest HLL with garbage collection, the implicit inclusion of module after module of object-oriented processing and modeling, data hiding, etc., etc.

      Directly related to this is the fact that if you attempt a modern task - such as an image manipulation system - in a modern language, you, as the programmer, can be significantly enabled by the language; that is, you can be done sooner, and you can have a lot of things done, too, many coming along for the ride, for "free." Garbage collection / memory management being one such thing. But if you approach the task using C, which is basically capable of creating as fast an application as you are capable of writing, it is so close to assembly, while we can certainly agree up front it'll take you longer, the end result coul

      --
      I've fallen off your lawn, and I can't get up.
    8. Re:Always be there by osu-neko · · Score: 2, Insightful

      There are libraries out there available to just install and link to. But it certainly would be nice if some of this stuff got into the Standard C libs, so that all you needed was something like:

      #include <stdgcmem.h>

      ... and off you go on your merry way.

      The argument against would be that not everyone has the same needs from such a library, but it's a spurious one. Not everyone has the same needs from an I/O library, which is why there are a million alternatives to <stdio.h>, that doesn't mean you can't provide at least one standard library, and let those with other needs link to something else instead.

      --
      "Convictions are more dangerous enemies of truth than lies."
    9. Re:Always be there by Chris+Burke · · Score: 3, Insightful

      That makes C++ a lot better for application writing, but not necessarily for OS writing. The kinds of resources being managed in a kernel usually aren't the kind that are easily managed through "scope".

      One criticism of C++ is that by automatically handling the destruction of objects when they go out of scope, it can lead to a feeling of false security to programmers who assume that because their objects are destroyed, that all resources are properly freed. The possibility for leaks is quite significantly there, in the design of constructors and destructors and anything that uses a pointer. Though while not always easy, having to make no mistakes in any of your destructors for any class is a heck of a lot easier than never making a mistake on any individual object's deallocation as in C.

      By the same token, it's quite possible to have "leaks" in Java or C#, simply by having extraneous references to no-longer needed objects laying around in objects that are themselves still referenced.

      I'd still take C++ any day over C for a big application.

      --

      The enemies of Democracy are
    10. Re:Always be there by fyngyrz · · Score: 2, Insightful

      some one did that for us, so we can all use the same type of thing.

      No. They didn't. They implemented something else entirely, something that works outside the paradigm of what you're doing, attempting to track memory use by indirect means (such as counting references.) And this is precisely the problem with such memory management; by taking the programmer out of the management loop and abstracting it into irrelevance, the programmer no longer has either the means or the incentive to keep tight control of resources. The mindset leads to thinking nothing of bringing the entire Python interpreter into memory in order to evaluate a line or two of trivial logic, because its trivially easy to do. Consequently, huge system loads are incurred for relatively small tasks. Write that same logic in C, and you have a dedicated executable that (a) is tiny by comparison, (b) runs orders of magnitude faster, (c) you actually understand on every level. Presuming you don't drag in some huge library you didn't really need or do a really bad job. :-)

      Don't get me wrong - I am *not* a Python hater, in fact, it is one of my favorite languages. But I don't use it for everything just because it is easy. I always think about resources used, whose resources they are, whether I have the implicit right to consume them if I don't have to, and if I do have such a right, do I *want* to consume them? After all, they may be mine, and if I'm trying to do something else, some interpreter clumping around in the background consuming large chunks of resources may not be in my best interests. If it is true for me, it's probably true for my customers, so in the end, I have to do the same evaluation for them as well.

      --
      I've fallen off your lawn, and I can't get up.
    11. Re:Always be there by jsebrech · · Score: 4, Insightful

      But if you approach the task using C, which is basically capable of creating as fast an application as you are capable of writing, it is so close to assembly, while we can certainly agree up front it'll take you longer, the end result could be a lot faster and a lot more capable of efficiently managing the user's resources than that which you might create using a modern HLL.

      Agreed 100 percent. If you write it in C, you can make it run faster with lower resources, but you will spend a lot more time creating, debugging and maintaining it.

      Most software simply doesn't need to be that fast. The performance sensitive pieces of code are in database queries (C code), or disk operations (C code), or math operations (C code). Modern garbage collectors also are proven, they're fast, they're reliable. It doesn't make sense for the majority of classes of software, from a cost vs. gain perspective, to use C for the job.

    12. Re:Always be there by fyngyrz · · Score: 3, Interesting

      ...but you will spend a lot more time creating, debugging and maintaining it.

      Hmm. Creating, probably so. You're writing smaller steps on a per-keystroke basis, so it's pretty much a given.

      Debugging and maintaining, however, are issues more predicated upon design skills than the language used. From things entirely outside the code's executing domain (like comments and other documentation) to things inside (structures and algorithms), correctness (from which depends debugging), reliability (from which depends maintainance) and completeness / applicability (from which also depend maintainance), all these things are independent of the language, except in very minor and essentially irrelevant ways.

      I would argue that coding in an HLL does not improve these latter things. However, coding in C brings you extremely close to both the problem(s), and the solution(s) you decide to implement without taking you that last troublesome step down into assembler, where you lose platform independence. I think that is a uniformly positive set of consequences to enjoy as a result of spending that extra time.

      It doesn't make sense for the majority of classes of software, from a cost vs. gain perspective, to use C for the job.

      Well, we'll have to agree to disagree here. Wasting resources can have unpredictably large effects, such as pushing a system over the edge between running in memory and beginning to swap. The more you waste, the more likely you are to cause such problems.

      The fact is, running the user out of resources for no reason other than saving small amounts of my time up front is outside the bounds I am willing to go. The gains at the user's end, especially when multiplied by many users across many invocations, are likely to be substantial. Consequently, the investment on my end is almost certain to be small by comparison, even if it is actually many of my hours.

      As a user, I run into this all the time. If I start a certain application, it typically takes quite some time to start. It's the "industry standard", but frankly, it runs like a pig in hip deep dung on every startup. And it eats memory like crazy, even the executable is 4x larger than other apps that do the same thing, but which -- notably -- aren't the "industry standard." So I make the choice, as a user, to use the other apps for all tasks that are achievable either way (and as it turns out, I *very* rarely have to start the industry standard program.) I want my memory to be used for data, not for a bloated application; and I want my time used in working on that data, not waiting to count and register every plugin or aux feature in the system every time the application starts.

      The problem is that from the programmer's perspective, "time and effort" are not even slightly the same as they are from the user's perspective. For my part, I consider it an ethical "must-do" to consider the user's perspective as the primary one driving the design. Both from the viewpoint that their resources are not "mine to waste" just because they have extended me the courtesy of allowing my software to run in their machine, but also from the viewpoint that any supposedly "extra" time I spend, I spend once; any time I cost the users unnecessarily, I extract that cost from every user, and every time the software is run.

      --
      I've fallen off your lawn, and I can't get up.
    13. Re:Always be there by Zironic · · Score: 2, Funny

      Are you trying to claim that the authors of the MenuetOS are in their right minds?

    14. Re:Always be there by Namlak · · Score: 3, Insightful

      It seems logical that the best approach is to write the speed critical portions in C and the (G)UI in a HLL - each is best suited for the task.

      As a VB.NET programmer building business automation apps for a living, I can't imagine building a (G)UI in a LLL. Not that I wouldn't appreciate the exercise, but the demands of the business environment won't allow it. Not just for the initial build but for the inevitable stream of change requests that will follow. Drag/Drop/Done is the name of the game.

      But as a hobbyist microcontroller programmer, well, there's no such thing as bloat in that space - you can't do it!

      If I was writing some image manipulation software, all the actual processing would most certainly be in C if not straight assembly for the very most critical parts. But the Load/Save/View/whatever parts, I'll do in VB!

    15. Re:Always be there by lena_10326 · · Score: 4, Insightful

      However, in C, writing memory management only needs to be done once; while writing the "logic for the[ir] application" is done many times. Consequently, the apparent load of writing memory management is much lighter than one might initially recognize. Or to put it another way, once it's done, it's done and represents no load at all.
      I don't believe that is true at all. One huge reason for building a memory management scheme is to tailor it to a specific algorithm, which is bound to a particular application. Optimization for allocating small chunks (bytes to kilobytes) can be very different compared to allocating extremely large chunks (megabytes to gigabytes), or variable sized versus fixed size, or read/writes with sequential access versus random access, or low access frequency versus high access frequency, or multi-threaded versus serial. These are all intricately bound to the overall application algorithm and can yield extremely different solutions given a particular problem. It's simply not possible to write a general allocation scheme that is fully optimized for every type of problem. I've experienced this in real world projects.

      Another thing: Depending on an external agency to manage your resources is a two-edged sword. If there are bugs in *your* code, you can fix them as fast as you are competent to do so. Considering you wrote it in the first place, the presumption that you are competent to fix it is usually on target.
      It's rare that the original developer stays on the project for its lifetime of usage. In fact, I've never seen that happen. People quit, get fired, get promoted, or move onto new projects. When the sole hot-shot in the organization writes a complex codebase, it places a future burden on the lesser experienced team that may inherit it. Maintenance is always more expensive than original development.

      If there are bugs in *your* code, you can fix them as fast as you are competent to do so. Considering you wrote it in the first place, the presumption that you are competent to fix it is usually on target... [CUT]... I have huge confidence in it, but, should it turn out to be broken... I could fix it in minutes
      I don't believe that for a second. I've seen sneaky bugs in C code plague development teams for days and on a few occasions a week. You're either vastly underestimating or are totally unaware of very well hidden bugs in your code.

      But the funny thing is, if you take an app that was designed to run at adequate speed on hardware from, say, 1992, keep the technology behind the app the same if you update it - that is, keep writing efficient C and so on - then the increase in memory and CPU resources serve to turn the app into some kind of blistering miracle implementation instead of the run of the mill performance you get from depending on the latest and greatest HLL with garbage collection
      99+% of the time with general problems, I/O is the bottleneck. For those cases, a C application might run 1% faster on newer hardware, given equivalent I/O hardware (same model/make of drive or network). In the vast majority of cases, the effort is simply not worth it. It's far more expensive to pay your salary to build and maintain that codebase than it is to simply purchase a beefier machine. The former is a repeating expense, the latter is a one time expense. Business managers love the latter, not the former.

      I do agree that if your domain consists of highly CPU bound computational algorithms that don't require frequent HD or network access, then your approach will scale well with the faster hardware.; however, I don't think advocating it as a baseline approach for all or most projects makes any sense. It is far more work and causes more maintenance headaches than you're describing.
      --
      Camping on quad since 1996.
    16. Re:Always be there by smellotron · · Score: 2, Interesting

      Write a quick five-liner in python, it might take 100ms to run. Spend a few hours writing equivalent code in C, it might take 10ms to run. Scale this up to million-line (in C code) applications.

      To give you some perspective, I did perform an experiment along these lines. I wrote a Python script to measure the entropy, cross entropy, and KL-divergence of words in a text file with some basic smoothing models applied. It was about 250 lines of code. I rewrote it in C++ mostly out of curiosity. My naive implementation was about 10% more code, and ran at about the same speed (mostly it's disk I/O and comparing std::map<std::string,int> to Dict()). I spent a bit more effort and ended up with a 450-line solution using better data structures. The end result (as I look back and run timings) is that it's about 8 times faster when examining a 12k file.

      If I didn't already have the design figured out in Python, it would have taken much longer to write the C++ solution... but having a prototype right there really helped. For performance-critical code (like performing anything more complex than O(n) on a large dataset), it was definitely worth it to spend the extra time on a better implementation. Honestly, the biggest benefit was using both languages in order to end up with a good design and a good implementation in a reasonable amount of time.

      If you're interested, I can provide the source for comparison (I just don't want to put up a public link to my private svn repo).

    17. Re:Always be there by pclminion · · Score: 2, Interesting

      Wow. I thought I was reading one of my own posts. I also use Python as a prototyping language for projects which will ultimately be done in C++, and I do it with exactly the same kinds of problems you are solving: statistical NLP.

      I've found that most NLP algorithms are easily expressed in Python, but it is too slow to apply to realistic corpora. On the other hand, Python can easily translate to C++ (once you've built up some experience and the kit to go along with it) and the time it takes to write Python + C++ probably ends up shorter than trying to begin right away in C++.

    18. Re:Always be there by MichaelSmith · · Score: 2, Insightful

      Believe me I have done my share of machine code and assembly programming in my time and I understand exactly what the people on this project have achieved.

      Good on them, but I believe the right tool should be used for the job. Many very high level tools such as UML get overused these days. Thats a shame and it is good that people are working to keep their assembler skills alive.

    19. Re:Always be there by Carewolf · · Score: 3, Interesting

      C/C++ might give you 1% CPU speed-up, but by fine-tuning the memory allocations, the block allocations on the disk and the way you communicate with the I/O devices it can give you a speed-up on I/O operations that is not available in any of the modern toy languages.

    20. Re:Always be there by cmburns69 · · Score: 2, Interesting

      This is an interesting discussion for me because I've experienced the whole thing in real life. My cousin has run a large, free, web-statistics tracking site. When he started it, it was running on PHP+apache-- He was just to the point when he was able to start making money off it, and I gave him some bad advice. I told him that if he was having performance issues, he should re-engineer the entire thing himself.

      After 2 years building a web-server from scratch, he's in beta now. But during those 2 years that he wasn't improving (or maintaining) the existing code base, he lost all his thousands of free customers. He has no regrets, and his code behind it is awesome! It's fast, efficient, and modular. As far as code is concerned, it's like Michelangelo's David. From a purely coding perspective, it was the right decision. From a business perspective, it was a very poor decision. He could have a thriving business right now, but unfortunately for him, all he has now are a few prospective customers in beta.

      I (on the other hand) have built a technology to enable certain kinds of web-apps for my personal site. It's in java so it's slower, and eats memory a bit. I could spend a year or 2 re-writing it in C, and know for certain there were no memory or performance issues. But that's not worth it to me. I can start getting paying customers now. From a business perspective it's more than enough. As my business grows, I simply need to upgrade my hardware.

      My cousin spent a total of 3 man-years getting to where he is now (1 year for the original code-base, and 2 years for the current code-base). I've spent 1 man year for my current code-base. Assuming our time is worth only $30/hr, and that these part time, off hours man years are only 500 hours each, his cost was $60k more than mine was. I can buy a lot of hardware with that difference, and I'm collecting money at the same time.

      From a coding perspective, it makes sense to spend an infinite amount of time to make your code-base perfect. In the real world, the right language is often what is most practical.

      Note: This post was heavily influenced by Joel Spolsky's article Things you should never do

      --
      Online Starcraft RPG? At
      Dietary fiber is like asynchronous IO-- Non-blocking!
  3. Visual Basic at #3? by eldavojohn · · Score: 5, Funny
    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?
    --
    My work here is dung.
    1. Re:Visual Basic at #3? by kitgerrits · · Score: 3, Informative


      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...

      --
      "I was in love with a beautiful blonde once, dear. She drove me to drink. It's the one thing I am indebted to her for."
    2. Re:Visual Basic at #3? by Hoplite3 · · Score: 5, Funny

      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.

      --
      Use the Firehose to mod down Second Life stories!
    3. Re:Visual Basic at #3? by thermian · · Score: 4, Insightful

      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.

      --
      A learning experience is one of those things that say, 'You know that thing you just did? Don't do that.' - D. Adams
    4. Re:Visual Basic at #3? by Chris+Burke · · Score: 2, Funny

      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.

      --

      The enemies of Democracy are
    5. Re:Visual Basic at #3? by SatanicPuppy · · Score: 3, Informative

      The methodology page is here.

      I don't know. A lot of it depends on what applications businesses are using; a few big companies pushing large Delphi projects could make a big difference.

      I think Javascript is also hampered by the fact that there aren't all that many different apps, and that a lot of people do view it as a semi-essential skill, so it gets less play. You don't see HTML up there anywhere.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    6. Re:Visual Basic at #3? by VGPowerlord · · Score: 2, Funny

      Elton John is a werewolf?!

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    7. Re:Visual Basic at #3? by kitgerrits · · Score: 3, Insightful

      Shows what I know about PowerShell...
      Being a UN*X admin and a reasonably-competent scripter, I tried looking into it and my brain had trouble grasping how this is supposed to be a shell.

      From what I can see, Bourne and other UN*X shells are stream-oriented and PS seems object-oriented.
      I see LDAP as a flat text-based database with Organizational Units, not as a magical forest with trees, domains and groups.

      This is, most likely, because UN*X admins are used to modifying and/or generating configuration files,
          whilst Windows admins have spent the last 13 years ticking tickboxes and, lately, dragging objects.

      (does knowing win.ini and system.ini make me l33t or simply a dinosaur? I fled the Windows scene when 2003 came out...)

      --
      "I was in love with a beautiful blonde once, dear. She drove me to drink. It's the one thing I am indebted to her for."
    8. Re:Visual Basic at #3? by metamatic · · Score: 2, Funny

      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 [...]

      And Heather Mills has no left leg problems, right?
      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    9. Re:Visual Basic at #3? by Jugalator · · Score: 2, Informative

      This might have something to do with this PowerShell thing: ccontrolling the O/S through the use of VB scripts. Please correct me if I'm wrong, but isn't VBScript (or JScript at the user's choice) used for the Windows Script Host whereas PowerShell uses its own scripting language that integrates with the .NET platform?

      You can also write "cmdlets" for PowerShell in any .NET language such as C# or Visual Basic, but that's seems more about writing commands for the shell than writing shell scripts.
      --
      Beware: In C++, your friends can see your privates!
    10. Re:Visual Basic at #3? by ajs · · Score: 2, Interesting

      1. The Web is 90% noise
      2. 99% of statistics are lies
      3. This is a case of statistics based on the Web

      Thus we have a 99.9% certainty that this article is a noisy lie.

  4. Managed code is the way to go by KlomDark · · Score: 4, Interesting

    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.

    1. Re:Managed code is the way to go by QuantumG · · Score: 2, Interesting

      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.

      --
      How we know is more important than what we know.
    2. Re:Managed code is the way to go by pclminion · · Score: 5, Insightful

      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.

    3. Re:Managed code is the way to go by sconeu · · Score: 2, Informative

      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).

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    4. Re:Managed code is the way to go by Anonymous Coward · · Score: 2, Insightful

      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.

    5. Re:Managed code is the way to go by PhrostyMcByte · · Score: 3, Insightful

      Garbage collection is surely a factor in them losing ground, but I think the main reason is simple: library support.

      Java and .NET have huge well-designed frameworks behind them. You can get things done really fast. What does C have? A bunch of separate libraries all with different conventions. C++ is a little better with a more useful standard library and Boost, but it still doesn't have anywhere near the infrastructure Java and .NET have.

    6. Re:Managed code is the way to go by Yokaze · · Score: 2, Insightful

      That is hardly a conceptual problem of the language C++, but more one of the toolchain and/or ABI, and can be improved on by rewriting the old GNU linker in C++ :). And maybe someday the GNU binutils will gain incremental linking.

      More critical is that the grammar of C++ is undecidable.

      --
      "Between strong and weak, between rich and poor [...], it is freedom which oppresses and the law which sets free"
    7. Re:Managed code is the way to go by Chris+Burke · · Score: 2, Funny

      That was a rhetorical question, by the way. Of course, because we both know the answer is emacs.

      --

      The enemies of Democracy are
    8. Re:Managed code is the way to go by Kevin+Stevens · · Score: 3, Insightful

      If you use the facilities provided by the STL and BOOST (most notably shared_ptr), C++ is not a whole lot different than Java these days. Java went a little too far in my opinion on being nice to the programmers while giving up performance. Modern C++ hits the sweet spot in my opinion.

      If only the standards committee could get off its arse and progress as quickly as BOOST does....

    9. Re:Managed code is the way to go by jrumney · · Score: 2, Informative

      In java I can create two objects which point to each other, but with nothing else pointing to each object, and that memory will be lost for ever, but the garbage collector won't free them because it works by counting references.

      Nonsense. GC in Java has never worked by counting references, and bugs due to circular references have been a thing of the past since Java 1.3 or so. Perhaps you're thinking of some of the psuedo garbage collection libraries available for C++.

  5. so what? by rastoboy29 · · Score: 2, Interesting

    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.

    1. Re:so what? by dreamchaser · · Score: 4, Insightful

      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.

    2. Re:so what? by moderatorrater · · Score: 2, Insightful

      The first thing I thought of when I read the summary was 'lazy coders' when garbage collection was cited as a driving factor While I somewhat agree with you, there are two things that I think you're overlooking. First, there are going to be bad programmers no matter what you do. Someone can sound good in an interview and turn out to be awful. Until everyone realizes that and comes to the decision that the programmer in question should be fired, they're introducing code to the system. Or, even worse, they're not bad enough to fire, but bad enough that it could be a problem. These people will always be there, so you have to try and work around them.

      Second, everyone makes mistakes. I don't care who you are, if you write 1 million lines of code, there's going to be a bug in there somewhere. Given enough bugs, there's going to be one you don't catch. Garbage collection takes away a class of bug and makes it so that even the very good programmers can write more stable code.

      There's a lot to be said for programmers getting taught better and applying those principles better, but in the end, taking away a class of bugs is going to be useful in the long run. Even with garbage collection it's possible to run into memory management problems, but it's a lot harder.
  6. Dying...not hardly by PalmKiller · · Score: 4, Insightful

    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.

  7. What about desktop presence? by Noodles · · Score: 4, Insightful

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

  8. Wow by ucblockhead · · Score: 2, Funny
    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.

    --
    The cake is a pie
  9. For performance-critical code there is no choice by SilentTristero · · Score: 4, Insightful

    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.

  10. Incompetence... by HetMes · · Score: 2, Interesting

    ...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.

  11. That's a broken way to think of it by krog · · Score: 5, Insightful

    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++.

    1. Re:That's a broken way to think of it by SatanicPuppy · · Score: 4, Insightful

      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.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    2. Re:That's a broken way to think of it by Sloppy · · Score: 4, Insightful

      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.

      Whatever it is, its compiler and low-level libraries will be written in C.

      --
      As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
    3. Re:That's a broken way to think of it by wmshub · · Score: 5, Informative

      Duh.

      I think the parent was implying that C often directly maps into assembly language, and he's right. As an embedded programmer, one of the benefits of C is that, other than register selection, I can often tell you exactly what assembly statements will be emitted by a chunk of C code. Often I do use C as a shorthand for assembly.

      Nobody who knows the term "assembly language" will think that C is one. But it's a lot closer than you might think.

    4. Re:That's a broken way to think of it by lgw · · Score: 4, Insightful

      As someone who programmed in assembly for 5 yeas professionally, let me say: C is a crappy assembly language. It has a crappy macro language, and I'm often left guessing what the compiler will do with my C code, especially on an unfamiliar platform.

      Is an int 32 or 64 bits? I had better compile a test program and fire up a debugger to find out. OK, since there's no C standard type for "32 bit int", what works on this compiler? Maybe INT32 is defined somewhere?

      And don't get me started on implicit conversion.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    5. Re:That's a broken way to think of it by Schraegstrichpunkt · · Score: 5, Informative

      OK, since there's no C standard type for "32 bit int", what works on this compiler?

      C99 fixed that: #include <stdint.h>, then use either uint32_t or int32_t.

    6. Re:That's a broken way to think of it by Nursie · · Score: 5, Insightful

      Jesus christ there's another one....

      C has been doing multi process for decades, and multi thread for a decade or more.

      It's used in commercial apps all over the world.

      How many times - threads and parallelism have been with us for years. Just because games haven't been threaded doesn't mean the rest of the world hasn't been doing it, and doing it well for a long time

      Look up pthreads sometime.

      Seriously, threaded processing in C is damn simple.

    7. Re:That's a broken way to think of it by xenocide2 · · Score: 2, Funny

      Ah, well there's no use trying to use C++ as an embedded language / assembler. One look at template inheritance and you shall melt like the Nazi's in Indiana Jones.

      --
      I Browse at +4 Flamebait

      Open Source Sysadmin

    8. Re:That's a broken way to think of it by TheRaven64 · · Score: 2, Informative
      Why? The Java compiler is written in Java, most Lisp compilers are written in Lisp and Smalltalk compilers are written in Smalltalk. I believe most ML and Haskell compilers are also written in their target languages. It's very rare to find a compiler that can't compile itself - this is one of the common tests of an implementation.

      As to low-level libraries, again, why? There are operating systems written in high-level languages, apart from a tiny bit of machine-specific assembly language they are written in assembly. Something like SqueakNOS has assembly code to install the interrupt handlers and then everything above that is written in Smalltalk. No C anywhere.

      --
      I am TheRaven on Soylent News
  12. C and C++ might die at different rates. by jythie · · Score: 5, Insightful

    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.

  13. Statistics by Anonymous Coward · · Score: 5, Insightful

    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.

    1. Re:Statistics by Anonymous Coward · · Score: 2, Insightful


      I absolutely agree. We have a disease in our industry, and it's that fast and cheap with under-experienced under-trained people is the way to go. There's a reason why OS's are not coded in concepts like Java - any programming language that needs to pause to "clean up after itself" needs some serious damn help - please code, audit your code properly instead of writing yet another piece of code because you refuse to properly #def, #undef and manage how you use memory.

      I'm sick and tired of the "Javoids" hanging up my web browsing, and fouling up real-time delivery on my trading floors. We are burning up serious quantities of electricity, and creating serious amounts of heat and feeding a bloated marketplace with this kind of inefficiency. We don't need faster processors, we need better code. You can make money with excellence - you just have to try instead of taking the easy road every time. Cray made a fortune being brilliant and keeping true to his engineering principles. Microsoft made billions by placing a pillow over the head of any and every innovation anyone with two brain cells in Redmond could think of would threaten their bloatware.

      Somewhere along the line the craftspeople left the building because IT managers were replaced with "Executrons" - these mindless folks who actually get compensated bonus for how much they "save" by cutting costs in IT - that's letting the fox in the hen-house. Thanks to this idiocracy, we now teach people not programming, but how to use Microsoft & Sun products in college for CS101, and to find any worthwhile thinking in a candidate I need to look for people from a foreign country.

      Thanks, Sun. Thanks, Microsoft. How about some real damn innovation, please, instead of these statistical analysis that make the status quo seem palatable.

    2. Re:Statistics by jim3e8 · · Score: 2, Insightful

      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?


      Forth is interpreted.
  14. Re:not so.. by ArcherB · · Score: 4, Insightful

    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.
    --
    There is no "I disagree" mod for a reason. Flamebait, Troll, and Overrated are not substitutes.
  15. Re:not so.. by Anonymous Coward · · Score: 4, Funny

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

  16. Different markets - different requirements by ThePhilips · · Score: 4, Interesting

    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.

    --
    All hope abandon ye who enter here.
    1. Re:Different markets - different requirements by krog · · Score: 3, Informative

      Just a note -- Ericsson developed the Erlang 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.

  17. There are two kinds of coders... by Froze · · Score: 3, Insightful

    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.

    --
    -- The morphemes of your disquisition are ascertainable, but they have eschewed an ambit of transpicuous exposition.
    1. Re:There are two kinds of coders... by oodaloop · · Score: 2, Informative

      OK, kidding aside.
      I thought the joke went: There are 10 kinds of coders...
      --
      Tic-Tac-Toe, Global Thermonuclear War, and relationships all have the same winning move.
  18. Re:C++ is as good as C# _if_ used correctly. by pclminion · · Score: 5, Insightful

    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.

  19. Fortran! by frogzilla · · Score: 4, Informative

    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.

    1. Re:Fortran! by Digi-John · · Score: 2, Funny

      FORTRAN is fast as hell and lots of scientists know it already, so yeah, it's still got a lot of use over here in scientific computing. Software packages like LINPACK have been tweaked for decades to get really high performance. The thing is, people in scientific computing are less likely to sit around blogging and posting on /. (I'm an exception, it seems) so their languages (FORTRAN and C, maybe some C++) don't get as much coverage as stuff like Ruby on Rails where you get 5 million postings on Digg every day from some web-tard who just figured out how to make his blog even more disgusting.

      --
      Klingon programs don't timeshare, they battle for supremacy.
  20. The lower levels will always be there by CustomDesigned · · Score: 2, Insightful

    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.

  21. Absolutely by DoofusOfDeath · · Score: 5, Funny

    Are C and C++ Losing Ground?

    Yes, but on the bright side, they lose ground about 1.5x faster than Java in most applications.

  22. We've replaced C/C++ with Python wherever possible by Sarusa · · Score: 5, Interesting

    We have certainly replaced C/C++ with Python wherever we can. This is about 90% of our software. Except where C is absolutely needed (which is mostly just in our kernel/device driver stuff), the 10x faster Python development and far easier code maintenance just outweighs everything else. That the Python is much less prone to crashing for programs beyond tiny one-offs is another big positive (yes, yes, if you write perfect C/C++ and don't use glib you'll never crash either, but in practice this never happens).

    In practice the speed difference doesn't matter for almost every application we've run into - we have a high speed network load tester in Python, which sounds ridiculous, but it works and it makes it insanely easier to add new tests or behaviors. If we ever hit a bottleneck, we just write a small C extension module and call that from the Python.

    I'm saying Python here, but insert your higher level language of choice.

  23. bandwagonism by epine · · Score: 5, Insightful

    I wouldn't say C or C++ is losing ground. They both continue to serve well in the niches they established.

    Meanwhile, other segments of the pie are expanding, and few of these new applications are coded in C or C++. Does that mean C and C++ are losing ground?

    There is no language out there that serves as a better C than C, or a better C++ than C++. The people who carp about C++ reject the C++ agenda, which is not to achieve supreme enlightenment, but to cope with any ugly reality you throw at it, across any scale of implementation.

    For those who wish to gaze toward enlightenment, there is always Java. Enlightenment is on the other side of a thick, protective window, but my isn't the view pretty? I've yet to encounter an "enlightened" language that offers a doorway rather than a window seat. I would be first in line if the hatch ever opened.

    The problem with C/C++ has long been that the number of programming projects far exceeds the number of people who have the particular aptitudes that C/C++ demand: those of us who don't need (or wish) to be protected from ourselves (or the guy programming next to us).

    It's not economically practical to force programmers who don't have that temperament to begin with to fight a losing battle with self-imposed coding invariants. I'm glad these people have other language choices where they can thrive within the scope of their particular gifts. I don't feel my role is diminished by their successes.

    For those of us who have gone to the trouble to cultivate hardcore program correctness skills, none of the supposed problems in the design of C or C++ are progress limiting factors, not within the zone of applications that demand a hardcore attitude toward program correctness.

    It's the natural order of things that hardcore niches are soon vacated by those unsuited to thrive there, leaving behind a critical core of people who specialize in deep-down nastiness.

    For example, it's not just anyone who maintains a root DNS server. I can say with some assurance that the person who does so did not earn his (or her) grey hairs by worrying about whether the implementation language supported automatic GC.

    Let's take a metaphor from the security sector. Ten years ago, a perimeter firewall was considered a good security measure. This measure alone eliminated 99% of TCP/IP based remote exploits.

    These days, most exploits are tunneled through http, or maybe I'm behind the times, and the true threat is now regarded to be some protocol tunneled within http.

    Then some genius comes along and says "in the security sector, TCP/IP defenses are losing ground". Quoi? Actually, no one is out there dismantling their TCP/IP based perimeter firewall. It's continuing to do the same essential job as ever.

    It's only the bandwagon that has picked up and moved camp. Yes, garbage collection and deep packet inspection are now all the rage. So it goes.

    Why not go around saying that sexual reproduction is all the rage these days? Would that imply we could eliminate all the organisms that reproduce asexually, and the earth's ecology would continue to function? Hardly.

    These new languages are soaking up much of the new code burden because these language are freed from having to cope with the nastiness at the extremes (small and large) that C/C++ have already taken care of.

    I would almost say that defines a success criteria for a programming language: if it removes enough nastiness from the application space, that the next language that comes along is free to function on a higher plane of convenience. C/C++ have both earned their stripes. Which of these new languages will achieve as much?

  24. Re:For performance-critical code there is no choic by jameson · · Score: 4, Insightful

    Hi,

    Yes, some things need to be done in assembly or C in order to `stay competetive' or even just to remain within the realm of the possible. How much that is depends on your application and your platform.

    So, systems programmers, you need not worry, your skills are always going to be needed for something.

    But let's be honest here, 80% of the applications you can code entirely in Haskell or Prolog or Python or whatever fancy high-level language you may personally have come to love. And of the remaining 20%, you can usually still code 80% of the application in your favourite language and optimise the core 20% in C. (After profiling. Let me repeat that, AFTER profiling.)

    Will it run faster and in less memory if you do it all in C? If you do it properly, sure. But that's not the question to ask. If you work commercially, ask for `what will be most profitable in the long run, while remaining ethical'. If you work free software projects, ask for `what will benefit people the most'.

    Don't confuse the above questions with `what will satisfy my C(++) hacker ego the most'. And remember that it's not just about getting the code working and making it fast, it's about making the code robust; and in many cases it's also about making the code readable for whoever will maintain it after you.

    Apologies for this rant; feel free to mod it down if you so desire, but you, dear fellow programmers, have had it coming for quite a while, as did I.

  25. So what? by menace3society · · Score: 5, Insightful

    FORTRAN, Lisp, and Cobol have all lost ground. BASIC and Pascal used to be the big dogs instead of also-rans, and if Ada ever had any ground in the first place, it lost that.

    Even Perl isn't as popular as it used to be, now that other languages have started to fill its niche.

    Times change, and it should be unsurprising that the dominant programming languages change along with it. Some day, Java, PHP, Visual Basic, Python, and Ruby will all be obsolescent as well. Thirty years ago, computers were vastly different than they are now. In another thirty years, there will have been another quantum leap (intended) in computing. Why should the languages we program them with remain the same?

  26. That's what's missing from my angry-old-man rants! by roystgnr · · Score: 4, Interesting

    Who's going to bother listening to my "back in my day, we programmed uphill in the snow both ways" stories when I don't even bother to use a monospaced font!

    And before I started up my 80x25 terminal window, I tied an onion to my belt, which was the style at the time.

    Yeah. Much better.

  27. Re:not so.. by gangien · · Score: 4, Insightful

    I wouldn't be so sure.

  28. Re:not so.. by peragrin · · Score: 2, Interesting

    I hate to say so, but MSFT's Singularity and now others(including Open Source versions) are doing a core OS in C# and .NET. It is something innovated from MSFT.

    It will take time, but it's well within the foreseeable future.

    --
    i thought once I was found, but it was only a dream.
  29. Yes it is by Weaselmancer · · Score: 3, Insightful

    It's just slightly higher level. A C compiler outputs assembly code - that's the whole point of a C compiler. Think of C as the worlds greatest macro processor for assembly.

    That's why most compilers have some sort of ASM pragma - so you can inject your assembly into the code if you feel the compiler is doing a poor job of it.

    That's also why you'll never find a faster language. And that's why it'll never go away.

    --
    Weaselmancer
    rediculous.
    1. Re:Yes it is by Weaselmancer · · Score: 5, Funny

      Best laugh of the day - thank you. =)

      Hey, you've given me an idea though. You know what would be even faster? Now...don't stop me until you hear me out, okay?

      If Java is faster than C, we should rewrite the Java VM...in Java! Interpreted code running in an interpreter...that is *also* interpreted!

      Just think of the speed increase! It would be like using uranium to fuel the space shuttle! Awesome multiplied by awesome.

      --
      Weaselmancer
      rediculous.
    2. Re:Yes it is by MichaelSmith · · Score: 2

      Lately I have been working on little applications for myself which I release under a GPL. They are not much: a front end for my GPS, an educational game/toy for my son.

      So far it has all been in java but then I read another article about the apple Lisa and decided to write a document oriented desktop for my eeePC.

      Wanting it to be blindingly fast I started working in C with XLib and Xt calls. It is coming along nicely but the graphics are horribly slow compared to what I could do in Java. I think part of the reason is I am drawing icons as xpm images. A project I work on in my day job uses a font for drawing icons instead.

      Overall it is no faster than java and the java graphics API's seem to contain workarounds for bugs in X.

      I love working in C. It has been a great experience but the JIT based runtime seems to deliver results which a simple compiler can not.

    3. Re:Yes it is by gstamp · · Score: 2, Informative

      >If Java is faster than C, we should rewrite the Java VM...in Java!  Interpreted
      >code running in an interpreter...that is *also* interpreted!

      >Just think of the speed increase!  It would be like using uranium to fuel the
      >space shuttle!  Awesome <i>multiplied by awesome.

      Been done.

      http://jikesrvm.org/

      You do know that Java hasn't been interpreted for a long long time right?

      Hotspot JIT compilers are pretty cool. You should check them out sometime.

    4. Re:Yes it is by enos · · Score: 2, Informative
      Most of the JVM is written in Java. Only a small bit to bootstrap things is written in C. The compiler (bytecode->native), garbage collector(s) (you can write your own, btw), class loader, class verifier, etc, are written in Java.

      C isn't faster than Java, of course, unless your program finishes before the JVM's overhead can be amortized. Anything that needs a long time to run will probably be faster in Java.

      --
      boldly going forward, 'cause we can't find reverse
  30. C++ - as garbage collected as you wanna be by SpinyNorman · · Score: 2, Interesting

    There's nothing to stop you from exclusively using reference-counted smart pointers and garbage collection in C++, for some or all of a project, if that's really your thing.

    For me, C++ destructors (each object responsibe for it's own storage) remove most of the hassle of freeing storage, and I've never hankered after garbage collection.

  31. Hammers and screwdrivers by Weaselmancer · · Score: 4, Insightful

    I haven't written a line of code in C or C++ since I started with C#

    That says nothing about those languages. All that says anything about is your job.

    I write drivers, so I could make the opposite statement. Doesn't say anything about the relative merits of one language versus another though. All it says is that I'm in an environment where C makes more sense.

    In summary: A hammer is best when your problem is a nail, and a screwdriver is best when your problem is a screw.

    --
    Weaselmancer
    rediculous.
    1. Re:Hammers and screwdrivers by Chris+Burke · · Score: 4, Funny

      In summary: A hammer is best when your problem is a nail, and a screwdriver is best when your problem is a screw.

      I also find screwdrivers to be a very good solution when my problem is sobriety, and maybe Vitamin C deficiency.

      --

      The enemies of Democracy are
  32. Anecdotal experience by raw-sewage · · Score: 2, Interesting

    I've been in the "real world" for about six years now, after graduating with a computer science degree. I'm currently in Chicago, Illinois, USA. I've spent the past several months looking for a good software engineering job, both in the Chicago and Milwaukee (Wisconsin) areas. Just from this experience, my take is that Java and C#/.NET technologies are hottest right now.

    My first job was using C and C++. This was partly due to historical reasons (the application was about 12 years old), but also because the API for the platform was only in C. Shortly before I came in, and during my tenure there, we were trying to move more towards C++ and build a more object-oriented framework. My current position is at a high-frequency trading firm. All our software is custom and mostly C++ (some C here and there, and a handful of Perl to glue things together).

    So based on this experience, when I was looking for a job, I was focusing on C/C++ positions. What I found is that there aren't a lot of people looking for C/C++ developers. In Milwaukee, virtually all of the demand for C/C++ programmers was for embedded systems. In Chicago, there was little demand for experience in those languages outside of embedded systems and the finance industry (which I was/am trying to get out of!).

    This is just my casual observation of a relatively small portion of the software engineer landscape as a whole.

    On top of a diminishing demand for C/C++ programmers, I found that quite a few companies who were looking for Java/C# programmers wouldn't even consider C/C++ people. The languages aren't all that different, and the concepts should definitely be portable. I think knowing concepts, understanding programming ideas/patterns, problem solving, etc, are more important that knowing the specifics of a particular language. Shrug.

  33. Speed of light limits Internet speeds by tepples · · Score: 3, Insightful

    when we have internet that is as fast as cpu response times Unlikely. Even hard drives are faster than routing a ping from London to Tokyo and back.
  34. Re:That's what's missing from my angry-old-man ran by Jehosephat2k · · Score: 2, Funny

    All you young bucks, let me tell you somethig. Back in the good ol' days when I was a programmer, we didn't have all these fancy "windows" and "icons". All we had were 1's and 0's. And sometimes we didn't have any 1's. Once I wrote a database using only 0's. And we liked it.

  35. Re:not so.. by RiotingPacifist · · Score: 5, Funny

    The day the linux kernel is coded in anything other than C, is the day i after i install duke nukem forever on hurd.

    --
    IranAir Flight 655 never forget!
  36. C++ losing favor by apharmdq · · Score: 2, Interesting

    I'm not really sure why C++ is so ill-favored lately. It may not be fully OO, but there are many times when a fully OO solution is counterintuitive. Instead, C++ allows the developer to choose whether they want an OO solution or not. I also see a lot of complaints about C++ performance in comparison to C performance, but really, when properly implemented there is little difference. The same goes for garbage collection. Granted you have to write it yourself, but program-specific garbage collection will ALWAYS be more efficient than automatic garbage collection.

    I think it's generally agreed that C and C++ aren't going anywhere anytime soon, since a lower-level programming language will always be needed. However, sidelining C++ in favor of C is definitely not a good idea, as C++ does offer many advantages that C lacks. (Yes, even for kernel development.)

    I'd go into more depth, but this article really does a good job of explaining it:
    http://unthought.net/c++/c_vs_c++.html

  37. C isn't dead... by Tumbleweed · · Score: 2, Funny

    ...it just smells that way.

  38. D programming language by porneL · · Score: 2, Insightful

    D also offers syntax and ease of writing comparable to C#/Java, but is faster, doesn't require VM and compiles to native code linkable with C.

  39. And what are all those other languages written in? by Tomy · · Score: 2, Insightful


    Until a language comes along that can outperform C or C++, there will always be a use for them.

    It's still right-tool-for-the-job. I don't use Ruby to write audio DSP plugins, and I don't use C/C++ to code a web application.

    I'll keep both in my tool box, along with lisp, ... and this thermos.

  40. Python+Fortran or JAVA+Groovy by goombah99 · · Score: 4, Insightful

    In the work I do--scientific calculations with a lot of fast numerics, , python + fortran seems like nirvana, as each overcomes the shortcomings of the other. One could just as well use C except the efficient numeric libs and memory layout give fortran an edge.

    This of course is not the match made in heaven for everyone but numerical scientists should look hard.

    What's so good?
    Utility:
    Well there's a strong base of numeric libraries in Python that are fortran array freindly so there's a good base to grow off of.

    Second F2PY, which creates python modules out of fortran subs works so well it's almost transparent and painless. Even cooler is that because fortran compiles are ludicrously fast compared to C++, you can generate fortran code in the python compiler at run time and compile it one the fly for creating modules optimized to your problem.

    Given you are wrapping in python, the availability of groovy C++ libs is not really very enticing at all given the pain you will pay for having to write the whole program in C++.

    Practical:
    Fortran as a stand alone language kinda blows for versatility and modern program architectures. But if all you are doing is writing a function then it's a sweet language because it's language syntax is so tight that it's harder to make a syntax error that compiles, and hard to logic errors seem to be less evasive than in C. (e.g. using i++ instead of ++i or doing I=4 instead of i==4 are not possible in fortran's limited syntax).

    Thus you write functions and let python deal with all the memory management, human interface, file management, command line arg parsing and all the messy bits that end up being a lot bigger than the function where the program spends all it's time.

    Fortran is also very optimization friendly since things like matrix multiplies and out-of-order loops are part of the core language.

    This is debatable but I find that fortran seems to have a more logical memory order in 2-d arrays. Namely if you take a sub-array you get elements that are consecutive in memory and thus for most microprocessors will all get pulled into the cache on the same page. Slices of C-arrays have consecutive elements spaced by the row width apart in memory. One can of course find cases where one is preferred over another.

    I do however which python had some way of optionally typing variables that was less cumbersome and slow than decorators or explicit run-time type checking. I virtually never write python that takes advantage of introspection or dynamic typing so the ability not to have some protection--optionally and just to debug--by type checking is annoying.

    But If I were starting from scratch and did not have a compelling need for all those wonderful fortran numeric libs, I think the optimal choice in the future is going to be

    Java+ Groovy.

    basically you learn one syntax and get the best of both interpreted and compiled languages. Develop it in groovy then migrate the slow bits to JAVA. import all the great JAVA libs.

    And since it's nearly the same syntax it's easy to read.

    --
    Some drink at the fountain of knowledge. Others just gargle.
    1. Re:Python+Fortran or JAVA+Groovy by goombah99 · · Score: 4, Insightful

      Replying to myself because I forgot to add why I think Java+groovy has a big future.

      The big achilles heel of python is that it currently truly sucks for multi-core programming and it would appear that attempts to solve this are not coming quickly. It's global interpreter lock means that multi-threading gains almost no speed over a single processor. It's darn clumsy to fork in part because it takes so long for python to unwind it's stack when a job exits. And it's never written from the ground up to be thread safe.

      Fortran95 and 2003 have huge potentials for multi-cores since vector ops and out of order loops are part of the core language, the memory order of arrays can be favorable to vector ops, and the developers have been thinking about High performance Computing as a driver.

      however neither fortran95 or pyhton has notions of Syncronizing and locking so all the parallelism is implicit not explicit. You'd rather have implict paralellism to be sure, but sometimes you need explicit control.

      JAVA was written with threading in mind from the beginging. So it can potentially embrace the multi-core revolution that is coming more quickly than other languages.

      --
      Some drink at the fountain of knowledge. Others just gargle.
    2. Re:Python+Fortran or JAVA+Groovy by arevos · · Score: 2, Interesting

      The big achilles heel of python is that it currently truly sucks for multi-core programming and it would appear that attempts to solve this are not coming quickly. Jython? Iron Python? These Python implementations don't have the same global interpreter lock issues that CPython has.

      JAVA was written with threading in mind from the beginging. So it can potentially embrace the multi-core revolution that is coming more quickly than other languages. Java was written with a lot of things in mind, but in my opinion, it didn't fully achieve many of them. Locks and explicit threads are increasingly regarded as not a very good model for handling concurrency.

      Fortunately, whilst Java may have problems, other JVM based languages like Scala and Clojure handle concurrency extremely well in comparison.
    3. Re:Python+Fortran or JAVA+Groovy by goombah99 · · Score: 4, Interesting

      I'm not convinced Java's "synchronized" facilities are a significant improvement over Python's global interpreter lock. Java gets a (somewhat) linear speed-up when you add cores. Python gets virtually zero and in some cases it loses over unthreaded. Big difference!
      --
      Some drink at the fountain of knowledge. Others just gargle.
    4. Re:Python+Fortran or JAVA+Groovy by goombah99 · · Score: 2, Interesting

      I agree Lua is fast and slim. Perl seems to fork really well. Java threads really well and presumably so does groovy. Python is terrible at both.

      In the end you want both powerful and language in wide use (for libraries and people willing to code). That sort of brings it back to Java.

      --
      Some drink at the fountain of knowledge. Others just gargle.
    5. Re:Python+Fortran or JAVA+Groovy by NovaX · · Score: 4, Informative

      There are a number of differences, if I understand Python's giant lock approach correctly. They have basically adopted the threading model used in most early, single-processor operating systems (e.g. Linux, FreeBSD) where the system calls are protected by a shared lock. This works fine for single-processors, since multiple processes are implicitly serialized by task switching. However, as multiple processes run concurrently in hardware this immediately shows performance issues.

      Java's synchronized keyword is a user-level mutex and not a single shared lock across the entire JVM. This means that data structures like HashMaps can use lock-splitting across buckets, or that threads executing independant code flows are not serialized across a single mutex boundary. With Java-5's support for CAS operations, more powerful locks and concurrency data structures are available. I have executed thousands of threads in a distributed master-worker fashion and, due to elegant lock semantics, have not suffered any performance issues due to synchronization. This means that Java is quite strong at both multi-core systems (where there are only a few CPUs) and distributed systems (where there are many).

      I am personally a fan of an actor model (e.g. Erlang) for application developers and a lock model (e.g. C, Java) for infrastructure developers. I do not believe that the actor model works efficently enough to be used at the guts of a system, such as caches, where performance is critical. These are special areas that need a skilled hand, meaning that a lock model should be used sparingly in favor of an actor approach. This has been adopted for quite a long time, as message-based (queues) models are fairly standard in most large, distributed service-based applications.

      --

      "Open Source?" - Press any key to continue
    6. Re:Python+Fortran or JAVA+Groovy by Gracenotes · · Score: 3, Informative

      They both try to solve the same problem of shared data management across threads in a similar way, and I think neither will really scale to huge multi-core systems so long as the lock-and-key mechanisms remain in place.

      Java introduced many more sophisticated tools with the java.util.concurrent package (and subpackages) that allow for programs with high CPU thoroughput and scalability. These include synchronization primitives such as a count-down latch, cyclic barrier, semaphore, an exchanger, and so on. Several concurrent collections were introduced, notably a variety of queues that serve a variety of unique purposes. An executor framework was introduced to replace Timer/TimerTask, and includes all sorts of thread pools, rejected execution policies, delayed executors... you get the idea.

      java.util.concurrent.atomic has several atomic value holders, some of them reflection-based, all of which use compare-and-swap, a low-level algorithm, for lock-free access/modification. java.util.concurrent.lock contains locking utilities, including a ReentrantLock. (This class was so much faster than synchronized, btw, than synchronized was changed to use ReentrantLock's algorithm in Java 6.) Finally, there's the AbstractQueuedSynchronizer, a robust class for building synchronizers, that (again) uses compare-and-swap to maintain state.

      There's no doubt that less data shared between processes, and increased parallelization, is good for any concurrent application. In terms of concurrency, though, Java offers quite a bit of flexibility and sophistication, though sacrificing some of the simplicity of functional programming languages. In my opinion, anyway.

  41. Re:C++ is as good as C# _if_ used correctly. by Chris+Burke · · Score: 2, Informative

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

    True, but your program is pretty trivial if it never needs to dynamically allocate a memory resource.

    --

    The enemies of Democracy are
  42. Re:C++ is as good as C# _if_ used correctly. by pclminion · · Score: 4, Informative

    Programs which use STL containers instead of manual memory management are "trivial?" This is news to me.

    Avoiding the use of "new" is not the same as avoiding dynamic allocation. You simply let the containers handle it for you. Yes, there are pointers flying around, but they are out of sight, and managed by code that actually does things properly for you.

  43. Natively-compiled languages by radarsat1 · · Score: 5, Interesting

    I'd _like_ to stop using C++, frankly, but I don't seem to have a choice. A lot of my work depends on real-time capability, the kind of speed that is still only really possible on natively compiled languages that don't do dynamic typing.

    I don't even mean hardcore real-time mechanical nano-second control of knife-wielding deathbots, just simple, This Must Run As Fast or Faster Than The Rate At Which It Will Be Converted To Analog. Python and Java still don't replace C in this area. (Mainly audio, video, and high-speed mechanical control.) And when it gets complex and you need to get into object oriented models to simplify the programming, there is unfortunately no real alternative other than C++. Combine this with that fact that there are a bunch of great libraries out there written in C++ that would be very difficult to replace, and you're stuck with it.

    (I sort of oscillate between liking C++ and hating it, but I'm preferring straight C more and more these days. But like I said, I don't always have the luxury of choice, depending on what libraries I need to use.)

    All these other languages mentioned (Java, Python, Ruby, PHP, Perl, etc) do not compile to native code, and all do dynamic memory management. Hell, that's exactly what makes them *good*. But unfortunately they're not so good for real-time tasks.

    For real-time, you need deterministic memory management, and native speed. I've been looking at some other languages that compile to native code these days, like D, or Vala, but I haven't really decided yet whether I can start using them on serious projects.

    I'd really like to learn more about functional programming in this area, too, but there seem to be very few functional languages that are designed for real-time. FAUST is one, but it's only for audio.

    Anyone know any other good natively-compiled languages that actually have well-implemented modern features?

    I wish it were possible to have a compiled version of Python, for example, but there are many dynamic features it depends on. (Some stuff could be done in Pyrex, which is a pretty cool little project, but so far I've only used it to make bindings to C libraries.)

  44. The C/C++ language space needs to evolve by CoughDropAddict · · Score: 4, Interesting
    I am a die-hard C and C++ advocate. I consider it a high priority to make sure that the JVM and .NET aren't the de facto future of all computing, which seems like more and more of a risk when you see things like Singularity OS, which is an OS where all application code must be managed code. These managed code people go nuts and think that everything should be managed.

    The current generation of managed code VMs clearly have some benefits. But but they fall far short on some of the key properties that make C and C++ so powerful. Even if I grant you that the JVM and .NET have caught up to C and C++ in speed (which I still don't believe has been demonstrated), it's undeniable that
    • VMs have comically bloated memory footprints: between 2x and 30x comparable C programs according to benchmarks: JVM, Mono. Even if you consider memory cheap, smaller is always better because it means fewer bits flying over the bus and better cache utilization.
    • VMs stop the world to do garbage collection. Point me to all the articles you want that explain how "it's getting better" and "they've figured out how to make it real-time," but that doesn't change the fact that you're stopping all threads whenever you garbage collect, which is making your latency suffer.

    C and C++ are the only game in town for getting the best performance and a small memory footprint and the ability to have the lowest possible latency.

    That said, I think that C and C++ are becoming harder to justify when you consider the havoc that memory errors can wreak. It's highly embarrassing to vendors and damaging to their customers when a buffer overflow exploit is discovered. malloc and free, even when used correctly, can still have some forgotten downsides like the memory fragmentation that was discovered in Firefox 2, and took some very smart people a lot of work to address.

    What I would like to see is a language that gives the benefits of C and C++ (extremely fast, extremely small memory footprint, and no GC pauses) but that is also immune to C and C++'s weaknesses (memory corruption, memory leaks, memory fragmentation). Yep, I pretty much want to have my cake and eat it too. Why do I think this is possible? I think that the future is to have a fully concurrent, compacting GC. Everyone's telling us we're going to have more cores than we know what to do with soon, right? Well why not use all those extra cores to do GC in the background? Even if it's more expensive on the whole, we barely know what to do with all those extra cores as it is. With this strategy, you could get the performance guarantees and low overhead of C and C++ (on the real, non-GC thread, that is) without having to give up GC or suffer from memory fragmentation.

    I'm also not willing to give up the option of dropping to C or C++ (or even assembly language) when it's justified. Mention JNI in a room of Java people and observe them reel in horror -- it's culturally shunned to deviate from "100% pure Java." Maybe this is a good value when you're on a big team of people writing a web app, but for systems and multimedia programming this is silly -- inner loops are inner loops, and some of them can benefit from machine-specific optimization.

    Theoretically you could experiment with the fully concurrent GC using an existing language/runtime like Java, but I've sort of given up on the JVM and .NET communities, because they have empirically demonstrated that they culturally have no regard for small memory footprint, low overhead, short startup time, etc. They just don't consider huge memory footprint or ridiculous startup times a problem. This is not to ment

  45. Re:not so.. by andersbergh · · Score: 4, Informative

    Well, the kernel definitely isn't written in Objective-C, here are the languages they use:
    C for the kernel
    Embedded C++ for the drivers (IO Kit)

    But many of the applications that make up OS X however are written in Objective-C.

  46. Re:We've replaced C/C++ with Python wherever possi by IamTheRealMike · · Score: 2, Interesting

    You didn't say what kind of software you're writing. Personally, I think using Python for large codebases is shooting yourself in the foot (I've seen it tried several times and the results were never pleasant).

    Problems Python has that C++ doesn't (imho) - Python is oddly easier to write than read in my experience, because it's so dynamic. The result is that it's a lot of fun to write and really no fun at all to try and figure out when you're new to a codebase, because you can'

    Python doesn't even try and be efficient. Fans of Python tend to say that it doesn't matter because either performance doesn't matter for their application, or because they can write the hot-spots in C. Well, for a lot of apps there aren't really any well defined hotspots after some optimisation. Instead the app just chugs. Look at the fate of Chandler or Sugar for instance. You can't fix that kind of thing by jucidiously rewriting the bottlenecks in C because there isn't one bottleneck - it's death by a thousand cuts. This is especially true of memory-constrained environments like desktop software. I've seen way too many apps where the developers clearly thought they'd "make it fast later" and then discovered that they didn't understand performance like they thought ...

    It's rather hard to distribute Python apps without distributing a giant runtime with them as well. For many apps that doesn't matter, but if you want people to download your app, it's going to hurt. Any consumer desktop app for instance ...

  47. myth by nguy · · Score: 2, Interesting

    The chance of running into all kinds of memory problems is gradually outweighing the performance penalty you have to pay for garbage collection

    It's a myth that there is a performance penalty for garbage collection; garbage collection usually has less overhead than doing the same kind of memory management with malloc/free.

    The reason that garbage collection has a reputation for being slower is that once people have garbage collection, they get sloppy and wasteful. And languages using garbage collection often just aren't designed for efficiency (e.g., Java).

    It would be nice to have a safe, garbage collected systems language, and such languages are possible. Unfortunately, all we get is Java and C#, two bloated languages that make writing efficient programs harder than eating tomato soup with chopsticks.

  48. Re:not so.. by porkchop_d_clown · · Score: 2, Funny

    Let me know when you're finished with that Linux replacement.

  49. Mods on crack by Nursie · · Score: 4, Informative

    Troll?

    Annoyed, enflamed perhaps, but Troll?

    Sorry but it's a pet hate of mine that here on slashdot, which is supposed to be a forward looking tech board, that people still regularly espouse the view that threaded programming is something either still in development, too complex for ordinary mortals, or only applicable in a few scientific arenas.

    It's just thoroughly incorrect. Industry and open source have been doing threading for years. Please can we lose this myth.

    And to bring the post back on topic - pthreads in C will do it all nicely. Hell, even MS VC++ 6.0 (almost 10 years old?) will compile your multithreaded Windows C app.

    I'd also lik to express suprise at the title of this article. C is losing popularity at the same position as last year, number 2? OK, it'll fizzle out any day now, I believe you.

    I think my job's safe for now.

  50. What about for embedded applications? by Rorschach1 · · Score: 2, Insightful

    I'm curious what the list looks like for embedded programming - particularly at the low end. For my money, C is hard to beat on small systems - it's a good compromise between efficiency and manageability. If you know how the compiler works, it's not hard to write code that's nearly as efficient as hand-optimized assembly.

    I'm sure Java ranks high there, too, but I don't consider it to be in the same class. Native Java hardware is relatively expensive, and running a VM takes a significant amount of memory and processing power.

    My latest project is pure C (aside from about 100 lines of assembly for a firmware upgrade bootloader), around 30 pages of source code at present, and it compiles to about 9k of object code. It's targeted for a $2.50 processor, and I'm able to do things like simultaneous Bell 202 and DTMF decoding in software because I know exactly how C arithmetic is implemented on the processor and can take advantage of that without having to actually do the implementation in assembler. Doing the same thing in Java would cost a lot more. And when $5 saved on the bill of materials means an extra $5-10k in my bank account at the end of the year, that's a big deal.

    So what other languages can compete in that space?

  51. Re:Objective C by jeremyp · · Score: 4, Informative

    The Mac OS X kernel is entirely written in C except for the bits that have to be written in assembler.

    The preferred run time for graphical applications is Objective C but I'm willing to bet that the low level graphics are done in C.

    And Objective C is the bastard son of C and Smalltalk (but it's still my favourite programming language). It's probably equally closely related to Java and C++.

    --
    All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
  52. Garbage Collection by RAMMS+EIN · · Score: 2, Interesting

    ``The chance of running into all kinds of memory problems is gradually outweighing the performance penalty you have to pay for garbage collection.''

    Moreover, automatic memory management makes for more elegant and workable APIs, and some things (I think closures are among those) need automatic memory management.

    Also, automatic memory management is not necessarily slower than manual memory management. In fact, garbage collection can be faster than malloc/free, and has been demonstrated to be so in some cases. (One obvious case where a collector outperforms manual memory management is when the collector never has to run.)

    --
    Please correct me if I got my facts wrong.
  53. Niche compared to others by DrYak · · Score: 2, Insightful

    I wouldn't say it's a niche. It's a niche in the sense that AJAX is exclusively used for web interfaces.

    So it could also be considered a niche on the scale of all the situation at which you can throw the other languages. C could be found on anything electronic that can run code between small embed micro-controllers up to package running on huge mainframes or cluster.

    It's not bad, its very useful indeed. Just hasn't seen as many different usages as the other languages yet.
    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
  54. Algol68 by hedley · · Score: 2, Interesting

    Strong typing. Garbage collection. Native code generation.

    Lack of OO and a current up to date machine code generating compiler would be a detriment though
    to a rollout anytime soon of this old language.

    http://en.wikipedia.org/wiki/ALGOL_68/

    H.

  55. The TIOBE Index is a Bit Flawed by Shlomi+Fish · · Score: 2, Informative

    As Sterling Hanenkamp notes the TIOBE index is a bit flawed. It doesn't measure popularity - it measures hype, and not all of it too. That put aside, it is true that C and C++ are not used as much as they once used to, and that's because there are alternatives that are better for many uses. However, there are still many tasks for which they are still the best choice (warning - a link to my own article), and should be used. A lot of open-source code is written in ANSI C and C++, and usually for very good reasons.

    While I expect the use of C and C++ to diminish, I wouldn't say they are "dying" or "losing ground". They just become more established and more "niche" languages. Another fact to note is that usually the virtual machines for higher-level languages are C-hosted - perl5, CPython, ruby, php, Tcl, the various Java VMs, Mono (and probably Microsoft's .NET too), Lua, Io, etc. are all written in ANSI C, and can normally be extended using it. Some languages are self-hosting and usually can be bootstrapped by compiling themselves to C, and then compiling the C code.

    Every programmer worth his salt, should still learn ANSI C, because not knowing it leads to lack of good understanding of computer architectures and portable programming that is bound to lead to inefficient code, and improper use of any programming language. I wouldn't recommend learning ANSI C as the first programming language (another link to an article of mine), but it's still an essential skill.

    --
    We have two eyes and ten fingers so we will type five times as much as we read. http://www.shlomifish.org/
  56. Dubious methodology by Angst+Badger · · Score: 2, Insightful

    which measures the popularity of programming languages by monitoring their web presence

    Web presence doesn't equal much; it certainly doesn't equate to popularity. Nor do these numbers bear much resemblance to the mix of programming openings I see on job boards. C is number two? Really? Or are they just counting the number of times C shows up in the meaningless expression C/C++ ? Outside of the DSP and embedded devices niche, the appearance of "C/C++" in a job listing means they're looking for a C++ programmer, and it's generally followed by a list of C++ APIs that the successful candidate will be familiar with. And please, C fans, keep your flames low. C is my favorite language, but if it was really the second most popular programming language, I wouldn't spend eight to ten hours a day programming in C++ and PHP.

    Anyway, the bit about the lack of garbage collection in C++ is a crock. There are a number of easy to learn and use GC libraries available for C++, and a number of them can be used in most cases with little to no code changes simply by linking them in. If the popularity of C++ is declining over GC, it's because people have gotten too lazy to type "c++ garbage collector" into Google. There are plenty of reasons to dislike C++, but that's just not one of them.

    --
    Proud member of the Weirdo-American community.
  57. Re:Natively-compiled languages - real problems by Animats · · Score: 2, Interesting

    There's nothing good to program in. This is a serious problem.

    We have C. C isn't a bad language, but the "pointer=array" concept, while it provided some performance gains in the PDP-11 days, continues to cause millions of crashes and intrusions every day. The fundamental problem is that you can't even express the size of an array in the language. Given that, the odds of consistently getting subscripts right is low. This could be fixed, but it will never happen.

    There's C++. C++ has lost its way, as I've pointed out before. The C++ committee is off in template la-la land, putting in features that few will use and fewer still will use correctly. (Coming soon: "concepts"). The real problem with C++ is that it's no safer than C, but hides more.

    There were once better languages. Delphi is better, but it's Borland. Modula 3 was a good systems programming language, but it died with DEC. Various attempts at improvement, from Ada to Eiffel to Sather, have almost died off. Amazingly, "D", which is Walter Bright's successor to C++, has a measurable market share.

    Some progress is being made on numeric issues, like compiling Matlab to efficient code for parallel hardwware. But that doesn't help systems programming much. Hard-compiled Python would have potential, if Guido wasn't against it. (Python has a speed penalty of about 10x to 60x over C/C++. Maybe at some point Google management will decide that a hard-compiled Python system would be cheaper than building additional data centers at former aluminum-smelter sites.)

    As for garbage collection, it's a headache. "Finalizer" and "destructor" semantics get weird. (See "Managed C++") Reference counting leads to saner semantics and repeatable timing, but is inefficient unless the compiler knows how to hoist reference count updates out of loops. (Incidentally, about 90% of subscript checks can be hoisted out of loops, and you can almost always hoist them out of inner FOR loops. So subscript checking is almost free if done right.) Note that Perl is reference-counted, and Perl programmers don't spend much attention on memory management. If you have strong and weak pointers, reference counting, and treat cycles as errors, you don't really need garbage collection.

  58. Re:It is somewhat and it's the reason I left CS by Shados · · Score: 2, Insightful

    I have news for you however. Statistically and historically, CS-related work was mostly a big trail of failures. Virtually no project, aside a select few with insane ressources backing em, and a couple of lucky shots, actually ended up giving out more value than they required.

    In this day and age, maybe its inefficient, maybe its not quite CS, maybe its not "cool", but it gets the job done, it saves money, it makes things work, its enabling. Its still not good enough in its current state, but its going in the right direction. We're leaving the "how" behind, and changing it with the "what". People have ideas, and they make those ideas a reality, and it "works".

    It may not be as badass to implement an enterprise management system, as opposed to the first ethernet network, but you don't spend 3 years on a project to be left empty ended 90% of the time either.

  59. C++ is easy by jessecurry · · Score: 2, Insightful

    Saying that C++ is losing ground because it lacks garbage collection makes me fear for the future of the "general programmer". If you use C++ for any length of time beyond a week it becomes second nature to manage your memory. Hell, I programmed in C++ for 2 days and caught on to situations in which a memory leak would even be possible. It's scary how easy it is to do... it's even scarier to think that people would drop a language because they may have to be mindful of memory when they code.

    --
    Those who know, do not speak. Those who speak, do not know. ~Lao Tzu
  60. Nah. by fozzy1015 · · Score: 2, Informative

    I work at a very large telecom on their enterprise level network routers. Our code base is almost entirely C. I, and a few others, have been moving parts over to C++ mostly for what C++ and Boost can offer. There is a standard Red-Black binary tree library in VxWorks(probably all Unixes: rbtLib.h). Needing two or more sets of ordering on the same data is a hack. You create two binary trees and cast different structs before dereferencing it. I've done it. I then tried the multi index set in Boost and you know what? Each entry takes up EXACTLY the same amount of data as when I hand coded it in C. What's great about C++ is you can use it as a better C. Define all your types and use the implicit constructor calls to range check all with assert() when you develop.

    I've also interviewed at Redback and they are entirely a C shop. Some of it is old entrenchment, but some of it is needing to know exactly what happens in their code. I have mixed feelings about that.

    On the other hand, C is the lowest you can get across processor architectures. You have complete confidence knowing exactly how much memory a structure will take up, with knowledge of boundary alignemnt of course. Saving it to disk and loading it back is straight forward. Have one virtual function in a C++ class or structure and doing that will cause trouble as the compiler will put a pointer to a vtable at the beginning. From a simple debug shell I've had to debug a chip vendor's function by calling malloc and passing the address back to the API function to DMA a hardware table into memory. Have you seen what function overloading causes the compiler to do with the entries in the symbol table? My whole point is that abstraction leaks will always occur, and when someone has to go to the lower level to debug, these higher level constructs cause more confusion.

    C isn't going anywhere, at least not in the some what niche area of network software programming.

  61. ComputerWorld: ColdFusion is dying by G3ckoG33k · · Score: 2, Informative

    From http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=9020942&pageNumber=1 "ColdFusion. This once-popular Web programming language -- released in the mid-1990s by Allaire Corp. (which was later purchased by Macromedia Inc., which itself was acquired by Adobe Systems Inc.) -- has since been superseded by other development platforms, including Microsoft Corp.'s Active Server Pages and .Net, as well as Java, Ruby on Rails, Python, PHP and other open-source languages. Debates continue over whether ColdFusion is as robust and scalable as its competitors, but nevertheless, premiums paid for ColdFusion programmers have dropped way off, according to Foote. "It was really popular at one time, but the market is now crowded with other products," he says" So, it is counterintuitive with these new stats! Who should one believe?

  62. re: NBL / "no new paradigms" by corecaptain · · Score: 2, Interesting

    As for NBL - I think the NBL will provide support/semantics for development methodologies and components - Abstractions built in for defining components, instantiating them from repositories, support for testing .. I think all the current focus on things like dynamic vs static typing, closures, functional languages, dsl, are all things that are at too low a level - it is analogous to assembly language programmers arguing over instruction set design when out of left field comes compiled high level languages (ie. fortran ) So I think the guy saying he doesn't see any new paradigms showing up is correct if your "domain" is limited to what we know so far.. I mean take C vs Ruby - how much do their paradigms differ ? Compare the difference in paradigms between assembly and fortran - that is big difference. I think the NBL will be the NBL exactly because it will force us to think about programming in an entirely new way - in my opinion it will need to address the fundamental problem that alot of software engineering (despite 20 years of OO) involves re-inventing the wheel.
    Take the hottest web dev framework - Ruby on Rails...what is pathetic is how much functionality each web dev team is duplicating all over the world...user management, logging, session management, on and on, not to mention higher level domain stuff like shopping carts.. so there is lots of re-inventing the wheel going on. Software needs components - this is not a new idea .. I think Parnas in the 70s or something delivered a speech on this...so the NBL will enable components ...Software development is hard (re Brooks - mythical man month - essential vs accidental complexity) that is true..but it doesn't follow that we are doomed to repeating the essential (hard parts) ad infinitum....okay sorry for rambling... good night.

  63. TIOBE Index is biased and faulty by thesteef · · Score: 2, Insightful

    It's unbelievable this company get's any attention with this index. Just some quick and easy points which have been glaring mistakes for years now: Vb is a combination of Basic, VB.NET, Visual Basic.NET, Visual Basic .NET, Visual Basic 2005, VB 2005, Visual Basic 2003, VB 2003, Visual Basic 2002, VB 2002. Some of these, especially the .net variants are totally different languages with only superficial similarities with the rest. Including this in the index is nonsense. Secondly one has to wonder why .net in general is so underrepresented versus java. This can be explained an their data gathering method. They google for terms like +c# programming. This ommits an entire group of articles only targetting .NET This is because of the language independant nature of the platform. Some numbers to put this 'index' in some much needed perspective: +java programming 8.320.000 +.net programming 13.500.000 +c# programming 1.260.000 +vb programming 618.000 +vb +.net programming 664.000 This is the only meaningful way to look at the relative popularity of java & .net. Java is not only a language but also a platform, so is .net. Furthermore the majority of programming (judging from these numbers i'd say about double) in .net is done in c#. You'd have to conclude that c# should at least be up there with java. That is if you think counting the number of search engine results is a meaningful way to get an index, which I don't.

  64. Re:Not myth by nguy · · Score: 2, Informative

    The problem is that you can't tell the system when to collect garbage. So you may find that during a critical section your VM stops everything and starts collecting up the garbage and throwing it out.

    That is completely false. Even with a regular garbage collector, you can disable the garbage collector when you want/need to. Concurrent garbage collectors don't stop the system at all. And real-time garbage collectors give you precise upper limits for every memory allocation.

    If you manage memory yourself, you can prove that your system will not do this.

    That, too, is false, in two ways.

    First, having a garbage collector doesn't prevent you from doing manual storage management.

    Second, malloc/free and new/delete can have arbitrarily high latencies, and they do in practice.