3 ms·
As a person who uses C++, I must say something that also applies, somewhat, to Java. We have all the cool kids like Kotlin, Rust, etc. However, when it is abo
by germandiago 3y ago
As a person who uses C++, I must say something that also applies, somewhat, to Java.
We have all the cool kids like Kotlin, Rust, etc.
However, when it is about finishing a project, beating C++ or Java ecosystems is almost impossible.
Besides that, C++ has improved a lot over time. It still has its warts and knives but you can code very reasonable C++ with a few guidelines and there are also linters, and -Wall -Wextra -Weverything -Werror. That takes you quite far in real life provided you have a reasonable amount of training.
I would choose C++ over Rust any day. The only hope I have for C++ successors are Cppfront and Carbon and they are highly experimental. As successors those two fit the bill.
There is a third one, my favorite. It is this one: https://www.hylo-lang.org/ https://www.hylo-lang.org/
but I am not sure how compatible it will/would be.
- no_wizard 3y agoThe one thing Rust is getting right that I hope Carbon et. al take from it is using the type system to manage memory. not having to explicitly remember `free` in safe Rust code is amazing. Knowing that if my types are sound that memory will be managed reasonably is great. I also think that immutable by default, mutable by explicit declaration is pretty great. I do think there is a lot of room to add better ergonomics on these ideas however
- germandiago 3y agoThe amount of complexity that Rust adds is not worth in most scenarios in my opinion. I can think of Rust as something for OS with critical safety or so. Besides that, in real life you end up having C in most of your software, so I am not sure how Rust behaves compared to well-written C++ with all warnings and linters on and using smart pointers. But my hypothesis is that they do not stay very far apart in safety. There are many ways to achieve safety, and the most promising, IMHO, is the path that Hylo programming language is taking. It sticks to Generic programming and mutable value semantics. The language base draws from Swift and it has very strong people behind that know what they are doing. For example David Abrahams and Sean Parent. This is an implementation in a language of many of the ideas from "Better Code" from Sean Parent. It has a very solid foundation. Besides being a solid foundation for generic programming, value semantics, and concurrency, what I like the most is how much it simplifies the model by not escaping references all around and preventing unnecessary copies. This removes the (IMHO) mess that is to have to manage reference escaping constantly in Rust, reason why many patterns such as Linked lists are not even possible. And Lists are not just an academic exercise, as I was told sometimes by Rust proponents. Linked structures (Inmutable linked structures actually) are important in scenarios such as TelCo backend where you need replication, fast moving of data and history versioning, rollbacks and so on.
- no_wizard 3y agoAll this may be true (I'm not the strongest C++ developer in the world, relatively limited exposure), however the Rust memory management via the type system feels natural once you wrap your head around it. That idea is really good. I always hated dealing with `delete`, `free` and `malloc`. Being able to offload all that busy work to the type system is just nice. There are definitely ergonomic improvements that could be made around this. All the rest? I'll leave that to someone else to talk through, as I'm no expert here.
- germandiago 3y ago> however the Rust memory management via the type system feels natural once you wrap your head around it It disallows many valid patterns. That is why I recommend to take a look at Hylo programming language (before called Val lang) to see what I think it is a very good example of how to make a language safe without making the learning curve so steep and without a need for a GC.
- no_wizard 3y agoThe way Rust does it may disallow valid patterns, but it is not inherent to the idea
- bluGill 3y agoI.write c++ all the time, and I go months between needing new or delete. Unique_ptr is a wonderful thing. Not quite as powerful as rust's borrow checker, but it saves me a lot of thinking.
- lelanthran 3y ago> The amount of complexity that Rust adds is not worth in most scenarios in my opinion. I can think of Rust as something for OS with critical safety or so. It's difficult to have this discussion in any sane way when Rust (or C) comes up. I tried Rust, but I have projects to deliver on strict timelines and I have yet to find a client who is prepared to pay me for the (what I found to be) very large onramp time to gain deep Rust expertise.[1] The argument of "just get gud" whenever you point out the deep learning curve of Rust is pointless; I have noticed that Rust experts only come when your employer is rich enough to pay the team to not deliver while they learn it: Basically only FAANGs and startups flush with VC money. [1] When I have a small project I reach for C. When I need something bigger for which C is not suitable, I don't reach for C++, or Rust, I rather take the tiny performance hit and move to Go. On extremely large projects, where I work with others, C# and Java seem to hit the sweet spot.[2] [2] Although, C# and Java are also getting a bit too complicated for my tastes too. Seems to me that every language follows C++ evolution towards complexity, because the people stewarding the language are experts in that language and/or in programming language theory.[3] They are comfortable with the changes they propose because they have no need to upskill (they are already at that skill level). [3] I propose that a language designed by your average corporate developer who has 15 years of experience but no CS degree will have much higher adoption than languages designed by PL purists.
- bb88 3y ago> However, when it is about finishing a project, beating C++ or Java ecosystems is almost impossible. Yet, somehow people do this with python, perl, and ruby. Google hires professional python people too.
- hbrn 3y agoNot only do this, but do it way more successfully. I'll never get tired of repeating that among top YC startups, Java as a primary language contributes to roughly 1% of value, while Python + Ruby are almost at 70%. https://charliereese.ca/y-combinator-top-50-software-startups/ https://charliereese.ca/y-combinator-top-50-software-startup...
- germandiago 3y agoIf by successfully you mean time to market, for sure you are right. C++ gives more return when you start to save in infra because you have a more efficient language, if coded properly. Same goes for Go vs Python. The right tool for the right job. I would use (and will, I am on it) Django for a SaaS that I have for the backend. If things start to work relatively well, then, I will keep identifying, if there are, bottlenecks and migrate with a hybrid architecture parts of the workload to C++. This allows me to save in infrastructure bills.
- fuzztester 3y agoHylo page says it was formerly Val. IIRC, Val has been mentioned on HN sometimes earlier.