Earlier quoted context omitted.
> 6 different string types have fun living your life pretending all strings are of the same type. spoiler alert: it's the wrong kind of fun. it's a bit easier if you're from a native English speaking country, but only until you get blown up by utf-8 (if you're lucky) in production.
It's common in other programming languages for string literals to have type string. It's weird and confusing that they do not in both Rust and in C++.
It's time to halt starting any new projects in C/C++
591–600 of 929 posts
Re: It's time to halt starting any new projects in C/C++
#592Earlier quoted context omitted.
This is a tricky subject. Rust being a low-level library, adding something means inherently choosing a preferred approach to a problem rather than another, which may be disagreeble. The consequence is that there would be still the sub-sub-dependencies problem, because the author of a crate may decide that the stdlib implementation is not appropriate for the use-case (Rust is low-level; low-level development is typica…
Clearly different people have different needs. Having two distinct "products" could help here. There could be a "bare rust" that is minimal and unopinionated, and used by those that need a small footprint, for example. A "battery included rust" could have common solutions to common problems that are hard to solve with "bare rust", at the expense of making choices that are best avoided for "bare rust". My current outs…
There is already, it's the nostd.
Re: It's time to halt starting any new projects in C/C++
#593As much as I like rust, I feel the statement is a bit premature. Rust has only one real compiler and no independent language standard. Rust is also the only alternative that is really being discussed most places. For an idea as major as "deprecate C/C++" you really want a couple solid alternatives. Rust is not perfect for everything, and so its easy to pick on the weaknesses and say "that's why we're sticking with C/…
I never understood why it is a problem for some people. Single compiler means more people working on it instead of recreating same work multiple times (modules and coroutines are still not fully supported across all 3 biggest compilers).
Re: It's time to halt starting any new projects in C/C++
#594Someone else downthread: "young developers can pick up Rust quite fast, and that makes it vastly easier than trying to find talented C/C++ developers." I hope so. I have a hypothesis that the big-O for language success is "How easily can new programmers learn it?" Nothing else matter. JavaScript was slow, but everyone learned it, so it got fast. Python still had bad tooling, but everyone learned it, so it got better.…
Ok, so I hate to be too direct but the rust enthusiasm always struck me as annoying like the meme about arch users telling everyone they use arch and so should you, but on that token, I always felt it strange given it's literally over something as mundane as a programming language choice. BUT, this as a reason seems to explain a lot more for why evangelists, particularly those in management type positions in large IT…
Re: It's time to halt starting any new projects in C/C++
#595Earlier quoted context omitted.
C++ has grown several language tools to let you write reliable, safe code. ... But it can't shed the old stuff without breaking backwards compatibility, and that's what bites you. The fact that smart pointers exist now doesn't stop a developer from passing around non -const char* with no size specifier and calling that a "buffer," and because the language is so old and accreted most of its safety features later, the…
It can't shed the old stuff, but it is very, very suspicious -- smelly -- when any of it appears in new code.
If your developers are coming to the table with some C++ tutorial books written a decade ago, good luck. Invest in a decent linter and opinionated format checker.
Re: It's time to halt starting any new projects in C/C++
#596Earlier quoted context omitted.
Stuff like Slotmap should be part of the standard library instead of some github project with open issues that isn't updated for over a year.
I just glanced through the small number of open issues, and none seem like actual issues so much as potential improvements. The maintainer seems to still be around, and I've never found that a standard library is faster at merging improvements than third party libraries, rather the exact opposite (for good reason, the standard library needs to avoid breaking changes at nearly all costs). While I think there are valid…
Re: It's time to halt starting any new projects in C/C++
#597Earlier quoted context omitted.
No Rust Evangelist is out there thinking, "Hm, how do I put C/C++ developers out of business today"
I see you do not have much contact with Rust evangelists.
Do you not see the difference?
Re: It's time to halt starting any new projects in C/C++
#598I'm just a programmer who's been doing this for 20 years. I don't have the credentials of Mark, who is a legend. But I fully agree with him. There will be specific exceptions, but if you have the choice between Rust and C++ you would be making a big mistake to not choose Rust. The language is simpler, cleaner, safer, and more enjoyable to work with. The build tools are far more pleasant. The IDE experience is compara…
The ratio of C++/rust jobs where I am (EU country) is 5564/54. And these 54 jobs are mostly in cryptocurrencies.
Re: It's time to halt starting any new projects in C/C++
#599Earlier quoted context omitted.
If you're commanding officer orders a bayonet charge in the late 19th century it is safe to say they don't understand the change rifles have brought to the fight. Reference Picket's charge.
I was saying a commanders accuracy with a rifle isn’t relevant to their ability to decide tactics or strategy. Nothing you’ve said contradicts what I said.
Re: It's time to halt starting any new projects in C/C++
#600Earlier quoted context omitted.
Is anyone attempting to do the same with C though? Carbon & cppfront, if successful, would only "save" C++. C would still be left out to dry. Then again, the C committee is also pretty much phoning it in and has been for quite a while now.
Yes. Microsoft Research is working on "Checked C": https://www.microsoft.com/en-us/research/project/checked-c/ As a test, someone ported FreeBSD's networking stack to Checked C. It was easy and there was no overhead to performance and binary size.