Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> OO with class hierarchies is a broken model.

I can't agree more with you! As a matter of fact, someone famous said:

I think that object orientedness is almost as much of a hoax as Artificial Intelligence. I have yet to see an interesting piece of code that comes from these OO people.

This someone is Alexander Stepanov the author of the STL (the C++ Standard Library).

C++ is much more about generic programming.

> Algebraic datatypes and pattern matching have been around for years, and have clear advantages.

Try this keyword: "template".

> Parallel programming has been around for years, and is becoming CRITICAL for modern applications.

Whether this is the job of the language or the job of a library is debatable. Efficient parallel programming in C++ is done with the latter (Intel TBB for example).

> C++ has a RIDICULOUS amount of boiler plate.

Maybe. This is one of the philosophy of C++ is "don't pay for what you don't want".

> Headers shouldn’t exist in the language:

Yes, but as you said it will be addressed in C++ 14. You should appreciate that C++ has enablee the industry to move forward thanks to its support of C headers. This may be less obvious now, but 10 to 20 years ago this was really a big deal.

> The same problems that make highly-parallel code a nightmare in C++ also make it an unsuitable language for security-critical, or mission-critical projects.

You are naive if you think the weak link of security is the compiler. The problem is behind the keyboard and the chair. According to you, programs written in Java or .NET should be more secure. That's not the case.

Some of the most secure programs ever written are written in C which offers even less compile-time checks than C++.



> Maybe. This is one of the philosophy of C++ is "don't pay for what you don't want".

Exactly, many of the warts and gotchas of C++ can be explained through this philosophy. If a certain feature is or hard to use or difficult to understand but faster during runtime the C++ committee will most likely pick this over an implementation of the same feature that is easy to use but slower during runtime.


"I think that object orientedness is almost as much of a hoax as Artificial Intelligence. I have yet to see an interesting piece of code that comes from these OO people."

This someone is Alexander Stepanov the author of the STL (the C++ Standard Library).

Authority doesn't make it true ;) : How about Qt? Or Cocoa?

OO was overhyped. It doesn't fit every problem domain. That doesn't mean the opposite is true. There are domains where OO with class hierarchies is quite a good model, such as GUI toolkits.

Try this keyword: "template".

Templates are a compile-time construct. Algebraic data types are not. I think you are confusing ADTs with parametric polymorphism.

According to you, programs written in Java or .NET should be more secure. That's not the case.

Proof it. I think it is reasonable to assume that Java code produced by the average programmer is safer than C++ code produced by the average programmer. Java does not have pointer arithmetic, does bounds checking, etc.


> Templates are a compile-time construct. Algebraic data types are not. I think you are confusing ADTs with parametric polymorphism.

You keep saying that word. I do not think it means what you think it means: http://en.wikipedia.org/wiki/Algebraic_data_type


> The problem is behind the keyboard and the chair.

The human will make mistakes, as that is what humans do. That's not fundamentally fixable: even the savant will make the occasional error. Compilers and static code analysis can help mitigate the human factor, as can code reviews and any number of other variables.

Static code analysis and "safe" languages seek to mitigate the problem. They are not the only variables in the security equation, but holding everything else constant, given three codebases written in C, C++, and C#, I'll just outright assume the first two will have at least one buffer overflow that's potentially exploitable for arbitrary code injection. The third, at least, has a chance of said overflow being "merely" a potential DoS vulnerability.


>> Headers shouldn’t exist in the language: > Yes, but as you said it will be addressed in C++ 14.

Links please re headers solution in C++ 14, Google and Wikipedia didn't return results.



Thanks. But is this actually ready for the C++ 14? Any formal contribution document to the standard guys?


isocpp.org are the standard guys.

I am not sure how to navigate that site, but it does not look like modules are planned for C++14. At least C++17 according to the picture on this page: http://isocpp.org/std/status




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: