C Programming Language Hits a 15-Year Low On The TIOBE Index (businessinsider.com) 232
Gamoid writes: The venerable C programming language hit a 15-year low on the TIOBE Index, perhaps because more mobile- and web-friendly languages like Swift and Go are starting to eat its lunch. "The C programming language has a score of 11.303%, which is its lowest score ever since we started the TIOBE index back in 2001," writes Paul Jansen, manager of TIOBE Index. With that said, C is still the second most popular programming language in the world, behind only Java. Also worth noting as mentioned by Matt Weinberger via Business Insider, "C doesn't currently have a major corporate sponsor; Oracle makes a lot of money from Java; Apple pushes both Swift and Objective-C for building iPhone apps. But no big tech company is getting on stage and pushing C as the future of development. So C's problems could be marketing as much as anything."
Rust will replace them all (Score:5, Funny)
Rust will be the new language everyone uses in 2020.
Re:Rust will replace them all (Score:5, Funny)
Nah.. It'll be jython servlets running inside a lua hypervisor that is written in javascript.
Re: (Score:2)
Re: (Score:2)
problems, lol (Score:5, Insightful)
From TFS, "c's problems": c doesn't have "problems"; programmers who don't use c have problems. Such as their code is slow, overweight, wasteful of resources, and uses only a fraction of the potential available at the low level.
But you keep holding that warm, safe hand. Momma will lead you right to the rubber room. :)
Or, you know. You could actually learn how to write good code at the most powerful level. That's a radical thought.
Re:problems, lol (Score:4, Insightful)
c doesn't have "problems"
Sure it does. As TFS notes, C doesn't have a corporate sponsor. That's why (to pick one example) there is no native compliant C compiler for Windows.
(Yes, you can build Clang if you want to. You know what I meant.)
Re:problems, lol (Score:5, Insightful)
C doesn't have a corporate sponsor.
Why is that a bad thing? Is Java better because Oracle owns it?
Re: (Score:2)
Why is that a bad thing?
You may have missed this, but I gave one example in the very next sentence.
Re: (Score:2)
That may be bad for Windows (I don't really think so), but how is it bad for C?
Re:problems, lol (Score:4, Insightful)
C doesn't have a corporate sponsor.
Why is that a bad thing? Is Java better because Oracle owns it?
It probably isn't, come to that. C has many obvious advantages - it is easy to learn, it is low-level, so programs tend to be fast, the system calls of most OSes are directly accessible from C. The downside is that because it is so easy to learn, it also invites the inexperienced programmer to commit dangerous errors, that can sometimes be hard to pin down. Many of the better class of new languages try to address these problems, although I am not convinced that the solutions are always worth the cost. The best, new feature, in my view, is the introduction of exception handling in Java, C++, Python and other languages.
It is hard to compare C to Java, I think; although they are syntactically similar, they address different classes of problems. Where C is a free-styling sort of "assembler++" (I mean that in a good way), Java has moved to the other end of the spectrum: the compiled byte-code run in a VM on any platform for which a JVM has been implemented, and Java probably has more industrial standards associated with it than any other language; this makes it rather hard to learn to work with, but it also means that there is well-designed, standard way of doing almost every important thing you might want to do with software, and it makes it much likely that your programs are going to be compatible with other Java programs.
Re:problems, lol (Score:4, Insightful)
C doesn't have a corporate sponsor.
Why is that a bad thing? Is Java better because Oracle owns it?
It probably isn't, come to that. C has many obvious advantages - it is easy to learn, it is low-level, so programs tend to be fast, the system calls of most OSes are directly accessible from C. The downside is that because it is so easy to learn, it also invites the inexperienced programmer to commit dangerous errors, that can sometimes be hard to pin down. Many of the better class of new languages try to address these problems, although I am not convinced that the solutions are always worth the cost. The best, new feature, in my view, is the introduction of exception handling in Java, C++, Python and other languages.
Exceptions or something like them would be nice to have in C (I'm sure that's not possible for some extremely good technical reason but a guy can dream). However, the thing about C that annoys me the most is the fact that I have two re-invent the wheel all the time, that, introduce libraries to the project or write my own utility libraries. The thing I think C is missing the most is a major extension of it's standard library. C++ for example is full of utility libraries with functions to do small mundane tasks like check strings. Things that can be finished off by one call to a utility function that is part of the standard library in C++ can only be solved in C by either writing several lines of code or including an external dependency that may or may not compile when you move to some other platform and even if it does the behaviour may not be the same. Headaches with different Lex/Yacc implementations spring to mind and even with the same Lex/Yacc implementation behaving differently on, say Linux and AIX or Solaris, the list of headaches connected to external dependencies is long. Also there is a lot of things that can be solved in a single assignment in C++ that can only be done in a much more clunky way in C.
Re: (Score:3, Interesting)
Exceptions are possible in C. See the documentation for setjmp() and longjmp().
That said, exceptions are just "kicking the can down the road" for error handling. If a function call can fail, then you should check the return code. If you don't want to write with proper error reporting/recovery code immediately, there is always the assert() macro, e.g.:
if(func_which_might_fail() == ERROR_OCCURRED) assert(0);
If assert(0) gets called the program will stop immediately, and you can inspect the problem in detail
Re:problems, lol (Score:4, Informative)
Exceptions are possible in C. See the documentation for setjmp() and longjmp().
That said, exceptions are just "kicking the can down the road" for error handling. If a function call can fail, then you should check the return code. If you don't want to write with proper error reporting/recovery code immediately, there is always the assert() macro, e.g.:
if(func_which_might_fail() == ERROR_OCCURRED) assert(0);
If assert(0) gets called the program will stop immediately, and you can inspect the problem in detail with a debugger. Easy peasy.
Urgh, no. Never, ever do this. assert() usually becomes a no-op when compiling stuff without debug flags, so binaries shipped to the field will mysteriously ignore errors in ways that can't be reproduced in a debugger.
One thing that shouldn't change between debug and production code is error detection and handling. In this sense, exceptions are ideal, as handling only needs to happen as and when errors occur, and the common case of no errors incurs little (setjmp/longjmp) to no (exception tables) overhead.
Plus exceptions are less laborious to handle. You can have a single try/catch for a whole block of code, instead of testing and handling each and every function that could fail. If you write exception safe code, then that's all you need to do, and you can clean up failed operations in the exception handlers.
Re: (Score:3)
An assertion should just be the evaluation of a boolean expression.
Assertions can be anything you want them to be. There is no (nor should there be) requirement that they be a boolean expression.
Sometimes it is sensible to say assert(foo_is_valid(foo)); on some object foo, and the foo_is_valid() call might need to do a lot of work.
Or... In an arbitrary precision integer arithmetic library, if you compute the quotient and remainder q and r of a divided by b, it is sensible right before returning to assert that b times q plus r equals a, which obviously incurs a significant
Re: (Score:2, Funny)
All current programming languages have major problems. They are not direct extrapolation of normal language or maths or physics languages. They use sounds like or it'll do based upon the idiosyncrasies of their programmers and they are all quite logically awful beyond their own idiosyncratic internal logic.
We need a new programming language from scratch, properly extrapolated from English, maths and physics and likely a few new custom programming specific characters which should be added to keyboards (mu
Re: (Score:2)
Because no one has ever tried a natural language programming language or alternative keyboard layouts before...
Re: (Score:2)
Because WASD would be a bitch to use on alphabetic keyboards.
Re: problems, lol (Score:2, Insightful)
Of course Windows has more than one native compliant C compiler. Microsoft doesn't make one but why should anyone care?
Re: (Score:3)
Anyone who knows C should be able to rattle off some problems.
The operator precedence is screwy. Switch statement case fallthrough is a pitfall. The fact that = is an operator, not part of a statement, makes errors easier. There's a lot of undefined behavior for which no diagnostics are required, and which doesn't look dodgy. The string library is awkward and somewhat inconsistent (check out what strncpy() actually does). Memory management and pointer arithmetic are necessary in far too many context
Re:problems, lol (Score:5, Informative)
Flawed logic. C++ doesn't have a corporate sponsor either, and yet it has a native compiler on Windows.
Multiple vendors pay good money to develop compliant C++ compilers for many of the platforms that we use.
The two main challenges I see for C are the competition with C++ and faster hardware.
Most "C compilers" are actually C++ compilers running in a "C mode". The trouble is that most of the corporate sponsors care more about being compliant with the latest C++ standard than being compliant with the latest C standard.
And because C++ is slightly more typesafe (strict aliasing), those optimizers can do more for C++ code than for C. So despite the more complex language, C++ can be marginally faster (~1%).
Probably not even that. In the tiny number of cases where strict aliasing buys you anything at all (which on modern out-of-order hardware it almost never does), it's around the same order of magnitude as the performance that you lose in C++ due to maintaining exception handling information. There's really nothing between C and C++ given the same code these days. In practice, most of the performance gains in C++ come from metaprogramming.
Which gets us to the faster hardware: how often is that performance even needed?
For the vast majority of "embedded" devices that I own, the main performance impact isn't CPU speed, it's battery life. A program which gets its job done as quickly as possible and then puts the CPU into an idle state is far more desirable than one which is perceptually just as responsive but wears down the battery faster.
Re:problems, lol (Score:5, Informative)
Probably not even that. In the tiny number of cases where strict aliasing buys you anything at all (which on modern out-of-order hardware it almost never does), it's around the same order of magnitude as the performance that you lose in C++ due to maintaining exception handling information. There's really nothing between C and C++ given the same code these days. In practice, most of the performance gains in C++ come from metaprogramming.
Actually...
Aliasing information does help. Modern compilers do auto parallelization at both the fine level (SIMD) and the coarser thread level in some cases. Take, for example the following code:
void foo(A* a, B* b)
{
for(i=0;i
A and B are the same types, there is nothing that stops the base where a=b+1. If A and B are different types, strict aliasing tells us those arrays never overlap, and so the compiler can use wide SIMD instructions in that loop.
If A and B are the same type, in C (and in practice C++ compilers with a nonstandard extension), you can specify "restrict", which informs the compilers that the arrays don't alias and so it can use the wide SIMD instructions. In that case C is a bit better than standard C++, since C++ has no restrict keyword.
Also, when it comes to exceptions, these days it's basically zero cost (I think it is actually zero cost), provided you don't throw. The compilers make throwing expensive to do that. I believe there's some sort of big look up table plus bisection somewhere so it can figure out the throw-position from the program counter, which is quite expensive. Then it jumps from there to the correct bit of unwind code. The practical effect is that there's nothing exception related in the main code except for a throw.
Re: (Score:3)
Yeah but who has the time to
Re: problems, lol (Score:3, Insightful)
There have been no big changes, other than the introduction of these newer languages. The idea of corporate backing is a red herring. Java is backed by Oracle, but just barely.
(Oracle's plan to make money from Java mostly centers around suing Google. Otherwise, it's clear they have no intention of doing anything interesting with Java. I'm kind of hoping Oracle "OpenOffices" Java and just gives it to some organization like the ASF.)
What you are seeing is entirely natural and should surprise nobody. The domin
Re:problems, lol (Score:5, Insightful)
From TFS, "c's problems": c doesn't have "problems"; programmers who don't use c have problems.
That is actually what TIOBE measures. It counts Google searches. C programmers are smart enough that they don't need to search for answers on Google, or they use a better website, such as Stackoverflow. A high TIOBE index can mean a language is popular, or it can mean that language has dumb programmers.
We have K&R on PDF (Score:4, Funny)
From TFS, "c's problems": c doesn't have "problems"; programmers who don't use c have problems.
That is actually what TIOBE measures. It counts Google searches. C programmers are smart enough that they don't need to search for answers on Google, or they use a better website, such as Stackoverflow.
We use neither google nor stack overflow, we have K&R on PDF.
Re: (Score:2)
Even if you did, it strikes me that this is an absurd metric. Since a lot of C development goes on within communities; either closed source shops, or open source projects, where it's likely only a portion of the mailing list archives, if any of them at all, are archived. The majority of the BSD and Linux kernels are written in C, along with a significant percentage of the toolsets, so clearly there's one helluva lot of C coding going on. Whether search engines index that activity or not is irrelevant.
A bett
Re:problems, lol (Score:4, Insightful)
Re:problems, lol (Score:4, Insightful)
TIOBEs index is fundamentally flawed, I've posted here analysing why on numerous occasions and in great detail, and whilst my posts on the topic have always been modded to +5 Slashdot still regularly posts drivel based upon it, and people still seem to debate those stories even though they have exactly no merit whatsoever due to the fact the data behind the story is fundamentally broken.
I still have literally no idea why Slashdot posts stories based on TIOBE, and why anyone bothers to debate those stories as if the premise they're dragging from the index has any merit whatsoever. I can only assume TIOBE pays Slashdot for Slashvertisments at this point.
I'll give TIOBE credit, it has in the last year or so updated it's methodology to be slightly less than worthless rather than just completely worthless, but it's still ultimately just a shade of worthless in it's methodology. It looks like they're now using someone who passed high school statistics, rather than someone that failed it. They really need at absolute minimum a statistics graduate though if their index is to be of any value.
I've long said that if they want to drastically increase the value and worth of their index, then rather than counting how many results they get for "C Language" on YouTube, Amazon, Baidu, and Wikipedia which tells us pretty much nothing about it's usage, that they at least switch to using results from Jobsites, and open source project sites. That way they can start to measure what's actually being used, rather than what a bunch of unrelated search engines are confusing their search for.
Consider this, C++ is a (relatively) old language, but one that has been updated, by searching Amazon for "C++ Language" you may therefore get more books on it than any other language, but that tells us absolutely nothing about how much it's being used, as many people who read the early books may have long retired and the books may be entirely irrelevant now, but Amazon still lists them whilst newer C++ developers are buying the newer books it's possible that usage has stayed relatively static for example - the increase in books does not necessarily correlate to an increase in developers. The same problem rings true in other ways for all their other search results.
By using job sites it may still not tell us anything about retirement, but it does at least tell us the trend. Using open source repositorites can be a good indicator of actual usage, though it misses out the entirety of the corporate closed source world which may or may not use a completely different set of technologies.
So whilst TIOBE currently tells us nothing of value, it could be changed to tell us what companies are hiring for and hence using or intending to use, which is helpful, or it could tell us what open source projects are using, which is useful information as it gives you an idea of what open source developers are choosnig to use even if it's not necessarily representative of the whole market.
Short version: TIOBE needs to change it's methology to be meaningful, or Slashdot needs to stop posting stories based on it that are almost certanily incorrect, or at least aren't verifiable by anything from TIOBE.
Re: (Score:3)
C is a very compact language, you can learn and remember all of it without a reference guide. Hence there is less need to google stuff.
Re:problems, lol (Score:4, Insightful)
The reality is that programmers make lots of mistakes, no matter how smart they are, how educated they are, or how hard they try.
Another reality is that even if the really brilliant programmers never made mistakes, there aren't enough of them to create all the software that the world needs.
Fortunately, in the 44 years since C was created, we've learned how to design languages that are easier to use and prevent or detect many of the worst kinds of mistakes. Recently we've even learned how to do that without giving up the power C programmers need.
Re:problems, lol (Score:5, Informative)
_Generic - Useful for a few things (mostly tgmath.h, which I've rarely seen used in real code because C's type promotion rules make it very dangerous, but it was quite embarrassing that, for 12 years, the C standard mandated a header that could not be implemented in standard C). Existing compilers have all provided a mechanism for doing the same thing (they had to, or they couldn't implement tgmath.h), but it was rarely used in real code. Oh, and the lack of type promotion in _Generic makes it annoyingly verbose: int won't be silently cast to const int, for example, so if you want to handle both then you need to provide int and const int cases, even though it's always safe to use const int where an int is given as the argument.
_Static_assert - useful, but most people had already implemented a similar macro along the lines of:
This gives a 1 or -1 element array, depending on whether x is true. If x is true, the array is optimised away, if x is false then you get a compile-time failure. _Static_assert in the compiler gives better error diagnostic, but doesn't actually increase the power of the language.
And then we get on to the big contributions: threads and atomics. The threading APIs were bogged down in politics. Microsoft wanted a thin wrapper over what win32 provided, everyone else a thin wrapper over what pthreads provided. Instead, we got an API based on a small company that no one had ever heard of's library, which contains a clusterfuck of bad design. For example, the timeouts assume that the real-time clock is monotonic. Other threading libraries fixed this in the '90s and provide timeouts expressed relative to a monotonic clock.
The atomics were lifted from a draft version of the C++11 spec (and, amusingly, meant that C11 had to issue errata for things that were fixed in the final version of C++11). They were also not very well thought through. For example, it's completely permitted in C11 to write _Atomic(struct foo) x, for any size of struct foo, but the performance characteristics will be wildly different depending on that size. It's also possible to write _Atomic(double) x, and any operation on x must save and restore the floating point environment (something that no compiler actually does, because hardly anyone fully implements the Fortran-envy parts of even C99).
In contrast, let's look at what WG21 gave us in the same time:
Lambdas. C with the blocks extension (from Apple, supported by clang on all platforms that clang supports now) actually gives us more powerful closures, and even that part of blocks that doesn't require a runtime library (purely downward funargs) would have been a useful addition to C. Closures are really just a little bit of syntactic sugar on a struct with a function pointer as a field, if you ignore the memory management issues (which C++ did, requiring you to use smart pointers if you want them to persist longer than the function in which they're created). C++14 made them even nicer, by allowing auto as a parameter type, so you can use a generic lambda called from within the function to replace small copied and pasted fragments.
Atomics, which were provided by the library and not the language in C++11. Efficient implementations use compiler builtins, but it's entirely possible to implement them with inline assembly (or out-of-line assembly) and they can be implemented entirely in terms of a one-bit lock primitive if required for microcontroller applications, all within the library. They scale down to small targets a lot better than the C versions (which require invasive changes to the compiler if you want to do anything different to conventional implementations).
Threads: Unlike the C11 mess, C++11 threads provide useful high-level abstractions. Threads that can be started fro
Re:problems, lol (Score:4, Insightful)
The real problem with C is that...
People keep trying to push that, forgetting that people who agreed already switched to C++, or at least are using GCC extensions.
While I don't doubt that there are people who avoided C99 who will love C11, most of the people using C are using C99 and won't be willing to consider adopting whatever was added in `11 until 2020 or later.
I think it is safe to say that the vast majority of people still using C do not want language innovation, they want feature stability.
Re: (Score:2)
Or, you know. You could actually learn how to write good code at the most powerful level. That's a radical thought.
I did, and that's why I'm using Python. I'm capable of writing web services in C, but who the hell's got time for that craziness? Also consider Amdahl's Law [wikipedia.org]: in most of stuff I write, the "running code to process data" bit is a teensy portion of wall clock time. Much more is spent in socket handshaking or waiting for database queries to finish. Out of a 50ms request lifecycle, perhaps 1ms is spent inside a box that I have complete control of. Even if I rewrote it in assembler (C is for high-level pansies) t
Re: (Score:3, Insightful)
If your request takes 50ms to process, you're screwed. That's the PYTHON and Perl world that some people live in.
I spent lots of time working on software where 50 us (1/1000th of 50 ms) was considered too long. Think trading protocols. Even real time audio needs to have full processing in less than 20 ms to prevent lip flap. Gaming has similar requirements (FPS gaming, RTS is admittedly a bit more tolerate of latency.)
50 msec is a scalability concern. If it takes you 50 msec to service a request, that
Re: (Score:2)
Sadly, I'm pretty sure I have shipped code with Python syntax errors in error handling paths. My C or Go might have been buggy, but at least it friggin' compiled!
Your Python program compiled too. If you didn't test every path through the program written in C or python you probably did miss some bugs. Don't blame the language.
Studies consistently show that the number of bugs per thousand lines of code is roughly the same across different languages. For the same functionality, a verbose language like Java will have more bugs than a concise language like Python. Go ahead and write websites in C if you want.
Re: (Score:3)
I write web services for remote clients to send information to. 50 msec includes the time to establish a TCP connection to the nginx frontend (written in C!), then to run a little bit of Python code to massage the request and either store it in a database (probably written in C, or maybe Java) or fetch data from one, then to return the results to the remote client. At a previous employer, my code did that about 80,000 times per second, averaged 24/7. At the shop before that, we load tested to 500,000 reques
Re: (Score:2)
The most valuable resource is my time. I wouldn't use most languages for heavy number crunching (C, or well-written C++), but I wouldn't use C for something that needs to run every night and generate a report. Who cares if it takes 2 seconds as opposed to 1?
Heck, I remember when hand-optimizing the generated asm from a c compiler was a required profession. Of course, optimizing writing code is going to happen really freuently - those who can fix the problem have a strong incentive to do so.
Re: problems, lol (Score:2)
We have learned a lot since C was invented. Everything has weaknesses including C. Technical problems with C include but are not limited to:
* lack of memory safety and the resulting security issues
* null pointers, Tony Hoare's billion dollar mistake
* lack of import mechanism, and the resultant mess of includes
The main strengths of C are its maturity and ubiquity.
The most obvious competitor to C is Rust. That's currently less mature and less ubiquitous, of course. No tool is perfect.
Re: (Score:2)
Re: (Score:2)
Pointer math is a problem.
And if pointer math isn't a problem for you; you have a problem.
Seriously though; pretty much any language is nicer to work with than c. c is still here because none of those language can do everything that c can do nor do it quite as well. It's no good having a language that can do 99% of the work better and 1% of the work not at all.
Re: (Score:2)
C/C++ is finding itself relegated to systems programming and certain niches like games where speed is
Re: problems, lol (Score:3)
Smart people choose their employer based on the project they'd be assigned and the technology they'd work with.
Re: (Score:2)
It's not a popularity contest (Score:5, Insightful)
I don't need a corporate sponsor or a sexy advertising campaign to figure out that if I want something to run on most Linux distributions, as well as the BSDs with minor modifications, C is the obvious choice. Most of the languages being heavily promoted are garbage, that's why companies have to spend money to get anyone to use them. Robust languages don't need a marketing team.
Re:It's not a popularity contest (Score:5, Insightful)
Re: (Score:3)
Re:It's not a popularity contest (Score:5, Informative)
New code is written in Fortran all the time. I guess you don't work in any place doing numerical analysis more complex than Excel. Talk to a Ford engineer some time. I am sure you'd find the same any large auto manufacturer.
Re: (Score:2)
Anything serious and written to stand the test of time is done in C.
Such as my Maxima from 1968...oh, wait...
Re: (Score:2)
You mean Macsyma?
Re: (Score:2)
Re:It's not a popularity contest (Score:4, Interesting)
if I want something to run on most Linux distributions, as well as the BSDs with minor modifications, C is the obvious choice
Well, C++ could make that same claim, as well as many other languages. In fact, some are arguably much *better* at cross-platform functionality.
I think where C shines is that it's sort of a "common denominator" language. Just about every language (C++ included) can make use of a C library, or with minimal effort can create hooks into it, like with C#, Objective-C, Lua, or dozens of other languages that rely on low-level code for lots of their functionality. It's also a reasonably simple language, rather easy to wrap your head around (if written well), and is straightforward to learn, with power enough to get close to the metal when needed. So, if you write some code in C, just about anyone else can use it, even if they have to write a bit of "glue" first.
That makes it a hell of a pragmatic choice for many projects, even considering C's more problematic aspects.
Re: (Score:2)
So what! (Score:5, Insightful)
C is great - love it and if somebody shits on it, even more so!
Moronic Subject for an Article (Score:5, Insightful)
Re: (Score:2)
Re:Moronic Subject for an Article (Score:5, Insightful)
This really is a moronic article. Programming language choice is not about "popular" or "cool" - it's whatever tool gets the job done.
For a hobby? Sure. Otherwise it's about whatever tool gets the paycheck done. Java sucks today and isn't the best tool for any job, yet it dominates the job market. It was a bad tool 15 years ago, and it will be a bad tool 15 years from now, when it will still dominate the job market. And by then, sadly, $10 computers will run Java easily.
C will always be the kernel guy's tool, and those jobs pay nicely, but there will never be very many of them. C++ has faded (despite being a darn good language with the latest standard, too many burned bridges). C# will go down with the Microsoft ship. Will one of the new fad languages have staying power? Maybe. Likely 1 of them will, if not a current one. But fucking Java just refuses to die.
Re: (Score:3)
Java is the new COBOL. Given we need a language for that role, I actually think Java's pretty good.
Re: (Score:2)
FortyCharacterCobolNamesLikeThisForExample and all.
Its really the library not the language (Score:4, Informative)
Java is the new COBOL. Given we need a language for that role, I actually think Java's pretty good.
As one of my professors once argued, its usually the accompanying libraries that make or break a language in more recent years. Java's advantage is simply a "more capable" "standard library".
Also we went recently through a phase in computer science education where people were really only taught java. Its the only tool in their toolbox.
Re:Its really the library not the language (Score:4, Informative)
> Also we went recently through a phase in computer science education where people were really only taught java. Its the only tool in their toolbox.
Yep. I went through the curriculum of the top 10 computer science universities in the country, and all of them teach either Java or Python in their introductory programming classes.
Only a single one (Stanford) even offered C++ as an alternative.
Which is why I'm working on a tool that will hopefully make C++ more appealing to educators, by replacing the traditionally horrendous error messages with an easy to read paragraph targeted at newbie programmers. I'll be presenting it at CppCon next month.
Re: (Score:2)
Re: (Score:2)
Just make your own library. If the language won't let you make a suitable run time library from scratch then it's deficient.
Re:Moronic Subject for an Article (Score:4, Insightful)
So your CFO and auditor can read it?
I don't think you understand the point of COBOL, which is "while it is very long-winded and a struggle to write, it is possible for lay people to read, and (at least the evidence suggests) maintain 50 year old code after the original author has died".
If you write COBOL, you probably spend two days reading the background info and requirements docs for every ten minutes you spend writing code anyway.
Good luck getting an accountant to understand 50 year old Java.
Re: (Score:3)
And people forget what COBOL means - common business oriented language. COBOL is all about data in and data/reports out. It is not about pretty, new shiny.
Re: (Score:2)
Java is the new COBOL
So your CFO and auditor can read it?
I don't think you understand the point of COBOL, which is "while it is very long-winded and a struggle to write, it is possible for lay people to read, and (at least the evidence suggests) maintain 50 year old code after the original author has died".
If you write COBOL, you probably spend two days reading the background info and requirements docs for every ten minutes you spend writing code anyway.
Good luck getting an accountant to understand 50 year old Java.
That's true, in theory. I've also seen COBOL code that's nearly as unreadable as the worst Perl crap I've seen, and I'm pretty sure the reason the original author died is suicide after the boss wanted him to make changes to the damn thing.
Re: (Score:2)
Smart cards with JCOP running Java on top of an 8051, existing today. Slow as hell though.
Re: (Score:3)
Re: (Score:3)
2 decades and continued growth demonstrate languages like Java and Javascript do indeed have that. What precisely is it about Java that you're having so much difficulty with?
What I have difficulty with is understanding what software of any significance in my life is actually written in Java. The last time I installed from scratch didn't even bother installing a java runtime. Didn't see the point.
People keep talking about how these languages are so great and so much better yet the one thing that has always been missing was the translation of that fanboyism into anything useful.
Where are the operating systems and non-trivial games and browsers and codecs and network stacks and
Re: (Score:2)
I believe a significant number of server-side components at Google and Facebook, among others, use Java. That probably is significant to your life.
Re: (Score:2)
"What I have difficulty with is understanding what software of any significance in my life is actually written in Java."
Well if you've never used Amazon, eBay, Google, most Android apps, Minecraft, or used just about any bank, made any transaction via Visa/Mastercard, been served in a shop at a till point, or made an appointment and had your records tracked at a hospital or doctors, then I can understand why you'd think Java is irrelevant. I suspect most people have used those things, and as such, have used
Re: (Score:3)
I think you will find Java software is widely abused - usually with a wide variety of unprintable expletives.
"Some people swear by Java - the rest of us swear at it."
Re: (Score:3)
Re: (Score:3)
BLAS and LINPACK are used everywhere in Engineering tools. Numpy, Scipy, Matlab, Mathematica, et al are all just pretty wrappers on top of the FORTRAN that does the heavy lifting. It's why compiling from source also requires a Fortran compiler.
They've been vetted, tested, vetted more, and been running Engineering applications since the 70s.
A C dialog box and a FORTRAN computation ... (Score:2)
Re: (Score:2)
Having something that 'just works' is not really the prime consideration. Any rewrite has the potential to introduce unknown errors - whether from language constructs, compilation or hitting some odd use case not reached before. Older Fortran (it like that now) and COBOL are extremely well understood programs. The risk/reward of replacement in the new shiny is just not there.
Also, most people (read those not using it) don't know that Fortran has progressed from FOTRAN IV or 77. The current Fortran has j
Re: (Score:3)
If C doesn't have it's own Facebook page, then how can Kanye give it his blessing?
C's problem? (Score:4, Insightful)
C has what problem? Lack of social media popularity with hipster morons? It's a programming language, not a popularity contest. This kind of shit lately on slashdot really starts getting old. Who runs this place?
Re: (Score:2, Insightful)
To some extent it IS a popularity contest. C is no longer taught in many universities so the next gen of programmers won't have any experience with it, which means they'll avoid it for doing projects in their careers. Languages CAN die. Well, not 100% - there are weird things still in use - but in practice they can, if their user base becomes too small. C isn't close to that point at the current time. But if the vector is the wrong way, that isn't a good sign at all.
Re: C's problem? (Score:2)
C does have technical problems including lack of memory safety and null pointers. The state of the art has moved on.
Not that TIOBE has anything to do with that. But if you think C's only problems are PR, think again.
Re: (Score:2)
Actually, there is some connection. These computers generate lots of heat :D
End of coding (Score:4, Insightful)
Us C programmers have already written everything there is to write.
Feel free to reinvent the wheel in various toy languages if that is what makes you happy, I soon will retire and won't care.
Consider the methodology (Score:4, Informative)
Basically the calculation comes down to counting hits for the search query "language programming" [tiobe.com]
It doesn't matter if those results are positive or negative. All that matters is the number. If you make a language and get ten billion people to post on indexed sites about how badly your language sucks, your language would take the top spot on the TIOBE Index.
So... yeah. This is about as lame of an index as you could possibly come up with.
Re: (Score:2)
Yeah, it sucks, but, then, C not an easy language (Score:2)
Yeah, it sucks, but, then, C not an easy programming environment.
Pointer arithmetic aside, I remember the days when you had to run a preprocessor to be able have a C program to query a database. As bad as the code we wrote had looked for consumption by the preprocessor, the code coming out the other end of it was barely readable and nearly impossible to debug and profile.
So we had to write stubs that return baked database data structures during development to keep our sanity and be able to even debug the t
Re: (Score:2, Insightful)
The problem is not C's fault.
Some macro packages are indeed horrid. That's not C's fault. Its absolutely possible to beautiful APIs in C. The UNIX file descriptor API is probably one of the first examples of object oriented programming and polymorphism, yet nobody ever gives it credit.
You do have to be able to manage pointers and memory in C, and if you use threads you have to be able to deal with currency. This is not rocket science, but it requires diligence.
I am particularly fond of Golang's C "flavo
C is useful (Score:2)
So I guess I should bump my rates up? (Score:2)
It's not like C is going away anytime soon, but if there are fewer new C programmers coming online, maybe I don't have to worry about being put out to pasture?
TIOBE (Score:2)
While I think TIOBE is interesting, I'd never advise anyone to either take it too seriously, or base any of the above quoted decisions on it. Deciding on used languages based on search engine results - if you do that, I'd bet you don't advertise it during your interviews.
Re: (Score:2)
No, you're wrong. We should base all of our business decisions on the whims of the Internet.
Overall I prefer the IEEE stats more (Score:3)
The IEEE seems to have a much better methodology and ways to look at the data based on web, mobile, enterprise and embedded markets.
http://spectrum.ieee.org/stati... [ieee.org]
It just seems that the TIOBE results are much easier to bias by things like universities using a language as a teaching language. There are far more online courses on things like java and languages commonly used for web work but that does not make them more commonly used just more common to have webpages written about them.
I wonder what Richie thought way back when (Score:2)
If you asked Richie back in the early 70s whether he thought it would be a major language in 40 years time, I wonder what he'd say?
New to programming and C is my first choice (Score:2)
In other exciting news (Score:5, Insightful)
Stay tuned for next month's exciting random statistical variations and the inane commentary from bloggers desperate for clicks!
C programmers don't need to consult the web (Score:5, Insightful)
This TIOBE index relies [tiobe.com] on web queries for each programming language. Frankly, C programmers don't need to ask questions about the language itself since it is so simple.
I'm not questioning the popularity of the various languages but it seems to me that this metric favours the more complex languages.
Finally, in the embedded real-time space, there is still no real substitute for C.
Ok, it's down, but those are weird reasons (Score:3)
It's still #2. And twice the index score of #3.
mobile app development. ... The constraint that C object code should remain small and fast doesn't help here.
Huh? That seems like exactly the sort of area where small and fast would help immensely.
I still find it infuriating when I want to have half a second for this clunky program on my phone to do it's thing.
Moreover the C programming language doesn't evolve like the other big languages such as Java, C++ and C#. There is a "new" C11 standard available but this contains only minor changes.
The language being stable is a good thing. A shining feature. Unless you enjoy all your skills turning to dust as you have to adapt to an ever changing platform. Who likes to build a house on shifting sand?
Yet another reason why C is getting into trouble is that there is no big company promoting the language. Oracle supports Java, Microsoft supports C++, C# and TypeScript, Google supports Java, Python, Go, Dart and JavaScript, Apple promotes Swift and Objective-C, etc. but none of them supports C publicly.
Also kind of a good thing. Because it's "Oracle, where tech goes to die". And Microsoft, where they keep bloody changing everything because some minor boss somewhere gets a bonus if he can convince 9% of the MS developer base to register with SilverLight tools, or how Sharepoint is "the next big thing". And frankly, I was surprised that every Go project wasn't mandated to direct their users to go sign up for google+.
C is punk. Fuck corporate.
It's portable as all fucking get-out. Low enough that you can make it smokin' fast. And it doesn't play any games with magical crap you can't see. The code is truth in advertising (unless you fuck around with macros like an idiot), and that makes it easier to debug. And everything as C APIs, so if there's a library out there you want you can typically go hook into it. Every bloody language has weird quirks and nuances you just have to be aware of. The tools that help you use the language are where it's at. MVS, while run by Satan, is actually pretty decent. But the classic C tools of makefiles, gcc or clang, and vim are powerhouses of usability that have been refined for decades. It's not the best if you want to talk to browsers. Javascript is the defacto standard there. And it's not the best if you just want to make yet another GUI button clicker for clueless suit. And Bash or whatever script of choice glues together the solutions of yesterday. But C is what you whip out for the hard cases for real meaningful programming. And certainly for anything critical like life support, satellites, weapon platforms, or kernels.
Re: (Score:2)
Why will Rust succeed where D has failed? Why not Go, Nim(rod), Scala, or Haxe?
(I think I already know why not Erlang, Haskell, or OCaml)
PS - omitting of python, ruby, js, and groovy is intentional
Re: (Score:3)
Rust allows programming "closer to the metal" than those languages. For example, Go, Nim, Scala and Haxe all require a garbage collector in practice for significantly complex programs. This makes it difficult (or at least heavyweight) to embed components in those languages into other languages and makes memory usage more difficult to reason about. This makes it easier to use Rust as a drop-in replacement for C or C++.
(Rust has other advantages over each of those other languages too.)
Re: (Score:3, Funny)
Re: (Score:2)
Snobol 4 forevers!
Re: (Score:2)
I don't know if rust will succeed. It's the only one capable, really.
Rust basically has the same machine model as C and C++, but with a different syntax. There's nothing you can do in a more efficient and economical (e.g. memory, cycles) way in C compared to Rust.
The rest have garbage collection which basically rules them out and in addition do not have proper zero cost abstractions. They're prepared to burn cycles to make the programmer's life easier.
The exception to that is D. D can sort of run perfectly