   C++ FQA [sic] Lite
  I recently discovered C++ FQA [sic] LITE, which is an answer to the popular and ever so useful site: C++ FAQ LITE The site basically challenges the answers given on the original C++ FAQ site and overall disparages the C++ programming language. The author of the FQA additionally summarizes the major defects of the C++ programming language here.From what I can tell, most of what he says is accurate and backed up. However his tone makes the whole document come across as flame bait, which is unfortunate. Also the document distinctly lacks balance. The author is pretty clear that he feels C++ has no redeeming features (though not stated explicitly, that feeling is made pretty clear). He says in no unclear terms that you shouldn't use C++ for new projects, but fails enumerate any alternatives. For all these reasons the FQA seems to lack completeness and professionalism.How do you guys feel about the FQA in general?I have limited experience using many different programming languages, so I wonder if other languages suffer from as many design issues as C++. Why does the current version of C++ have as many issues as it does? I know that the C++0x standard makes drastic changes to modernize C++, do you think it will make all the right changes?[Edited by - fpsgamer on May 24, 2008 4:20:47 AM]
  I'm working with C++ myself all the time, and I find a lot of things are missing, flawed and inconsistent in it. I think it's mainly historical.Here follows a list of some of the things I dislike about C++ or miss. But mainly I still find it a very nice and powerful language and some of the things below may be disputed. BTW, my annoyances are totally not as deep as the ones in the article linked in the OP, but I'm a bit simpler so therefore my annoyances will also be simpler :)Width of integers and other types not defined in the language, it could be 32-bit on one PC, 64-bit on another.No integer type that's guaranteed to be at least 64-bit in the core language.Inconsistent names for primitive types, e.g. char but wchar_tNo way to forward declare some things, such as nested classes, and no way to forward declare typedefs without repeating the typedef (= code duplication).No nested functions, which could have been a nice way to group some things together.Nothing at all to do even the most basic multithreading in the core language nor the standard libraries.The need to declare stringstream objects all the time if you want to convert integers to strings and vica versa, instead of strings having that ability directly in their own interface.Iterators need quite a large notation, and you need to repeat the type of the container when declaring the iterator in a for loop (this will be fixed in C++0x with the "auto" keyword).Comments of /* */ style can't be nested.No way to make relative paths to scopes. E.g. if you're in scope A::B::C and need something from scope B, you need to write the absolute path to scope B (A::B) instead of just having the ability to say you want "one scope higher".Enums. Why you can't make an enum Letter { NOTHING, A, B}; and another enum Color { NOTHING, RED, GREEN }; in the same scope because the words "NOTHING" clash with each other.Difficult to serialize enums.The fact that you need to type a ";" after a class definition.No binary literals (e.g. 0b1111000100)The fact that there are many different types of pointers having to be used (auto_ptr, shared_ptr, etc...) and that some people like mixing them all together creating complex and annoying interfaces.The fact that having a constructor in your class makes it non-POD, even if you also supply a default constructor that's empty.There's no way to specify that this method MUST be overriding another one. If that ability would have been there, then if someone would change the function in the parent class, the maker of the child class would at least get an error, instead of not knowing at all that his virtual function won't be called anymore due to in the parent class e.g. a parameter type having changed or "const" have been added.No easy way to say "if leaving this scope then that must happen", unless you make a struct that does it in its destructor and make an object of it in your scope.The fact that you sometimes need to write "typename" inside the implementation of template functions because the compiler can't know if you mean a type or something else - maybe there's a true technical reason for it, but it's still a bit sloppy.Everyone using their own thing (NULL, 0, ...) for NULL pointers.[Edited by - Lode on May 24, 2008 4:03:47 AM];  I'm guess I'm just surprised at the level of work someone will put into not liking something.  Who are these people that have the time to create in-depth web pages telling people NOT to use a tool?Does C++ cause cancer?  Will it cause the destruction of our youth? Will it make war in foreign countries?  You don't like it, we get it.Here's a bat-shit crazy idea: if you don't like the language, don't use it. Don't take it a step further, just let it go.   ;Quote:Original post by ChurchSkizI'm guess I'm just surprised at the level of work someone will put into not liking something.  Who are these people that have the time to create in-depth web pages telling people NOT to use a tool?Does C++ cause cancer?  Will it cause the destruction of our youth? Will it make war in foreign countries?  You don't like it, we get it.Here's a bat-shit crazy idea: if you don't like the language, don't use it. Don't take it a step further, just let it go.Yeah it's alot easier to critize than anything else. I saw that page a while back and thought it was pretty funny and at the same time kinda scary someone would spend that much time badmouthing a computer language?;  So we should all just sit back and take it without questioning it? Thats a horrible idea. Thats about as useful as asking your teacher if your answer is right and they say yes just because they don't want to hurt your feelings. Its rants and raves of people who use languages which help improve languages. Code designers don't just magically find everything that can be improved with their language and wave their little wand and *poof* its better. For example, I thought my engine's map editor was fine, but tons of people complained about it. Instead of telling them to shut up and either deal with it or use a new program, I though, "Oh gee, maybe it does suck" and did what I could to improve it by changing aspects they complained about.   ;  I think there is nothing wrong with pointing out a particular language's flaws, it's just that people tend to become all religious about it.C++ is not a perfect language (just like any other language out there) and it does have some annoying design flaws (I think Lode mentioned most of them), but it's still a very useful languages. What people need to acknowledge is that C++ is almost 30 years old and a lot has happened since then. Also, to my knowledge there's still no viable alternative to C++ when it comes to system or even game programming. In the end, it all boils down to "the right tool for the right job". People who only know one programming language tend to assume that their language is the holy grail of programming languages. But as we all know: "if your only tool is a hammer, every problem looks like a nail".   ;Quote:Original post by LodeComments of /* */ style can't be nested.Indeed. This is extremely annoying when you need to comment something out quick.Quote:Original post by LodeNo way to forward declare some things, such as nested classesIndeed. This can be solved easily by having the nested classes contain pointers to eachother instead though.   ;Quote:Original post by polymorphedQuote:Original post by LodeComments of /* */ style can't be nested.Indeed. This is extremely annoying when you need to comment something out quick.Agreed. But, then, there's always #ifdef 0.;Quote:Original post by ChurchSkizDoes C++ cause cancer?  Will it cause the destruction of our youth? Will it make war in foreign countries?  You don't like it, we get it.No, you don't get it.C++ is a language that, due to its fundamental design deficiencies, leads to intrinsically error-prone software development. Many errors in C++ are obscure and difficult to catch or, worse, easy to mask. Now, if someone selects C++ as a development language for mission-critical software like life support systems or missile launch controllers, or munitions guidance systems, or air traffic control systems, or...There can be real consequences to use of C++ without a comprehensive understanding of its limitations and shortcomings. The FQA may be excessive in its tone, but not in its intent.Quote:Original post by daviangelI saw that page a while back and thought it was pretty funny and at the same time kinda scary someone would spend that much time badmouthing a computer language?If a person spends the overwhelming majority of his time and energies working in a certain domain, they naturally develop passionate opinions regarding the domain, the tools, best practices and so forth. The extent of this particular writer's vitriol may be a tad excessive, but it is not necessarily without reason.Quote:Original post by Harry HuntWhat people need to acknowledge is that C++ is almost 30 years old and a lot has happened since then.What people need to acknowledge is that C++ is almost 30 years old, and should not be the default option for any application-level project. However, too often it is, so technology evangelism that specifically and consistently points out the language's defects becomes necessary to focus attention on these shortcomings. Perhaps it will [continue to] motivate the standard committee to improve the language. Perhaps it will accelerate the development of alternatives and ancillary technologies to make them viable.Quote:Also, to my knowledge there's still no viable alternative to C++ when it comes to system or even game programming.There is no commonplace alternative, but alternatives have always existed. Further, many existing languages could easily be tooled for system programming purposes; the sole requirement is emitting efficient native or assembly code.;  No common alternative for games programming? Jak and Daxter was written in LISP. Not a common alternative, but still a valid one. I figure if a commercial company can use a language to make a quality game for a major console, it's an acceptable choice.I wish I had the time to learn LISP...   