Live data from Hacker News

Starting a tech startup with C++

medium.com

21–30 of 107 posts

Re: Starting a tech startup with C++

#21

Wondering how Swift will play in this arena now that is open sourced - and performance ? According to this ( http://www.primatelabs.com/blog/2014/12/swift-performance ) for some workloads does approach C++.

What's the state of Swift for web development? Are web frameworks starting to appear?

Re: Starting a tech startup with C++

#22
post #21

Wondering how Swift will play in this arena now that is open sourced - and performance ? According to this ( http://www.primatelabs.com/blog/2014/12/swift-performance ) for some workloads does approach C++.

What's the state of Swift for web development? Are web frameworks starting to appear?

[deleted]

Re: Starting a tech startup with C++

#23
post #16

> 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. I think another misconception is that you need pointers at all. Smart pointers are still pointers. Its better to us…

It's true that stack allocation is often better, and should be preferred, but that doesn't mean the heap isn't useful.

Re: Starting a tech startup with C++

#24
post #16

> 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. I think another misconception is that you need pointers at all. Smart pointers are still pointers. Its better to us…

Well said! Dynamic memory allocation is a really big performance hit, and in a lot of cases you can pre-allocate data structures on the stack for serious speed improvements. Avoiding DMA was one of the secrets for writing blazing fast real time systems stuff when I was in telecom. I don't think those benefits have gone away.

Re: Starting a tech startup with C++

#25
post #21

Wondering how Swift will play in this arena now that is open sourced - and performance ? According to this ( http://www.primatelabs.com/blog/2014/12/swift-performance ) for some workloads does approach C++.

What's the state of Swift for web development? Are web frameworks starting to appear?

[deleted]

Re: Starting a tech startup with C++

#26
post #16

> 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. I think another misconception is that you need pointers at all. Smart pointers are still pointers. Its better to us…

Because copying the entire in-memory database you're using on every function call is kind of expensive?

Re: Starting a tech startup with C++

#27
post #17
post #10

Earlier quoted context omitted.

Programming - principles and practice using C++[1] should be appropriate for beginners. It's a long book at 1000+ pages, but it is designed for novices and explains subjects such as why one needs functions, how to handle errors, GUIs, testing, etc. The C++ Programming language (4th ed)[2] is for experienced programmers. A tour of C++ is the short version of the former.[3] [1]: http://www.stroustrup.com/programming.ht…

Ohh... thnx! Nothing changed since I graduated in 2001 ... I recollect Stroustrup since then. It's still C++ bible.

In the language many things changed and you should look a the books which focus on C++11/14 no the old stuff.

Re: Starting a tech startup with C++

#28
post #16

> 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. I think another misconception is that you need pointers at all. Smart pointers are still pointers. Its better to us…

You mean C++ programmers allocate n object on the heap even when its lifetime is the same as the scope of the containing block ?

Unless its such a large huge object that stackoverflow is a possibility I cant imagine why would one do that.

Re: Starting a tech startup with C++

#29
post #26
post #16

> 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. I think another misconception is that you need pointers at all. Smart pointers are still pointers. Its better to us…

Because copying the entire in-memory database you're using on every function call is kind of expensive?

C++ has perfect move semantics since C++11, and you can always use a reference to pass things around if you need.

Re: Starting a tech startup with C++

#30
post #4

It's sad that you need to justify using one of the most established and longest serving languages/platforms ever.

Indeed it is. It wouldn't be this way if most hiring companies hired for talent and not buzzwords/trends. As it stands, half of developers don't want to touch a language that won't help them get another job. The other half suck so they have to pad their resumes with the new hotness to even have a chance at getting a job.
Post reply on HN