TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Linus Torvalds on C++ (2007)

47 pointsby ruben94about 10 years ago

11 comments

Elv13about 10 years ago
&gt; inefficient abstracted programming models where two years down the road &gt; you notice that some abstraction wasn&#x27;t very efficient, but now all &gt; your code depends on all the nice object models around it, and you &gt; cannot fix it without rewriting your app.<p>The opposite can also be said. By re-inventing a simple data structure, you can end up 2 years later in the same position where your structure is inefficient (list vs. array, etc) and you end up having to rewrite your app. While implicit operator overload was probably a C++ mistake, it does allow to replace some kind of structures with other one without changing the code relying on them.<p>Other than that, I kind of agree that C++ is kind of terrible. So is perl, php, js or any other languages that send a barrage of features to the programmer without managing to educate them on their impact on performance and memory structure. Most C++ devs know about vTables and that&#x27;s about it. I would also argue that C isn&#x27;t a very good language either. It may be simpler to &quot;get&quot; what actually happen when you run your code, but has sub par code organization, total lack of &quot;pointer flow&quot; tracking, causing huge security traps and has an evil reliance on casting for any kind of structure&#x2F;callback abstraction. All of those things could be &quot;fixed&quot; in new languages, but beside Rust, it seem there is no leverage for proper system level languages these days. OOP is probably a better choice for business programming anyway, but that&#x27;s not even half of the market.
评论 #9288832 未加载
评论 #9287494 未加载
scrapcodeabout 10 years ago
This was seemingly discussed on HN 7.5+ years ago: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=51451" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=51451</a>
评论 #9287322 未加载
评论 #9288263 未加载
rileymatabout 10 years ago
My biggest problems with C++ (one of my favorite languages) 1. ABI issues. 2. Template Error messages. 3. Templates need be defined in header files (generally). 4. Object Slicing. 5. Cross platform Unicode&#x2F;ASCII string encoding.<p>I understand the reasons behind these, none the less they are really annoying.
jbandela1about 10 years ago
In the spirit of Greenspun&#x27;s 10th Rule<p>Any sufficiently complicated C program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of C++.<p>For example: 1) Macros for data structures instead of templates 2) Virtual functions emulated with function pointers 3) goto fail instead of exceptions
giziabout 10 years ago
I agree with Linus. C++ is too complex and overengineered, and taking in contributions in it for something like git, is a recipe for disaster.<p>However, C in all its simplicity already has its potential for abuse. Macros can go very bad. Very bad. (Just look at openSSL).<p>It is also not difficult to abuse the left-right rule in pointer arithmetic: <i></i><i></i>*x-&gt;a-&gt;c=5. It can easily become incomprehensible.<p>We did not need C++. We needed a way to further simplify C.
评论 #9287917 未加载
评论 #9288616 未加载
评论 #9290195 未加载
M8about 10 years ago
<i>&quot;The fact is, git is better than the other SCM&#x27;s. And good taste (and C) is one of the reasons for that.&quot;</i><p>If he likes simplicity and good taste then why did he pick Git over Mercurial? Because he did not implement the latter?
评论 #9288283 未加载
评论 #9288611 未加载
NeutronBoyabout 10 years ago
It&#x27;s only this time around that I&#x27;ve read the sad conclusion to this thread, from the original contributor<p><a href="http:&#x2F;&#x2F;thread.gmane.org&#x2F;gmane.comp.version-control.git&#x2F;57643&#x2F;focus=57918" rel="nofollow">http:&#x2F;&#x2F;thread.gmane.org&#x2F;gmane.comp.version-control.git&#x2F;57643...</a><p>&gt; Unfortunately, I haven&#x27;t had any time inte the last few days to code, nor read mail. I&#x27;m assuming that there is no point in me finishing the patch and that git will go with the strbuf solution? &#x2F;Lukas<p>... with no response.
评论 #9287370 未加载
hieupm37about 10 years ago
There is no perfect programming language. Just choose what&#x27;s perfect to solve your problem.
评论 #9289776 未加载
fit2ruleabout 10 years ago
Everything I&#x27;ve ever wanted to be able to do with C++, I can do with Lua. I see it as the obvious progression from C - though I still find C a highly useful language. Putting Lua on top of whatever needs to be low-level, written in C, provides the next-generation toolset that I find so very productive.
sudeepjabout 10 years ago
The fact that C++ is vast is well known. If a language supports some arcane things then it will end up in the code (even if its very less percentage wise). Because its arcane, most of the developers will not be able to deal with it effectively. Example of arcane: overloading comma operator.
10098about 10 years ago
Still beating the dead horse, huh?