Live data from Hacker News

C++ in Coders at Work

gigamonkeys.com

101–110 of 174 posts

Re: C++ in Coders at Work

#101
post #75
post #67

Earlier quoted context omitted.

In my experience with Java, the core language is small enough that every company pretty much uses the whole thing. Almost everyone has finally upgraded to using at least the Java 5.0 syntax by now. Occasionally you'll run across silly rules that prohibit things like the ternary operator or multiple returns, but those are minor differences. The big differences come into play with frameworks. Depending on whether you'r…

Occasionally you'll run across silly rules that prohibit things like the ternary operator or multiple returns In avionics software, the ternary operator and multiple returns are often avoided to help ensure better code coverage during verification.

I don't think anyone is writing avionics software in Java? The automated code coverage tools I have seen handle those cases just fine.

Re: C++ in Coders at Work

#102

Earlier quoted context omitted.

If you code in a 'safe' way and you stay away from nifty tricks then you are in good shape. I'm sure you have a little list of stuff that you should stay away from or that you would at least discourage. The problems usually come when people start to use all those nifty features in combinations, especially 'newbie' programmers going wild on all that high level sugar. C/C++ is performance wise also as good as unbeatabl…

But think about open source code. Anyone can contribute code, so if you're using C++ you will get code from people from all levels of understanding of C++. This is a reason why some open source people prefer to use C, because they won't spend time saying what can or cannot be used in the project. An example is Google. They had to create a huge document to describe what part of the language their developers can use: h…

Google creates a huge document to describe what part of the language their developers can use for every language.

Re: C++ in Coders at Work

#103
post #75
post #67

Earlier quoted context omitted.

In my experience with Java, the core language is small enough that every company pretty much uses the whole thing. Almost everyone has finally upgraded to using at least the Java 5.0 syntax by now. Occasionally you'll run across silly rules that prohibit things like the ternary operator or multiple returns, but those are minor differences. The big differences come into play with frameworks. Depending on whether you'r…

Occasionally you'll run across silly rules that prohibit things like the ternary operator or multiple returns In avionics software, the ternary operator and multiple returns are often avoided to help ensure better code coverage during verification.

They're only doing line-based coverage analysis?

Re: C++ in Coders at Work

#104
post #28

Earlier quoted context omitted.

Is operator overloading in C++ really more complex than it should be, or did you just pay the inevitable price for dabbling in the black art of multiple inheritance? Anytime you say "in combination with multiple inheritance" you can't expect to get much sympathy ;-) C++ is definitely a language where you can get screwed by "clever" programmers who would rather be reading TC++PL than actually coding, but it's not so b…

There was a time when I made most of my income debugging other peoples programs, call it 'troubleshooter' or something like that. It gives you an excellent overview of the various ways in which things can go wrong, and C++ figured quite prominently in the 'gotcha' department. C has it's share of issues, double frees, failure to initialize (but most compilers catch that one nowadays), and stale pointers. With a good d…

Point taken; I have never had to deal with poorly written code that makes casual use of obscure C++ features. My shop tends to be very careful with the sharp edges, so you don't have to have guru knowledge to skim our code and see what's happening. All potential "gotchas" are commented, just like any other difficult code. Obviously the standards you can realistically demand from your coworkers go out the window when you're dealing with legacy code.

Re: C++ in Coders at Work

#105
post #102

Earlier quoted context omitted.

But think about open source code. Anyone can contribute code, so if you're using C++ you will get code from people from all levels of understanding of C++. This is a reason why some open source people prefer to use C, because they won't spend time saying what can or cannot be used in the project. An example is Google. They had to create a huge document to describe what part of the language their developers can use: h…

Google creates a huge document to describe what part of the language their developers can use for every language.

True, but the topic here is C++, and it is not so interesting what they allow people to use as to see what are the points that are not to be used.

You can bet that behind each and every feature that they decided to rule 'against' was some pretty solid thinking and possibly some very hard-won experience.

