C Beats Java As Number One Language According To TIOBE Index 535
mikejuk writes "Every January it is traditional to compare the state of the languages as indicated by the TIOBE index. So what's up and what's down this year? There have been headlines that C# is the language of the year, but this is based on a new language index. What the TIOBE index shows is that Java is no longer number one as it has been beaten by C — yes C not C++ or even Objective C."
Woohoo (Score:2, Interesting)
Go C!
Re:Woohoo (Score:5, Funny)
Go C!
Actually, Go has some catching up to do on C.
Re:Woohoo (Score:5, Funny)
oh no you don't
my friend told me to visit go c before
i'm not falling for that one again
Re:Woohoo (Score:4, Interesting)
Not going to complain about that.
It's depressing that Objective-C, Ruby and VB.Net have gone up, and see C# go down...
But nice to see C and Bash go up, as well as Java go down. Then again, Java goes down on everything, that's how much it blows. I need a job that doesn't require me to program so much of that. Oh well, occasionally I can get to use C, Bash or Python...
Re: (Score:3, Insightful)
It's depressing that Objective-C, Ruby and VB.Net have gone up, and see C# go down...
It's depressing to see a Microsoft-proprietary language, that they're not even supporting on one of their most recent platforms, go down in popularity? Really?
Re: (Score:3)
It's hard to take a vendor and OS locked language seriously. When so much is going cloud and so much of cloud is on Linux... Microsoft only languages just can't compete. There doesn't seem to be much hope for them in the mobile world either because WP isn't doing much but being laughed out of the market. (Is there even a VB for WP? Bah; it doesn't even matter.)
While there may be some some killer features to VB, there's also some killer draw backs. There's no such thing as portable VB. If it's not a d
Re: (Score:3)
Re: (Score:3)
No, the mono libraries are NOT incompatible.
Most of the mono libraries are a compatible subset of the Microsoft libs (with what is/isn't compatible clearly defined).
There is the "incompatible" GTK# library, but you can download GTK for Windows and fix that problem quickly enough.
Yes, they won't implement some libraries (WPF... Which is garbage anyway, though enough people have drank that kool-aide, and parts the overly-convoluted entity framework), but those tend to be somewhat niche parts.
Java tends to use
Re: (Score:3)
Without the middle-man:
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html [tiobe.com]
Dying gasps (Score:3, Funny)
Doesn't a dying star expand into giant before it dies?
Re:Dying gasps (Score:5, Informative)
You would be surprised how many mission critical embedded systems - are still being written in C
Re:Dying gasps (Score:5, Funny)
Re:Dying gasps (Score:4, Funny)
I kid.
Re:Dying gasps (Score:4, Interesting)
Oh snap.
See, displying "Yay! it fit in the memory they gave me!" can't be 7 megs.
C was only ever a shorthand for PDP-11 machine language, (back when C was young we'd routinely look at the compiler output. At that point it was passing arguments in registers and Dave Conroy sat in the next cube over working on what has today morphed into* gcc. That's one long lived piece of code.) and in tight spaces and critical loops you want machine language.
Romable node.js would be the only thing I'd consider other the C for embedded code. I don't mind paying that overhead for the inherent asynchronous I/O advantages;, you have to muck around in C a lot to do that so it's worth the trade-off. Anything else just didn't bring enough to the table to warrant the overhead IMO.
Contemporary support for C outside of Bell labs was because of embedded code (a camera gantry project, later, the Halifax postal processing plant) - the RSX11M C compiler written for that became DECUS C which went public and then went everywhere, including replacing the Bell compiler.
* Yeah I know the claim is gcc is a clean rewrite, but logging into toad.com in the early 90s I found DGC commented source in the mix. Jon wasn't aware of it apparently...
Re: (Score:2)
Critical systems written by vendors other than Microsoft?
Re: (Score:2, Insightful)
If you think the failures are due to the language being selected, you're the problem, not C#.
Re: (Score:3)
Re: (Score:3)
Re: (Score:3)
a less well documented language like Java
Are you serious? WTF are you smoking? Java is very well documented.
Re: (Score:3)
provided you follow what's listed on the Mono project as compatible, you get better cross platform compatibility as well.
That proviso you listed is a *major flaw* in Mono. Cross-platform always was important but is becoming more important as time goes one - the computing environment is becoming more heterogeneous after a decade decrease in diversity. Java has its full set of libraries that work on *every* platform, which means it is a better strategic (long term) choice than C#/Mono.
Like Java, C# will be attractive to nubblecake coders due to the ease of use,
Ah! hubris and ego. You do know that with even a little critical analysis you'd come to the conclusion that you ought to choose as simple langua
Re:Dying gasps (Score:5, Funny)
Re:Dying gasps (Score:5, Insightful)
Not really. While I agree that C is a bad language, it has no competition in low-level coding. With embedded systems gaining ground, more and more people will start to use it. Although C++ could take its role and it even fixes many of its shortcomings (e.g. namespaces), it's very easy to misuse, so most project leaders don't trust their collegues with it. What would people switch to? Forth, Pascal?
Re:Dying gasps (Score:5, Insightful)
But if you're starting new big applications for the PC in C, you're probably insane.
Re: (Score:3)
Re: (Score:3)
Re: (Score:3)
As for multiple threads,
Re: (Score:3)
Embedded systems would explain the growth,
Java though... makes me doubt the validity of TIOBE heavily, object-C doesn't help either, I get that there's a lot of android/iOS programming going on (I believe t
Re: (Score:3)
Java though... makes me doubt the validity of TIOBE heavily, object-C doesn't help either, I get that there's a lot of android/iOS programming going on (I believe this is what object-C is used for mostly nowadays, but... more than 90% of businesses combined using .NET... doubtful). Maybe if TIOBE was based on +/- % changes I'd understanding, but as an overall popularity index, businesses have the $, and businesses use .NET unless they're web based...
And therein lies the rub in your argument. Many companies actually are web based. Many others are into mobile. And a shit ton of stuff is embedded or low level enough that .Net isn't even an option.
In my own industry (telco/finance), hardly anyone I'm aware of uses C# or VB.Net. It's almost all C for the low level stuff, Java for the enterprisy stuff, and java/Obj-C for mobile stuff. Oh, and there's some COBOL for legacy stuff, too.
In my brother's (automation/machine tools), it's mostly C for low level stuf
What would you use? (Score:2)
What would people switch to? Forth, Pascal?
About 25 years ago, working in an embedded product company, I had a friendly little argument with my software colleagues (me design hardware, UGH!) They insisted that there was nothing around that could compete with the C-compiler-that-later-became-Microsoft's for tight compiled code. So we had a little contest: they wrote a chunk of our kind of code in C, and I did it in Modula-2 (Logitech's compiler.) In both cases we were building reusable code with object methods.
Quite enlightening.
How the comparison
Re:Dying gasps (Score:4, Interesting)
> While I agree that C is a bad language, it has no competition in low-level coding.
Mostly agree. Although I prefer turning all the crap in C++ off to get better compiler support.
> Although C++ could take its role and it even fixes many of its shortcomings (e.g. namespaces)
Uh, you don't remembered "Embedded C++" back in the late 90's early 00's ?
If you think namespaces are part of the problems you really don't understand the complexity of C++ at _run_time_ ...
Namely:
* Exception Handling
* RTTI
* dynamic memory allocation and the crappy way new/delete handle out of memory
* dynamic casts
* no _standard_ way to specify order of global constructors/destructors
Embedded systems NEED to be deterministic, otherwise you are just gambling with a time-bomb.
http://en.wikipedia.org/wiki/Embedded_C%2B%2B [wikipedia.org]
--
There are 2 problems with C++. Its design and implementation.
Re:Dying gasps (Score:4, Interesting)
After you accept the constraints of an embbebed environment and low level access, C is not a bad language anymore. Any language useable on that kind of environment is at least as bad as C.
Re:Dying gasps (Score:5, Interesting)
I've been using C for so long that I think I've lost objectivity. C is the first language I learned (other than line numbered basic.) In my mind, C is the language all other languages are judged against.
But if there's any truth to this (when did the TIOBE index become the official word?) it makes me wonder if it's not C itself that is making a comeback, but good old fashioned procedural style programming.
All these fancy new languages with their polymorphism, encapsulation, templates and functional features have lost their sparkle. Programmers are rediscovering that there isn't anything you can't do (even runtime polymorphism) with just functions, structs, arrays and pointers. It can be easier to understand, and although it may be more typing, it has the virtue that you know exactly what the compiler is going to do with it.
Re: (Score:3, Insightful)
Object-oriented is good for projects that need to be maintained. But it comes with additional complexity that programmers need to learn and track. It's only feasible for very large projects with multiple developers working on multiplel branches of development, and even then, it requires a very good maintainer, or it's too easy to fuck everything up. The infrastructure necessary to do good OO quickly gets as expensive and as complex as the problem the OO paradigm is trying to solve.
Procedural is the simplies
Re:Dying gasps (Score:4, Insightful)
Let me shout it loud: Premature classification is the root of all evil!
Re: (Score:3)
E.g. you don't really want a single class of Image as a container of Pixel classes for each bit depth, that's rather wrong classification. It may make more sense to stop subdivision at image level and have a number of classes that represent images of different bit depth/ number of channels. Or, it may be even better to take
Re: (Score:3)
.NET Micro Framework? for systems with 64K of RAM and 256K of storage. That gives you C# and VB.
As a bonus you get emulators and debugging built in and its open source under an Apache license.
Re: (Score:3)
Yeah, I'm of the opinion that a person who cannot properly use C (and understand how memory management works) has no business writing mission-critical software in any language. JVM's garbage collector is for sissies. =P
Re:Dying gasps (Score:5, Insightful)
Just because the language doesn't hold your hand and make sure you don't mess up doesn't necessarily make it a "bad" language. C++ could never fully take C's role due to the name mangling that C++ requires. I use and like C++ but there are somethings that are best left to C. Especially if you're binding compiled code to some interpreted language (e.g. Perl, Python, or Ruby) to speed up some computationally intensive portion of an application.
Re: (Score:3)
The enduring popularity and success of C is a strong argument that there aren't any really bad languages - that language design just doesn't matter very much. That designing new languages is largely a waste of time. The only real requirement for a language is that it gives you enough control to do whatever you want; from there you can get anywhere, and you can also write progressively higher levels of APIs t
Re:Dying gasps (Score:5, Interesting)
Not really. While I agree that C is a bad language, it has no competition in low-level coding.
Oh, there's competion, just not much because it's not wanted or needed. As a hobby I started building an x86 OS from scratch with only a hex editor. From there created an assembler in machine code, then used it to create a small text editor and then assemble a disassembler, then disassembled the assembler (to save me from re-entering ASM), then I began work on creating my own system level language from scratch to build the OS with. The thing is, if you want to make the leanest language just barely above the metal, but still be cross platform, guess what you get? You get C. Seriously.
My syntax was different, but because the op-codes (eg: jmp, the movs and push, pop, call, ret, enter, leave, protected mode & architecture features like the MMU, restricting use of code & stack registers, etc. when you add any features (like functions) you end up creating something almost exactly like C in all but name. The architecture is responsible for C, it's a product of its environment. For instance, I wanted to use multiple stacks: a separate stack for the call stack and another one for parameters / local vars / etc -- In fact I wanted to extend that to support co-routines at the lowest levels possible, all while eliminating stack smashing as a direct exploit vector -- Ah, but because of the way Virtual Memory Addressing works, and because there are dedicated operations for doing single stack per thread function calling, there's a huge performance hit to doing things in other ways down at the low level (I figured out a few tricks, but it's still slower than C functions).
Now, most folks wouldn't tolerate a system level language that was any more inefficient than it had to be, and slightly contrary to the way things want to work at the hardware level just to add features globally that many programs don't need (e.g. namespaces, call-stack security, co-routines, etc), so they'll follow the restrictions of the system and the language produced will come out to be just like C, maybe with slightly different syntax, but all the same idioms. Maybe function calling would be something other than CDECL (instead, for variadics, I pass the number of parameters in a register, and have the callee clean up the stack, reduces code size a bit -- and I have other reasons), but even this is possible to do now in C too at the compiler level. Even when you get to adding OOP to the language, you run into C++ and it's problem with diamond inheritance, and dynamic casting (if you do things the most efficient way possible) -- I allow virtual variables as well as functions to eliminate the diamond inheritance issue with shared bases having variables -- Just make them "virtual", like you would a function, it's slower, another layer of indirection, but if I did it the fast way I'd just be re-implementing C++!
There's a fine line I'm walking, a little too far from the architecture / ASM and my language might as well run via VM, a little less and I might as well just use C/C++. So, the space we have to innovate in to squeeze more worth out of a compilable language isn't really that big. Indeed, when I take a look at GoLang disassembled I see all the same familiar C idioms -- They just give you a nicer API for some things like concurrency, and add a few (inefficient) layers of indirection to do things like duck-typing. Great for application level logic, but I'd still write an OS and its drivers in a C like language instead.
There's a reason why C "has no competition in low-level coding" It's because we don't need a different syntax for low level coding, it's done. As a language designer / implementer when I hear folks say "C is a bad language" I chuckle under my breath and think they might be noobs. Maybe you meant the design by committee approach sucks, but probably not. The features C has it needs to have, the syntax it has, it needs to have, e.g., pointer to a pointer to a
Re: (Score:3)
Not really.
They're different languages that happen to run on the JVM.
You should then include JRuby and Jython under Java too.
C# and VB.NET both run on the CLR. Should they be combined?
Perhaps you should include everything under "x86" or "ARM".
Yes, unfortunately TIOBE is bollocks. (Score:5, Informative)
Seriously, for the last fucking time, can we stop posting on Slashdot random shit picked up from TIOBE? The TIOBE index is so completely and utterly full of fail that I can't believe people are STILL clinging onto it as evidence of anything whatsoever.
It shouldn't be traditional to do anything with TIOBE, except perhaps laugh at it or set it on fire.
So once last time, one final fucking time I'll try and explain to the 'tards who think it has any merit whatsoever why it absolutely does not.
We start here, with the TIOBE index definition, the horses mouth explanation of how they cludge together this table of bollocks they call and "index":
http://www.tiobe.com/index.php/content/paperinfo/tpci/tpci_definition.htm [tiobe.com]
First, there is their definition of programming language. They require two criteria, these are:
1) That the language have an entry on Wikipedia
2) That the language be Turing complete
This means that if I go and delete the Wikipedia entry on C, right this moment, it is no longer a programming language, and hence no longer beating anything. Apparently.
The next step, is to scroll past the big list of languages, to the ratings section, where we see that they state they take the top 9 sites on Alexa that have a search option, and they execute the search:
+" programming"
Then weight the results as follows:
Google: 30%
Blogger: 30%
Wikipedia: 15%
YouTube: 9%
Baidu: 6%
Yahoo!: 3%
Bing: 3%
Amazon: 3%
The first problem here is with search engines like Google, I run this query against C++ and note the following:
"About 21,500,000 results"
In other words, Google's figure is hardly anything like a reasonable estimate because a) Most these results are fucking bollocks, and b) The number is at best a ballpark - this accounts for 30% of the weighting.
The next problem is that Blogger, Wikipedia, and YouTube account for 54% of the weighting. These are all sites that have user generated content, as such you could literally, right now, pick one of the lowest languages on the list, and go create a bunch of fake accounts, talking about it, and turn it into the fastest growing language of the moment quite trivially.
To cite an example, I just ran their query on English Wikipedia for the PILOT programming language and got one result. A few fake or modified Wikipedia entries later and tada, suddenly PILOT has grown massively in popularity.
The next point is the following:
"Possible false positives for a query are already filtered out in the definition of "hits(PL,SE)". This is done by using a manually determined confidence factor per query."
In other words yes, they apply an utterly arbitrary decision to each language about what does and doesn't count. Or to put it simply, they apply a completely arbitrary factor in which you can have no confidence of being of any actual worth. I say this because further down they have a list of terms they filter out manually, they have a list of the confidence factors they use, and it takes little more than a second to realise massive gaps and failings in these confidence factors.
For example, they have 100% confidence in the language "Scheme" with the exceptions "tv", and "channel" - I mean really? the word Scheme wouldn't possibly used for anything else? Seriously?
So can we finally put to bed the idea that TIOBE tells us anything of any value whatsoever? As I've pointed out before a far better methodology would at least taken into account important programming sites like Stack Overflow, but ideally you'd simply refer to job advert listings on job sites across the globe - these will tell you far more about what languages are sought after, what languages are being used, and what languages are growing in popularity than any of this shit.
Finally I do recall last year stumbling across a competitor to TIOBE that was at least slightly better but still not ap
Re: (Score:2)
I think someone should mod AC informative. This does sound like a worthless statistic.
Re: (Score:3)
Thanks a lot for making this write-up. Now I can just post a link to it every time someone submits yet another TIOBE story.
Re: (Score:3)
But they don't seem to follow their own rules. PowerShell [wikipedia.org] has a Wikipedia page, why isn't it listed?
More confusingly, if you code in VBScript are you included in the classic VB bucket? What about JScript and JavaScript? If so, fine. But if not, than there's two other languages they're excluding despite their own rules.
Since VBScript and JScript aren't listed individually, I assume that JScript queries are all counted as JavaScript. Ok fine. But wait... ActionScript does not! What's the difference between JS
...Bash? (Score:5, Interesting)
Re:...Bash? (Score:5, Insightful)
More like something is wrong with the measuring system being used.
Re:...Bash? (Score:5, Informative)
Yep, they use frequency of search on the internet for the language to estimate. Which means confusing, and easily broken languages like C, and infrequently used(and thus easily forgotten) languages like bash get a huge leg-up.
Re: (Score:2)
Yep, they use frequency of search on the internet for the language to estimate. Which means confusing, and easily broken languages like C, and infrequently used(and thus easily forgotten) languages like bash get a huge leg-up.
How come BATCH (.BAT) isn't on there, then?
Re: (Score:2)
Yeah, I think it also has a lot to do with how much reference is needed for a particular language. Bash, perl and PHP are all odd ducks. Searching for things about them are more indicative of how messed up their syntax is, rather than a measure of their usage.
a bit of latency (Score:5, Interesting)
Java will come back to number 1 in a few years thanks to Android...
Re:a bit of latency (Score:5, Informative)
Here they have the most popular iOS game development library ported for programming on android in C++.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
And if it doesn't can we finally put the notion of the inevitable ascendency of Android to rest?
Re: (Score:3)
Re: (Score:2)
Don't feed trolls!
definition (Score:5, Informative)
thx, bye.
Re: (Score:3)
Re: (Score:2)
So it isn't really about usage then.
Bash gets a lot of hits because it is a popular shell, not because so many people want to program in it.
C gets some lift because of so many C-like languages and C bindings used by people are not necessarily programming in C.
Re: (Score:2)
So its definition of "popularity" is: "I'm trying to use this language, but I don't know how." This may say more about the number of C programs whose original authors have left the field, than the number of new C programs being written.
The other one (Score:5, Informative)
Is called PYPL (PopularitY of Programming Languages), and it ranked C# as #1 and C down in #5 based on a different methadology. Honestly, they both sound pretty silly to me.
https://sites.google.com/site/pydatalog/pypl/PyPL-PopularitY-of-Programming-Language [google.com]
Using the TIOBE methodology (Score:5, Funny)
- Abduction by alien
- Going to prison
- Dying
Re: (Score:2)
Using the TIOBE methodology, I deduce that the following activities are more popular that C Programming: - Abduction by alien - Going to prison - Dying
Yeah, I program in C a lot, and that sounds about right.
Re:Using the TIOBE methodology (Score:4, Funny)
Well hey, dying is an activity practised at least once by the entire population of this planet.
Not surprising (Score:4, Informative)
Xbox Live Indie Games and several others (Score:2)
C is the best overall language, it spans every platform I can think of
I can think of several platforms that C doesn't easily span. Xbox Live Indie Games and Windows Phone 7 only support C#, the Web only supports JavaScript, Flash Player only supports ActionScript and other languages that compile to ActionScript bytecode, and the Java applet environment and MIDP phones only support Java and other languages that compile to JVM bytecode. Or are you counting Emscripten as "C support"?
XBL Arcade vs. Indie Games (Score:3)
Ok, think about the statement. Then tell me how many XBox GAMES are written in C#...
Xbox Live Marketplace has two separate environments. The Arcade environment allows C but is open only to established studios. The XNA environment, called "Indie Games" in the menu, is open to any startup with $99 per year but requires that all applications be compiled to verifiably type-safe, Emit-free, P/Invoke-free CIL, which in effect requires C#.
TIOBE algorithms (Score:5, Insightful)
Clearly C is more popular as more people complain about it sucking.
C sucks -- About 321,000,000 results
bash sucks -- About 7,500,000 results
Java sucks -- About 5,810,000 results
c++ sucks -- About 898,000 results
objective c sucks -- About 293,000 results
Re: (Score:2, Informative)
Jets suck -- About 4,770,000 results
Yankees suck -- About 1,430,000 results
Knicks suck -- About 1,370,000 results
Krypton sucks -- About 166,000 results
Re:TIOBE algorithms (Score:5, Funny)
I think you mean:
- php sucks: 500 Internal server error
C Just works (Score:5, Insightful)
But on a whole other level my claim with most higher level languages ranging from PHP to
But where C is a project killer is the whole weakest link in the chain thing. If you have a large project with many programmers as is typically found in a large business system working on many different modules that basically work on the same data set that a safer language like Java is far far better. I am pretty sure that if the business programmers working on projects that I have seen were to have used C instead of Java that those server systems would crash more than once a minute. You can still program pretty badly in Java but a decent programmer shouldn't blow the system apart. Whereas a decent C programmer might not be good enough for a large project.
So the story is not if C is better than say Java but what is the best language for any given problem set. I find broad systems, like those found in the typical business, with many programmers of various skill levels are idea for Java. But for deep system where you layer more and more difficulty on a single problem such as real-time robotic vision that C or C++ are far superior. A simple way to figure out what is the best language is to not compare strengths and weaknesses generally but how they apply to the problem at hand. In a large business system where horsepower is plentiful then garbage collection is good and pointers are only going to be a liability. But if you are pushing up to the limits of what the machine can do such as a game then a crazy pointer dance might be the only possible solution and thus demand C or even ASM.
Lastly do you want your OS programmed in Java?
Parallelism (Score:2)
C and C++ are still the best languages for parallelism, in particular vectorization and shared memory systems.
C used in your favorite programming language (Score:2)
Re:C used in your favorite programming language (Score:4, Informative)
It should be noted that for most programming languages, it is highly likely that the compiler and other code used for most if not all programming languages are written in C.
And the C compilers are written in C++. LLVM has been C++ from the beginning, GCC is transitioning to C++ and is now being built with G++, not GCC, and allows C++ constructs in the code. I think many JVMs are written in C++, too.
As predicted (Score:3)
C a bad language? Compared to what? (Score:5, Insightful)
C is a bad language to the extent that it lets do what you want, even if that means shooting yourself in the foot. A language that would marry C's strengths while providing safeguards against buffer overruns and other ills would be an oxymoron.
If you have a section of code that is particularly time critical, you could write it in assembly as many people do. I prefer to actually write it in C but check the assembly output from the compiler, and optimize the C source until I am happy with the result. In all cases I have been able to achieve my objectives this way without actually having to insert a block of assembly (not all compilers let you do that in-line). The resulting code is still very easy to read (for me down the road or anyone else) while being efficient.
C is not the Swiss army knife of software (even though if one language qualified, C would be the closest), but it has its areas of expertise. In the world of small embedded systems, there is simply no alternative worth considering (and few alternatives available.)
For desktop applications, not so great (and I speak of experience.)
Re: (Score:3)
C could be a better language if it got rid of some idiosyncrasies, like its weird declarator syntax (it's the only language I know of that had tools like cdecl [die.net] written for it), or stillborn features like separate namespaces for structs/enums/unions (that everyone works around by using typedefs), or certain unsafeties in the language itself - e.g. implicit downcast from void* to any pointer type and from double to int, or mixed signed/unsigned arithmetic being perfectly a-ok but not doing what you expect hal
Number One? (Score:4, Funny)
Yes but which one is number zero?
Not a surprise (Score:3)
C programmers have an understanding of the machine they use that Java people will never be able to reach. The only advantage Java programmers have is that they are cheap. Or better, they look cheap to management. In fact they are hugely expensive because most will write code that sucks badly.
Re:C? (Score:5, Insightful)
Re:C? (Score:5, Insightful)
Re:C? (Score:5, Interesting)
And why not C++? It has a number of advantages over C...
Re: (Score:2, Interesting)
Name three
Re: (Score:2, Insightful)
Those aren't clear advantages. Rather, they're a shortcut toward writing shitty code.
Re:C? (Score:4, Insightful)
The name of the fallacy you just demonstrated is "No True Scotsman".
Re: (Score:3)
Name three true Scotsmen!
Re:C? (Score:5, Funny)
Boo-ya.
Re: (Score:3)
Re: (Score:2)
Encapsulation - the ability to hide functions inside classes is a far bigger feature of C++ than any of the above.
Additionally, C++ has the advantage that you can write one piece of code that can compile either in C++ or in C, which can be a huge advantage when doing communications code with embedded systems.
Re:C? (Score:5, Informative)
Encapsulation - the ability to hide functions inside classes is a far bigger feature of C++ than any of the above.
And how do you hide functions? You put them behind a "private" or "protected" access specifier, but you still have to show them in the class definition in the header file. That's not hiding. That's saying "look at all my nifty functions, none of which you can use, neener neener neener".
In C you prefix those functions with a "static" keyword, and they aren't visible anywhere outside the original source file. Once you compile them into a .o file it's as if they never existed. That is hiding.
Re: (Score:3)
Labeling a C function "static" makes it invisible outside of the source file, and uncallable from anywhere else in the program.
That's how we C programmers practiced encapsulation way back in the '70s.
Experiment (Score:2, Insightful)
Write "Hello World" or any other program you desire in C and in C++.
Now look at the executable size.
Run it through a profiler and see execution time.
Now ask yourself, which language would you want to use on a system that has very limited resources without breaking out the assembler?
Re: (Score:2)
C++ causes more problems than it solves.
If you're using C++, you should probably be using C. If C isn't a good fit for your project, C++ isn't likely to be the answer.
Re: (Score:3)
C++ causes more problems than it solves.
Only if you are a poor programmer.
C++ gives you much more power than C. That power gives much more opportunity for use or abuse. If you abuse it, that's your fault for being a bad programmer.
And now I'm going to go back to writing very efficient progrmams using elegant, high level and efficient libraries in C++ of the sort that simply do not exist in C.
Re:C? (Score:5, Insightful)
Re: (Score:2)
Uh, pretty much everything?
Re:C? (Score:5, Interesting)
So most of the public will go through their day probably using C or C++ based code 99% of the time and a bit will be say the timesheet software running Java that they access through their C based browser using C based network drivers on viewed through a video card with C based drivers on a C based OS with their packets going through C based routers and switches after using a C based security system to get into the building where they used a C based elevator system to get up to work. Of course many of the above systems use a smattering of other bits such as scripting libraries but those are being run by a C library. The only other language that the average person might encounter would be some Objective-C on their iPhone or some Java on their Android; but again those OS's are basically C.
When they get home and browse the web they then get the full onslaught of servers running a dog's breakfast of PHP, Java, RoR, etc. But those servers are all programmed in.... you guessed it C.
Re: (Score:3)
the virtual machine that runs your Java code?
Re: (Score:2)
Javascript is a special case because it is used almost exclusively for writing front-end code for websites. Not because front-end web developers love Javascript, but because browsers do not support any other language.
So in one specific field (front-end web applications), Javascript is king because developers have no other choice. But next to nobody uses the language for anything else than that. It could be used for other stuff (node.js etc.), but that's not significant by a long shot.