aspose file tools*
The moose likes C / C++ and the fly likes Is it true that Google uses C/C++ a lot? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » C / C++
Bookmark "Is it true that Google uses C/C++ a lot?" Watch "Is it true that Google uses C/C++ a lot?" New topic
Author

Is it true that Google uses C/C++ a lot?

Rogerio Kioshi
Ranch Hand

Joined: Apr 12, 2005
Posts: 689
I've heard that Google uses C/C++ a lot for their search programs. Is it true?


SCEA 5 (part 1), SCBCD, SCWCD, SCJP, CLP, CLS
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 423

Yes, it is.
See:
http://infolab.stanford.edu/~backrub/google.html or http://en.wikipedia.org/wiki/Google_platform or http://panela.blog-city.com/python_at_google_greg_stein__sdforum.htm
Paul Santa Maria
Ranch Hand

Joined: Feb 24, 2004
Posts: 236
http://panela.blog-city.com/python_at_google_greg_stein__sdforum.htm

At Google, python is one of the 3 "official languages" alongside with C++ and Java. Official here means that Googlers are allowed to deploy these languages to production services. (Internally Google people use many technologies including PHP, C#, Ruby and Perl).


It's also worth noting that Guido van Rossum, the inventor of Python, works for Google.

And yes, he was tested on Python just like all other applicants


Paul M. Santa Maria, SCJP
Brian Overland
author
Ranch Hand

Joined: Sep 09, 2011
Posts: 36
I can't say for certain, but I would venture an educated guess... it is likely that they use C and/or C++, because these are more likely to be used in big commercial applications that can't run with the overhead or restrictions of, say, Visual Basic or LISP.

The most efficient code of all of course would be written in assembly language or machine code. But those languages require ten times the man-hours to do the same things you'd do in C++. It's not worth it to spend those extra man hours.

I can't say for sure that Google couldn't be written C# or Java. I'm not sure. But C++ allows you to do pointer arithmetic and lower-level operations when you need to. Of course, you need to know what you're doing, because there is less protection against bad coding. But this is exactly why the "Big Boys" use it.

Different situations require different tools. Visual Basic has long been the best fast prototyping tool. C/C++ is now considered the best "close to the hardware" program, so the largest commercial applications tend to be written it.

That's all by way of speculation, but still....

Brian Overland
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Would assembly code be more efficient? I thought the optimising compilers available for C nowadays can produce code which runs faster than handwritten assembly code.
Brian Overland
author
Ranch Hand

Joined: Sep 09, 2011
Posts: 36
No offense intended, but the question "Would assembly code always be more efficient?" made me smile because it strikes me like asking, "Can a computer beat a human at chess?" The answer is probably, yes, but it does depend to some extent on both the human and the computer.

You could, in theory, do any trick with assembly code or machine code that even the best optimizing compilier could do -- in theory. The real question is, would it be worth all the extra work of applying all those tricks yourself? And would you be smart enough to see all the optimizing opportunities yourself? And: is any human that smart?

A fascinating case in point (tho I'm sure there are others) is Bill Gates back in the late 1970s or was it early 80s, writing BASICA for the first personal computers and miraculously fitting it all into 64K -- including enough space for user program/data area. He had to program down to the hardware, pulling off every optimizing trick he could think of. He couldn't possibly have created BASICA in 64K without writing it at the assembly-code-machine-code level. For one thing, a HLL would've generated far too much overhead for him to fit the code into that tiny space.

But yeah... since then, the cases in which it has been necessary to write anything in assembly code have become rarer and rarer.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Brian Overland wrote:No offense intended . . .
. . . and none taken.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Brian Overland wrote: . . . And would you be smart enough to see all the optimizing opportunities yourself? . . .
Of course not. That is why we have optimising compilers. And in an attempt to optimise at the low level, we may introduce bugs.
[Edit]Add the following:[/edit]
That is exactly what I meant about handwritten ”assembly code‟ earlier.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Brian Overland wrote: . . . And: is any human that smart? . . .
Yes, but humans and computer programs are smart at very different things.
Brian Overland
author
Ranch Hand

Joined: Sep 09, 2011
Posts: 36
And so the example I gave was that Bill Gates did programming that was probably way beyond what any compiler of the time could do.

But yes, things have progressed a bit since then. <grin>

At Microsoft, it has long since been an internal policy that a developer (i.e. a writer of production code) has to make a clear case before writing any function in assembly language -- the presumption is that the optimizing compiler can usually do better!

-- Brian Overland
David McLure
Greenhorn

Joined: Mar 14, 2007
Posts: 16
I have to question this statement: "Visual Basic has long been the best fast prototyping tool."

I can't believe that this was ever really true, and especially today with all of the myriad of alternatives.

It's possible that this could be true in certain Microsoft centric shops, but I would think that this is increasingly the exception, rather than the rule.

Of course, this is bound to ignite a firestorm of religious zealotry, but I guess I am just trying to figure out why, after over 26 years in the software programming industry I have never ever seen Visual Basic used for anything other than one obscure little web plugin project used by someone at Data General, a project which was soon cancelled and replaced by Javascript.
Brian Overland
author
Ranch Hand

Joined: Sep 09, 2011
Posts: 36
This is more a subject for a Visual Basic BB, David, but I personally find that Visual Basic is outstanding for personal productivity software I write for my own use and for others. Visual Basic is not intended to produce commercial software you buy off the shelf. It is great for the recreational, hobbyist, and part-time programmer who wants to get things working fast in the Windows environment.

If you want to write professional applications to be sold to a mass market, then yes, I suggest you learn C++.

Maybe I over stepped by saying that VB is the BEST of its kind. Ok, that's a matter of opinion, and to be honest, I haven't checked every development environment in the entire world.

My point was -- use the right tool for the right job, that's all. You may have your own favorites, that's fine.

Brian Overland
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42935
    
  68
This is all very off-topic, but would it even be possible to tell a Windows app written in VB from one written in VC++? I'd think that they would possibly look similar, or even identical ... ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it true that Google uses C/C++ a lot?