There's a guide for:

   C/C++

   R

   Objective-C

   Python
see here:

http://google-styleguide.googlecode.com/svn/trunk/

Re: C++ in Coders at Work

#106

Earlier quoted context omitted.

I totally agree. C++ main strength lies in its "portable assembler" nature. However, C++ also is [quite a behemoth][1], while Lisp, Python and Haskell aren't so. [1]: http://yosefk.com/c++fqa/ The answer then is obvious : we should change the hardware, so it is not C/C++ optimized, but Lisp/Python/Haskell optimized. Then, these languages are easier and more practical.

No, C is a portable assembler. C++ was created to add "high level" OO features to C. But the success of the effort is highly controversial, because there are differences between C and the OO model that are too difficult to overcome. I think the strategy of objective-C is much cleaner, since they better separate the concerns of "writing fast code" and "writing high level OO abstractions".

How, on a site like HN that champions pragmatic entrepreneurialism, can you possibly claim that the success of C++, a language that has been deployed probably more than any other except C, is controversial? It's a matter of fact. C++ won the early OO race. Maybe Java and C# and whatever have since eclipsed it, but it was still a smashing success by all objective measures, and still is by some of those measures. Yeah it's ugly, but end users don't care.

Re: C++ in Coders at Work

#107

Earlier quoted context omitted.

JSON is not a programming language.

You are absolutely right. My point exactly. Now you need "two hammers" to get a single job done. Your current programming language of choice and a data expression language. For example: In C, C++, Java, or related, you "first" have to build you structure to represent a Person with first_name and last_name and then you have to write it to JSON: Java: class Person { String firstName; String lastName; } JSON with JavaSc…

> or example: In C, C++, Java, or related, you "first" have to build you structure to represent a Person with first_name and last_name

Not if you're using Protocol Buffers, which is essentially a version of JSON that has "batteries included."

> Lisp ver:

Lisp is not the only programming language around. How am I going to consume that data from another language? Embed an entire Lisp interpreter?

Re: C++ in Coders at Work

#108
It's the only language I really feel comfortable programming in, and everything else seems 1) slow or 2) alien in comparison.

I'm digging scala's design, but have yet to really compare it for number crunching, and big library building.

By the way, the article didn't really dig into any specifics besides saying there was feature bloat in C++. Which languages don't have feature bloat? How much use can I get out of them?

Re: C++ in Coders at Work

#109
post #9

This is a disappointingly flamey article: roughly 90% of the comments are from people who got a bad impression of C++ during the pre-standardization days (which were admittedly horrible, but long since past). Most of the rest are from people who just skipped straight to Java, or who are so young that they never had to learn C++ at all. The comments that really drop my jaw are the people who seem to hold up Java as a…

"If Python or Java were implemented by Microsoft and GNU and four other smaller companies, you'd see the same horrible compatibility problems with those languages, too." There are a lot of Java implementations, and I am not aware of serious compatibility problems between them.

The tiny differences in implementation between the sun and ibm vm's is a regular source of deep and painful frustration for some of the people I work with.

Re: C++ in Coders at Work

#110
post #9

This is a disappointingly flamey article: roughly 90% of the comments are from people who got a bad impression of C++ during the pre-standardization days (which were admittedly horrible, but long since past). Most of the rest are from people who just skipped straight to Java, or who are so young that they never had to learn C++ at all. The comments that really drop my jaw are the people who seem to hold up Java as a…

roughly 90% of the comments are from people who got a bad impression of C++ during the pre-standardization days

Zawinski and Thompson are good, but they are not 90% of Zawinski, Thompson, Bloch, Eich, Ingalls, Armstrong and Steele. You're completely misrepresenting the gist of the article.

The comments that really drop my jaw are the people who seem to hold up Java as a "better" C++.

http://www.paulgraham.com/icad.html

but from its sketchy real-world performance

Oh please, don't start that flamewar with these kinds of uninformed, one sided utterances. Java performance has been more than fine for at least five years.

Post reply on HN