7 ms·
My only real complaint about the nature of HN is the (as perceived by me) strong anti-C++ bent, like the ones in these comments, from what seems like people who
by tseabrooks 16y ago
My only real complaint about the nature of HN is the (as perceived by me) strong anti-C++ bent, like the ones in these comments, from what seems like people who don't have lots of experience using it in the work place. Am I imagining this anti-C++ bias? Am I wrong and all the people bashing C++ have tons of C++ experience?
I'll be the first to point out the numerous flaws C++ has but it just feels like folly to make fun of the ugly chick at the party without realizing everyone at the party is covered in warts... (The is a metaphor for all programming languages having problems)
- tptacek 16y ago(I'm a recovering C++ dev). C++ has problems unique to C++: a deceptive illusion of abstraction (what Spolsky would call "leaky" abstractions) makes a bunch of idioms in the language dangerous, including virtually all "smart" pointers, iterators, exceptions, allocators, and arrays. It is uniquely difficult to write reliable code in C++. Add to that the superficial but more practical and common complaints against C++: the ghastly compile times, the header file dependency hell that forces every class into a kabuki dance of "pImpls" and nested classes, the error messages rendered in ancient Sumerian... you know I could go on, but you get the idea. C++ is just not a very good language. C is a fine language. If you are building a system for which C's abstractions are inadequate --- and I'll stipulate that such systems exist --- you're better off with C and a very good glue language (Lisp and Lua are two good, popular choices) than you are with a uniform C++ implementation.
- btrask 16y ago"C++ is a powerful language with flexible solutions to problems that other languages don't have."
- statictype 16y ago"C++: An octopus formed by nailing extra legs to a dog"
- TillE 16y ago> C++ is just not a very good language. C is a fine language. This is the attitude that I really, truly do not get. If I want a linked list or any other common data structure in C++, I include the appropriate STL header and declare an object with the template syntax. It's two easy lines of code. If I want a data structure in C, I have to write it myself. From scratch. Every time. C++ is a powerful high-level language. C is a low-level language where everything is explicit; I know this is "elegant" to many programmers, but really, I'm just trying to get things done, and C++ has served me far better in that practical role than C ever could. I don't love C++; it has tons of flaws (many of which disappear if you use shared_ptr for everything). But I loathe the tedium of working in C.
- xpaulbettsx 16y ago> If I want a data structure in C, I have to write it myself. From scratch. Every time. http://library.gnome.org/devel/glib/2.28/ http://library.gnome.org/devel/glib/2.28/ makes C development much more pleasant. You could make the same argument against C++ if you didn't have STL.
- dasil003 16y agoWhen C was invented, half of all coding was systems programming. C does a great job of addressing that need, that's why it's a fine language. The fact that C is not great for GUI apps does not diminish C's quality for what it is, it's just not designed for that level of abstraction. C++ on the other hand, attempts to be designed for that level of abstraction, and so in fact you are better off writing most types of modern apps in C++ than C in absolute terms, but when compared against other languages designed for the same paradigm it falls down due to complexity overload. That doesn't mean you can't do great work in C++, but you have to really know what you're doing, which parts to avoid, etc. C++'s strength is being both fast and powerful, but most of the time you don't really need both those qualities. Game programming is a notable exception.
- wglb 16y agoThe "which parts to avoid" conundrum shows up as every outfit that uses it in any serious way has a different set of "which parts to avoid". It is just a mess.
- swah 16y agoOT: Zed Shaw's Tir framework
- blub 16y agoC was a great language when it was created, considering the requirements and constraints of that time. In 2011, it is unexcusably unsafe and lacking in abstraction power - C99 included. Almost every type of operation in C is predisposed to HUMAN error (the worst kind of error) - I/O, strings, creating a data structure, declaring a variable, calling a function even basic maths can fail in unintuitive ways. [1] No matter how many glue languages you use, C is not going to become safer or easier to use. Furthermore, C's abstractions are inadequate for most things, even the things that it's traditionally known for,such as the Linux kernel. Take a look and see how many wheels have had to be reinvented for the kernel or any large C project. But... you probably already know all of this. It's just that you're so comfortable with it that you're willing to forgive all of its sins. [1] https://www.securecoding.cert.org/confluence/display/seccode/CERT+C+Secure+Coding+Standard https://www.securecoding.cert.org/confluence/display/seccode...
- tptacek 16y agoWe're not discussing C vs. Lisp. We're discussing C vs. C++.
- deleted 16y ago[deleted]
- endtime 16y agoI "get stuff done" better with git than with svn (and I used svn for years before I ever heard of git). I'm also far more productive with Python than with Java. Sometimes things become popular because they actually are better. Blindly writing off every newfangled whatsit as "fashion" is ludditry.
- rwmj 16y agoWith a tiny team of very smart programmers, starting from scratch, C++ can certainly be made to work. I wrote a web server in C from first principles back in 2001* for many of the same reasons that OKCupid seem to have done - and with a team of one good programmer that worked out really well. * http://web.archive.org/web/20070705191513/http://www.annexia.org/freeware/rws http://web.archive.org/web/20070705191513/http://www.annexia...
- rhizome 16y agoC++'s reputation was negatively affected by Microsoft's studied dominance of university CS curricula. Back in the VB days C++ was the step up and I still see it in job ads on par with Java (Sun's side of the curriculum equation), though by now I merely read it as a veiled call for university graduates who learned programming only in school, coderbots.
- discreteevent 16y ago"Coderbots" - Why be so derogatory? There's no need to be. Who knows, maybe someday you will meet someone who only learned programming in school who is faster than you.
- flomo 16y agoNegative. C++ had the reputation of "computer science educated" back when the average CS grad could barely spell Microsoft. Rather than "Microsoft ruined everything", nearly the entire commercial software industry standardized on C++, and entry-level "coderbots" was who they wanted to hire out of school. C++ lost its sex-appeal because its simply more interesting to do web startup things than to be a junior coder at Big Software Inc.
- nandemo 16y agoBesides tptacek's reply, see also Yossi Kreinin's C++ FQA (Frequently Questioned Answers): http://yosefk.com/c++fqa/faq.html http://yosefk.com/c++fqa/faq.html Subjectively I don't feel HN as particularly anti-C++, it's more that people are younger and started programming in languages like Python and Ruby so they don't have a pro-C++ bias. If anything I feel that many people on HN are anti-Java. Personally I'm thankful for Java's existence because it managed to replace C++ in a lot of places.
- _delirium 16y agoThe C++ FQA is pretty impressive in its detailed and thorough dislike for C++. I'm not sure if I know of anything else quite like it in that regard. The only thing that comes to mind as being close is the UNIX-HATERS Handbook.
- tptacek 16y agoThe Unix Haters really liked Unix; the book was an act of love. Yossi clearly wants to stab C++ in the eyeball with a fork.
- nandemo 16y agoSure, but the original commenter wondered whether people who dislike C++ know C++ well. Yossi no doubt knows C++ pretty well.
- zohebv 16y agoI take it that you haven't actually read the Unix Haters handbook. They clearly have no love for Unix. "Each graft of a new subsystem onto the underlying core has resulted in either rejection or graft vs. host disease with its concomitant proliferation of incapacitating scar tissue. The Unix networking model is a cacophonous Babel of Unreliability that quadrupled the size of Unix’s famed compact kernel. Its window system inherited the cryptic unfriendliness of its character-based interface, while at the same time realized new ways to bring fast computers to a crawl. Its new system administration tools take more time to use than they save. Its mailer makes the U.S. Postal Service look positively stellar."
- wglb 16y agoMy strong anti-C++ bent comes from having used in in demanding production situations for 12 years. It is a beast. When Scott Meyers of http://www.amazon.com/Effective-Specific-Addison-Wesley-Professional-Computing/dp/0201924889 http://www.amazon.com/Effective-Specific-Addison-Wesley-Prof... fame reads a book on C++ template programming and is surprised, no, astonished! at some of the things done there, and attempts to write auto_ptr and fails at least twice. It takes way to long to learn (probably 2 years for a developer working with it 8 hours a day), and the grown ups don't like it either: http://www.amazon.com/Coders-Work-Reflections-Craft-Programming/dp/1430219483/ref=sr_1_1?s=books&ie=UTF8&qid=1299805592&sr=1-1 http://www.amazon.com/Coders-Work-Reflections-Craft-Programm... This isn't even an ugly chick.
- starpilot 16y agoJust saying that this thread has been fascinating and illuminating for a novice C++/C programmer like myself. It reads like a decent article comparing the two languages, though I'm no expert and can't judge for sure. This is why I read HN.
- rimantas 16y agoIf you are an expert in the intricacies of C++, please consider this knowledge a kind of martial art - something a real master never uses. http://yosefk.com/c++fqa/why.html http://yosefk.com/c++fqa/why.html
- ww520 16y agoThere are anti-C++ bias in HN. More people here are working on the Web related projects where C++ is not popular.