Google Engineer Decries Complexity of Java, C++
snydeq writes "Google distinguished engineer Rob Pike ripped the use of Java and C++ during his keynote at OSCON, saying that these 'industrial programming languages' are way too complex and not adequately suited for today's computing environments. 'I think these languages are too hard to use, too subtle, too intricate. They're far too verbose and their subtlety, intricacy and verbosity seem to be increasing over time. They're oversold, and used far too broadly,' Pike said. 'How do we have stuff like this [get to be] the standard way of computing that is taught in schools and is used in industry? [This sort of programming] is very bureaucratic. Every step must be justified to the compiler.' Pike also spoke out against the performance of interpreted languages and dynamic typing."
No,
What this world needs is competent programmers. C++ too hard for you? You shouldn't be programming. It's that simple.
"Efficient" languages are too complex. "Simple" languages are too inefficient.
Normally I'd write this off as "duh" but this is Rob Pike.
Oh wait, he's pushing something new that somehow manages to be easy and efficient? OK...
Pike detailed the shortcomings of such languages as a way of describing the goals that he and other Google engineers have for a new programming language they developed, called Go.
Oh, so he's pushing a competing product and denigrating his competition? Nothing to see here, I think.
Should have RTFA I guess, I now realize Mr Pike just talks in circles and really didn't have anything of value to say other than 'programming is hard'.
Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
And where is the news here?
Picking the right tool for the job doesn't just cut down half the work time, but can help offset what sloppy workers do to destroy quality.
C++, Java, perl, C, forth, and sh are all different languages, and well suited to different jobs. But when all you have is a nailgun (i.e. all you are fluent in is a single language), every project starts looking like nailgun job, including your own foot.
Google Engineer promotes Google language Go and claims it addresses weaknesses of existing languages, including Java and C++.
Democracy Now! - your daily, uncensored, corporate-free
How about "Rob Pike Decries Complexity of Java, C++" instead?
|Rob Pike| >> |Google Engineer|
These sorts of languages (and the underlying religious cults they bring with them) are probably appropriate for some uses. But what I see done in my life-critical real-time processor applications borders on criminal. Data hiding? How the f'ing hell do I check what is going on to the bit level is some twit determined to "hide the data". This is particularly apt right now, because we are adding a feature to our code that was almost trivial to add to our FORTRAN simulations, and because of the "cult of classes" C++ programming it's damn near impossible in the final product, and completely impossible to look at and tell what the heck it's doing. Trying to test it like a black box is never going to get to the level we need.
We started having peer reviews of the code, and my colleagues and I are the designers of the system, so we would hypothetically need to sign off on it. We went for two hours to get 10 lines into it, no one could explain how it was working but that we should just "trust the compiler". That didn't fly with us, so the solution was to *not have us present at the peer reviews* since we were "disruptive"
What we need is someone that can write straightforward procedural code, but no one seem to be willing or able to do it any more. It has all the features of a cult or a secret society, even when you get someone to understand and agree, they won't deviate from their dogma.
Linus has a fetish for C. He'll say anything.
Almost everyone programming computers these days seems to be too eager to forget what the computer is actually calculating. When you are writing software that has any need to perform within certain memory or time constraints, or scale to any degree at all, you need to understand your program at that level.
For example, for high performance searching it is critical to understand pointer arithmetic to build an effective hash table. Without that, either your substitute search algorithm doesn't scale efficiently, or you're depending on a likely-less-than-optimal generic library.
I knew a database developer who insisted that each record in a database match the block size of the disk in use. The computer then calculated the block that contained the desired record and read/wrote only that block. Developers in high-level languages just wouldn't give a shit.
I knew a graphics developer who looked for every opportunity to use powers of two so he could use bit-masking and rotating: rotate 1 bit right to divide by two, or XOR with 0x07 to get modulus 8, etc.
Optimization by understanding what the computer is actually calculating is fading fast, and teaching Java at the university level only accelerates that trend.
What do you expect? To me it appeared to be little more than stumping for the programming language he wrote - Google Go. Which has yet to impress me. They say that it's flexible like an interpreted language but fast like a compiled one. To me, it seems like it's missing all the cool shit that makes me USE an interpreted language, but doesn't provide the same low-level access that makes me use a compiled one! All languages have their niche, I suppose, and I guess I'm just not the target demographic for Google Go
If I had a nickel for every time I had a nickel, I'd be richcursive!
Whats better is if you take a look at his history of 'inventions', you find one or two things that eventually, with the help of others, turned into something that other people use.
His personal list of inventions looks like a list of 'things no one gives a shit about'.
His list of Wikipedia quotes are golden. I think there was one on the list that didn't make him look like a total douche.
He's one of those guys that thinks everything sucks except what he's made ... unfortunately, the entire rest of the world feels pretty much the exact opposite.
Looking at his history, I don't think he'll ever say anything bad about Go, he'll just continue thinking it was perfect and that it failed because everyone else wasn't up to the task of using it.
Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
How many words are in english? A lot. (According to the OED folks, "The Second Edition of the 20-volume Oxford English Dictionary contains full entries for 171,476 words in current use, and 47,156 obsolete words. To this may be added around 9,500 derivative words included as subentries.") How many words does the average native english speaker know? According to this random website, 12,000-20,000 words. So English is complex, yet just 10% of the language meets a native speakers needs (less than that as we don't use all the words we know in normal conversation...except my wife when she's mad at me, then I hear every word she knows, many repeatedly)
So Java is complex. C++ is complex. I program in Java for my daily bread and I certainly don't use the entire language. It's only as complex as I need it to be. The complexity of my code is driven by what I'm trying to do, not by the language itself. And for code maintainability, I try to keep things as simple as possible.
It's been a long time since I've coded in a professional environment but I feel that having learned C++ you can learn any other language. It is complicated and verbose, but its extremely precise. Imagine having to learn how to manage memory with something like PHP. Actually -- because the new generation DOESNT LEARN C++ its why code is getting so sloppy now. There are easier languages sure, and using them can be fine, but if that's all you know, then you don't really know what your code is doing.
to trust anything they say or do
Or, maybe, instead of trusting what they say, you could, you know, RTFA and see if the arguments are valid and maybe post some counter arguments.
I hope you know that JavaScript is one of the most used languages in the world, and that is it not controlled by Google. That in fact Google does not control Python either. And that one of the reasons JavaScript is popular is because it's accessible and easier to learn since you can start without caring about OO or functional programming. A 13 year old can just start document.write-ing his way into a webdeveloper career, print_r-ing his way through Wordpress after Wordpress site for his friends, family and local barbershop.
Seriously, there's no conspiracy here, and comparing to Microsoft is lame in this context. (Although, Microsoft is also starting to see the value of dynamic languages lately, hmm, maybe they and Google have a point?)
This same rant has apeared generation after generation, and often from peope smart nough to know better. It's why COBOL was invented, with syntax like.
I kid you not, Adm Hopper actually thought that would make programming easier, and she was no moron.
Guess what guys? The reason programming is hard is because you must clearly and unambiguously state what you want to have happen. Yes, the languages could surely be better - the syntax and intricacies of C++ are pretty nightmarish, and Java only fixes some of those issues while introducing others. There's surely a better way to do resource management, and multi-threading, that are less error prone without making you give up needed control. But it's still going to be hard to solve hard problems, and you're still going to need to be very precise and detailed in describing how to solve a problem.
Irreducible complexity is irreducible.
Socialism: a lie told by totalitarians and believed by fools.
UTF-8 was one moment of genius insight ("make sure the escape sequences cant be confused with notmal characters"), and the rest was trivial. The details weren't even very well thought through beyond that one clever idea: real standards deal mostly with error handling, and UTF-8 totally dropped the ball on that, leaving RFC 3629 to pick up the slack. If anything, co-inventing UTF-8 is an argument that he doesn't know much about real-world programming (Ken has of course proven himself elsewhere). Being the author of RFC 3629 (F. Yergeau) and cleaning up the mess would make one's opinions much more interesting!
Socialism: a lie told by totalitarians and believed by fools.
The idea of programming as a semiskilled task, practiced by people with a few months' training, is dangerous. We wouldn't tolerate plumbers or accountants that poorly educated. We don't have as an aim that architecture (of buildings) and engineering (of bridges and trains) should become more accessible to people with progressively less training. Indeed, one serious problem is that currently, too many software developers are undereducated and undertrained.
Obviously, we don't want our tools--including our programming languages--to be more complex than necessary. But one aim should be to make tools that will serve skilled professionals--not to lower the level of expressiveness to serve people who can hardly understand the problems, let alone express solutions.
We can and do build tools that make simple tasks simple for more people, but let's not let most people loose on the infrastructure of our technical civilization or force the professionals to use only tools designed for amateurs.
- Bjarne Stroustrup
No sig today...
Big != evil. While M$ uses their clout to squish the competition, bribe the government(s), and get away with plenty other unlawful stuff, Google grows mostly by providing a superior product. There is a long way before (if) they become the new M$.
C. It's just the right thing to do.
We have a FoobarFactoryFactory class in the project I'm currently assigned to... yes, it's a factory that creates factories (which in turn create foobars). And the foobars are themselves generic-ish objects which can contain any number of different types of data.
And they have the nerve to tell me one of the qualities of higher-level devs is that "they tend to make things simpler than entry-level devs".
Even though for most people that's the first hurdle (and one that they fail), I'm not sure that this is the main reason programming is hard. I know plenty of people who've mastered the basic mechanics of doing that, and yet still don't program too well because they can't make their problem-solving ability scale to larger, more complex problems. You can understand at a fairly low level every single step that will be carried out to execute your program, yet be completely unable to write a large, modular and maintainable software system.
Are you adequate?
I actually think that perl is the best programming language every designed[...] perl is the English of programming languages.
You went on to describe how Perl is great but just so you know - every one of those reasons you listed is why every multi-lingual person on the planet hates English. It's a pain in the ass to learn because there are too many exceptions to the rules or the rules aren't well defined. Look no further than pluralization. Add an S, in most cases. Oh, but if it ends in an y, make it 'ies', like skies. And for some words, that end in sh or ch or x or something, its 'es', like wrenches. Oh and for Goose, its Geese. But the plural for Moose is not meese, in fact, its just moose, not even mooses.
We won't bother getting into Contractions or prefixes/suffixes or any of the real gritty stuff. English itself is a pain, let alone how many variants of it are across the Earth, with their own Formal, informal, and Slang terminology.
So yeah, while the flexibility that makes Perl accessible to more programming styles is good to you, its still a a pain to learn, and one of the reasons why people are put off by it. Without a standardized way of doing things its difficult to understand exactly whats going on. Some of the most obfuscated code I've ever seen has been written in Perl.
One of C's great advantages is not only that it is simple and very fast, it is also very close to the hardware -- when you make local variables, structures, assignments, etc... you have a good idea what the compiler needs to do. Likewise control structures, statements and so on.
The reason it is used is -- frankly -- because it kicks the ass of every other language out there (except machine and assembly) when it comes to both size and performance. This is because a C fragment turns into something very efficient and "close to the metal" if the compiler is even half-good, and that in turn is because what C does is very close to what the CPU does. Spend a couple weeks writing a C compiler -- just a C to ASM one for any CPU -- you'll see what I mean.
The only sense in which C is "harder" is that it takes more statements - because they tend to do simple things - than a higher level language to do many things. A little writing, a little building your own library... you'll have a nice resource for lists, memory management, graphics, in whatever area(s) your interest(s) lie(s.) And at that point, it's not harder -- it's easy, and it's fast as hell to write, and it *will* kick the butt of most other languages, as long as the understanding of the problem to be solved by the programmers is reasonably similar.
Also... I'm a huge fan of Python, use it all the time. Great language, totally wiped Perl out of my life (and for that, I am eternally grateful.) And as an interpreted language, it's not all that slow -- especially on a modern machine. But compared to C... no, I'd *never* use Python as a language for anything that required serious computation. You don't even need to go to C++ for some pretty cool OO - it's not only easy to do, it's educational and you'll actually understand what OO is doing, and why. If you need crazy OO, C++ is right there, and can remain efficient if you're really careful. Me, I rarely go there, but YMMV.
That whole too complex thing... what, was he hired by Google as a janitor? Or a janitor's helper? Seriously, too complex? For whom? Is he trying to teach a German Shepherd to program? Twit. If you came to my company for a job, and you told me C was "too complex" or "too hard", I'd just show you the door.
Have our standards really dropped that far?
I've fallen off your lawn, and I can't get up.
It's not hard to learn Java but yes, it is often a complicated mess of shit when you want to use it on the web. Anything where you *have* to generate great swathes of code to keep your sanity is probably an over engineered shit solution.
Which hardly makes them immune from criticism.
In my opinion it makes them more likely to suffer criticism. Many computer scientists, the majority I've met, seem to chronically like in a glass house and are completely disconnected from anything but theory. So if I run with the logical conclusion, in theory, made in a clean room, he's completely right. Pragmatically, almost everything he said likely to be completely wrong.
Oddly enough, seems to more or less cover much of his and the comments and here.
Stroustrup (inventor of C++) is hardly a source of unbiased opinion on this topic. His elitist argument comes off sounding like "Calculators are bad because anyone can use them, engineers should use slide rules. Would you want someone designing a bridge who was too stupid to use a slide rule?" Professional programmers can be more productive if they are able to spend more time creating and less time fighting with their tools, and denying amateurs access to those tools sounds more like job-protectionism than professionalism.
Support Right To Repair Legislation.
If you know German, Latin, and some French, English should be easy for you. English is basically a big mishmash of several older languages, taking parts of each, but not putting them together into anything coherent.
The main strength of English is its versatility; it's trivially easy to adopt new words from other languages like Russian or Japanese. However, adopting words from extremely different languages means that they won't fit into those nice rules that you complain are violated too much.
Of course, we could throw all that out, and not adopt any new words at all, and only create new words for things which can fit the rules, but that would require a special Institute, the way they do with French. That hasn't worked out too well, and people aren't exactly flocking to learn French these days. They're all trying to learn English and Mandarin.
Pike and Thompson are not computer scientists, they are practitioners. The difference between Thompson's contributions and Knuth's contributions, for example, illustrate this exact point.
--#
Sorry, but if you can't "think like a programmer does", you won't be able to create anything but the most trivial program, ever. The difficulty of programming isn't learning language and syntax, it's "thinking like a programmer does". That's precisely the thing that must be accomplished to write complex software, and that's precisely the thing that is difficult to do for most of the population.
Sorry to disappoint.
Karma: Poor (Mostly affected by lame karma-joke sigs)
Re: method syntax
I always liked how it was different from function syntax. Obj-C was my first OO language, and I had a conceptualization of objects as being semi-independent entities, so it felt natural to express message passing in a different syntax from 'mere' C functions.
September 2011: Looking for Cocoa/iOS work in Boston area Cocoa Programmer Quincy, MA
I know that many will disagree with me, but about 10 years ago, when I set out to build up a large base of Linux application library code, I had to choose a language to invest in. I looked at perl, way too friggin slow, I looked at free pascal, which was really buggy at the time. I looked at some forgotten flavor of basic, which was in its infancy on Linux.
I ended up having to choose between C or C++, if I wanted anything close to optimal performance.
Happily, I didn't choose C++, and for the last 10 years, I have been derided by many who automatically assume that the ++ in C++ means its better. IMHO ... it doesn't mean that its better, it just means that its more bloated. A thing should be as simple as possible, not simpler. All you obfuscated C code contest fans out there, please, stay away. I prefer your "optimized" source language "tweaks" be as far away from my brain as possible, so that I don't accidentally assimilate your style via osmosis.
Source code, isn't just instructions for the computer to follow ... it is a form of stored knowledge. As programmers, we learn and research how the computer hardware works, and we store that information, in source code form, so that other people can benefit from our knowledge. Given this fact, I felt that C was a better investment, as not only would it be useable by all the C programmers out there, it could also be easily incorporated into C++ projects. Had I chosen C++, the source code could not have been incorporated into C projects, except via binary linking.
The process of writing and re-writing code, until you have a near optimal solution to a specific problem, regardless of the language, takes time. No amount of investing in PERL code will ever produce the near optimal results that you can obtain by investing in C code. Furthermore, once you have a near optimal solution in C, you can go balls to the wall optimal and incorporate ASM into it.
I may get flamed for it, but I'm gonna flat out say it. C is where it's at. You can even re-use your code on an 8-bit Arduino if you want. Or burn it to an FPGA.
Until someone comes out with a truly better solution, which C++ isn't, then I'm going to continue to invest in writing well documented, well designed, re-useable C code, as the last 40 years has yet to produce something better.
p.s. I know there are people with managers who need report X post haste, and perl fits that bill. That's not the kind of code I'm talking about. You wanna write throw away code in response to your supervisors emotional state, then it doesn't matter what you code it in, or how well its coded. rm solves everything.
English. It's a pain in the ass to learn because there are too many exceptions to the rules or the rules aren't well defined. Look no further than pluralization. Add an S, in most cases. Oh, but if it ends in an y, make it 'ies', like skies.
Unless the word is Monkey, then the plural is Monkeys.
The nice part about the English language is that someone can speak pigeon-English and English speakers understand them very well. All those exceptions teach native-speakers to be accepting of lingual oddities. In some other languages, incorrect verb tense can make the difference between talking about "You" or "She", or incorrect tonality can make a foreigner sound like a stroke victim.
As far as I'm concerned COBOL is the perfect programming language. I'm a little biased as I worked as a COBOL programmer for a time, but you have to admit the syntax is very easy to read.
A well written COBOL program is like reading a little battle plan. It tells you, in plain English, what it intends to do and the ruthlessness of a COBOL compiler forces you to create readable, structured code.
Every COBOL programmer knows where the period is supposed to be. C programmers still haven't figured out where the braces should be. It says a lot about a language when you have decades-long debates about punctuation in your code. It encourages a lack of programming discipline which I feel is the leading reason why software is so buggy today.
Bibo Ergo Sum.
Very hard to find a main stream game that isn't written in C++. What with Ms pushing XNA and some other stuff like that there may start being a few more written in managed languages, but C++ still reigns supreme. Why? Speed. You can write some real efficient (from the processor's point of view) code if needed, but it still has higher level functions like being OO and the boost libraries to make thing easier.
Even on games made to be extensible, C++ is usually at the core. Civ 4 is mostly XML and Python. Pretty much all data is stored in XML, and the interactions of that stored in Python. However, the game engine is written in C++, as is the AI's DLL. The game core maybe you argue that is because they didn't want people messing with it but the AI they released the source code for. It is C++ because speed is essential.
Some programmers love to whine about C and C++, but they endure for many reasons. I'd also point out they form the core of most OSes. Linux is written in C. The Windows kernel is written in C, the higher level API/ABI stuff in C++ and only some of the user stuff in .NET. OS-X is again C and C++ at the low level, and Objective-C higher up. All of this is not coincidence.
Oh, so he's pushing a competing product and denigrating his competition?
"Product" is a pretty poor word choice for something that's given away in the way Go is. Pike doesn't really have much more to gain than *you* do from the adoption of Go and reduced use of C++ and Java.
Nothing to see here, I think.
Only if the substance of his criticism doesn't hold up. My experience suggests his objections are apt, and I might add that a casual dismissal of work by Rob Pike and Ken Thompson reflects more on you than them.
Tweet, tweet.
How will you fence off a satellite image?
I know, I know, it's pointless to argue with Slashdotters who looooove Google.
Most people don't understand WiFi networking and don't realize they're broadcasting anything. I didn't say people weren't free to take pictures of your house. I'm just pointing out that you're supporting a company whose CEO said only criminals worry about privacy. If you're okay with that, then Google loves fans like you!
Objective-C has the absolute most fucking retarded 'memory management' model I have ever seen.
Its got all the disadvantages of ref counting and non-ref counting allocation, and absolutely none of the advantages of either.
Anyone who thinks Objective-C is simpler is sorely confused.
Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
The language it was written in was Algol 68. What contributed to my success was an expressive static type system, and garbage collection. Unless you specifically turned run-time checking off, you could not break the run-time system.
Oh, and did I mention that the compiler generated low-level efficient code as well?
But there are few Algol 68 compilers around these days.
Looking to what *is* available nowadays, have a look at Modula 3. It's not my favourite style of syntax, but programs written in it tend to run fast and be easy to debug. Again, most of the bugproofing lies in the static checking and garbage collection. And it's a systems language. It has been used for implementing OS kernels and the like, as well as application programs. It's my language of choice at the moment. Get the CM3 implementation. Follow the link in the Wikipedia article.
Another attractive language is OCAML. I haven't much experience with it, but it seems to share the behaviour I've grown to love with Algol 68 and Modula 3. If anything, though, OCAML does too much automatic type inference. This leads lazy programmers to forget to mention types at many strategic code locations. making the code unnecessarily obscure.
Do you know who you are dissing? Did you read the article? No, and no. He never said anything against C, he said C++ was too complex not C. So you echo him and slag him off over your misreading at the same time? One of the founders of your profession? Standards dropped? Yep, sure. But whose?
pretty well, actually.
damaged by dogma
This only applies to those of limited intellect.
This shows limited intellect: 'How do we have stuff like this [get to be] the standard way of computing that is taught in schools and is used in industry?'
School teaching and industry isn't perfect, neither is any programming language, but there is an extent to which in programming one can no longer advance in a language without understanding of the underlying principles.
Although not fully, for any scripting language there will be a vast swath of underlying operations that are based on the same system characteristics that Java and C++ express, being more of a reflection of the hardware.
Scripting languages already have poor performance. Out of sight out of mind will only sweep it under the rug for someone to trip on later.
C++ Was supposed to fix the major problems with C. A few bad design decisions in the type system made that hopeless. The underlying problems with arrays remained. An attempt was made to paper that over with the "standard template library" collection classes. Collection classes were a big step forward, but they were really just papering over the moldy type system underneath, and the mold kept coming through the wallpaper. The C++ standards committee keeps adding bells and whistles to the template system, but after ten years they still don't have anything good enough to release.
Nonsense. C++ provides excellent abstraction facilities---you're a fool if you work regularly with the low-level C constructs like arrays; unfortunately, there are a lot of fools.
The mistake is a matter of culture: Too much emphasis has been placed on C++'s C heritage; the C fools muck everything up, and the new C++ programmers don't learn to keep out of the dirt even though C++ provides excellent boots and a well-paved sidewalk.
C++ OTOH, has many, many, many advantages over C.
Vou can program it like C but take advantage of a few extra things like automatic memory management (no need to use free()), better strings (no strcpy or buffer overflows), etc. C++ is every bit as good as C for this.
But ... for larger projects C++ provides proper control of resources (objects have defined lifetimes), exception handling (which combined with stack unwinding makes writing robust code much smaller/neater/easier), much better abstraction abilities (define your interfaces then worry about the details), better namespace control, etc.
I'm sure that as a C zealot you've argued your case against the assembly language zealots, and rightly so - there's a very good reason why people switched from assembly language to C once the C compilers reached maturity.
Well ... this is 2010 and that exact same reason is why they later switched from C to C++.
The reason is that C simply doesn't scale. Big projects are a LOT more work in C than in C++ (just like writing 640k programs in assembler was a lot more work than in C), and for zero gain. Learn to use your tools and the "efficiency" argument vanishes like morning mist.
No sig today...