TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Starting a tech startup with C++

157 点作者 n3mes1s超过 9 年前

21 条评论

ambulancechaser超过 9 年前
I would like to see one other aspect discussed though: quickness to market.<p>At my job, we are rewriting some pretty terrible vb5 code. It&#x27;s easy to just WTF a lot, and complain that there are truly insane things inside of it. The flipside of that, is that this code was quickly built and quickly allowed for a revenue stream.<p>The author mentioned that thrown away python code provides no value, but I&#x27;m not convinced of that statement. The development time could have been significantly shortened, allowing for a revenue stream while the site was rebuilt in C++. While this may seem like wasted development, it could have created incoming money at three months rather than eight months, helping keep the lights on. Further, there are conceivably problems that would come about during development that would impact their design, which they would have to figure out. Solving these problems are irrespective of the language implementation, and using a dynamic but slower language could help them nail down theoretical issues in algorithms, api, and infrastructure, before coding in the c++ system.<p>A counter point to this though, is that often, there is no budget for a rewrite. I&#x27;m wondering if they would be constrained by the prototype becomes long lasting production like in our case.
评论 #10828642 未加载
评论 #10829552 未加载
petke超过 9 年前
&gt; Manual memory management is the most popular misconception of C++. Since C++11, it is now recommended to use std::shared_ptr or std::unique_ptr for automatic memory management. There is a small computational cost to maintaining referenced pointers but it’s minuscule and the safety outweighs this cost.<p>I think another misconception is that you need pointers at all. Smart pointers are still pointers. Its better to use value semantic all the way when you can. And you usually can. Why place something on the heap if it can live on the stack?
评论 #10827070 未加载
评论 #10827092 未加载
评论 #10827281 未加载
评论 #10827065 未加载
评论 #10827084 未加载
ufmace超过 9 年前
I wonder why the choice of language is framed as being between C++ and Ruby&#x2F;Python? Yes, C++ is known for being fast while suffering from a shortage of easy libraries and being more verbose to write and intellectually challenging to write in, while the mainstream dynamic languages are known for being not so fast but having a vast array of handy, easy to integrate libraries and being fast to develop in. But I think there&#x27;s a number of choices between the two that seem worth considering.<p>C#&#x2F;.NET doesn&#x27;t get a lot of love from the startup community, but it&#x27;s mature, stable, fast, full of advanced features, and has good library support.<p>Java and other JVM languages have similar advantages and better compatibility with Unix-based OSes. Java itself is a little long in the tooth, but there is the option of alternate JVM languages.<p>I&#x27;d probably be most tempted to check out Go if I was working on something that absolutely had to wring the best possible performance out of my hardware. I don&#x27;t honestly know that much about it, but it has a reputation for getting you most of the performance of C++ without the complexity.<p>But I will say that if the author has lots of experience in C++ and comfort with the ecosystem, and not much in any of those other languages, then by all means go with C++. Getting your product out there is more important than getting the perfect language.
评论 #10828359 未加载
bnastic超过 9 年前
It&#x27;s sad that you need to justify using one of the most established and longest serving languages&#x2F;platforms ever.
评论 #10826940 未加载
评论 #10827428 未加载
评论 #10827131 未加载
pacaro超过 9 年前
I&#x27;m curious as to has this plays out at scale. If you can reduce the number of machines needed by a factor of 10, then apart from the hardware&#x2F;power savings, there are staffing savings too. Managing 1000 machines is different from managing 10,000
pcwalton超过 9 年前
&gt; There is a small computational cost to maintaining referenced pointers but it’s minuscule and the safety outweighs this cost.<p>Atomic reference counting does not have minuscule costs. See, for example, <a href="http:&#x2F;&#x2F;www.hboehm.info&#x2F;gc&#x2F;nonmoving&#x2F;html&#x2F;slide_11.html" rel="nofollow">http:&#x2F;&#x2F;www.hboehm.info&#x2F;gc&#x2F;nonmoving&#x2F;html&#x2F;slide_11.html</a><p>In particular, note that if you use shared_ptr everywhere you will be end up with much slower code than you would have if you had a good GC. In other words, you end up slower than Java, with less safety and more verbosity.<p>Browser engines have used custom non-thread-safe reference counted pointers where possible extensively for this reason.<p>Furthermore, I always have to say it: shared_ptr is not memory safe.
theyoungestgun超过 9 年前
I like these &quot;You CAN do X with Y!&quot; types of posts - especially when it&#x27;s not the same drum being banged over and over.<p>I think there&#x27;s a really big part of this case study that isn&#x27;t mentioned (perhaps because there is currently no data): bringing on more engineers. It really seems as if the number of C++ developers ready to be a part of the startup ecosystem is small. That is the impression that sites like HN leaves me with at least.
melted超过 9 年前
For databases, C&#x2F;C++ is still the only reasonable choice. For OLAP cubes in particular, you want to keep as much data in memory as possible as efficiently as possible, and drop down to SSE intrinsics where needed. C++ lets you do just that. Frontend can be in any language you like.
评论 #10829586 未加载
jlg23超过 9 年前
Not to mention the time saved in testing due to the compiler catching many errors only unit tests could catch in python.
评论 #10826914 未加载
ilya1超过 9 年前
Sounds very inspiring.<p>Any other good places to start learning about C++ 11&#x2F;14 for complete beginners with JS and other programming languages?<p>I&#x27;m very much interested to create proof-of-concept for high performance SaaS services and play with C++ as it might be useful to build Node.js extension later.
评论 #10826891 未加载
评论 #10875569 未加载
评论 #10829223 未加载
评论 #10828067 未加载
bluejekyll超过 9 年前
I&#x27;m more curious as to the decision not to stick with Rust. Sounds like there was a prototype. I&#x27;m guessing there were some libraries missing.<p>Would be cool to know more about that.
评论 #10826904 未加载
评论 #10828507 未加载
tuyguntn超过 9 年前
<i>Every word has its own place, every place has its own word</i><p>Starting startup with language X depends on how that language were used in industry, starting hardware startup with Python&#x2F;Ruby is strange, but for web startup its totally fine. Now think about creating web site in C++ with average C++ developer.<p>There is also cost of talent, if you own expert C++ developer than probably writing web site in C++ can make sense, because you have a talent who can manage and fix every bug&#x2F;feature. Finding professional Python&#x2F;Ruby web site developers are easier than finding C++ web site developer.
jgh超过 9 年前
Ah one of our core systems is in C++, though it is for video processing and needs to work with multiple platforms. I suppose nobody has questioned the C++ choice because its a more &quot;typical&quot; use-case
hakcermani超过 9 年前
Wondering how Swift will play in this arena now that is open sourced - and performance ? According to this (<a href="http:&#x2F;&#x2F;www.primatelabs.com&#x2F;blog&#x2F;2014&#x2F;12&#x2F;swift-performance" rel="nofollow">http:&#x2F;&#x2F;www.primatelabs.com&#x2F;blog&#x2F;2014&#x2F;12&#x2F;swift-performance</a>) for some workloads does approach C++.
评论 #10827049 未加载
Cshelton超过 9 年前
I think you hit the nail on the head early in the post. C++ is what you are most comfortable with. I believe that is the number one reasoning, at first at least (prototype, mvp stage), in deciding that language&#x2F;stack to use. Use what you know the best as the tech lead, everything else will fall into place.
YuriNiyazov超过 9 年前
I don&#x27;t think that<p><pre><code> auto start = std::chrono::system_clock::now(); &#x2F;&#x2F; benchmark something here auto end = std::chrono::system_clock::now(); </code></pre> is concise. I think that<p><pre><code> start, end = benchmark do # benchmark something here end </code></pre> is concise.
l1ambda超过 9 年前
<a href="https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;</a> also show the fastest HTTP servers are written in C++.
jcyw超过 9 年前
No one doubs the performance of C++. What I would really like to see is arguments about speed of development, ease of testing, etc. This articles argues alot about language features or libraries, but what about the bigger picture? It is not enough for the HTTP server be fast. It also needs to do REST API, auth, etc. How does that compare to for example node&#x2F;js.
评论 #10827452 未加载
Lumocra超过 9 年前
Aren&#x27;t a lot of startups using dynamic languages because those are more popular? We use Javascript everywhere since that makes it a lot more easy to hire new people.
steven2012超过 9 年前
The main problem I imagine is as the platform&#x2F;codebase matures, there may be compatibility issues as the compiler changes, as the underlying hardware changes, etc. This is something that is well hidden by a language like Python. I remember having to support a cross-database and cross-platform C&#x2F;C++ server back in the day, and the maintenance was a nightmare. Having the luxury of virtualizing your hardware makes this step a lot easier, that&#x27;s for sure.
samfisher83超过 9 年前
I would find it hard to believe that c++ can be that much faster for many websites since the bottleneck would be the I&#x2F;O subsystem. I don&#x27;t understand how they are getting this 40x speed up. I wonder what the benchmark looks like.
评论 #10827209 未加载
评论 #10827423 未加载
评论 #10827424 未加载
评论 #10828307 未加载