4 ms·
The difference that at same level of let's say "UB bugs in code", C++ code will compile, Rust will not. So person learning C++ will start producing code quicker
by adql 4y ago
The difference that at same level of let's say "UB bugs in code", C++ code will compile, Rust will not. So person learning C++ will start producing code quicker even if their level of competence will produce more buggier code.
- nequo 4y ago> will start producing code quicker This will reinforce bad patterns early on which they will have to unlearn through bug hunting or reading about the edge cases and foot guns.
- nwienert 4y agoOr maybe it allows them to complete a fun side project quick enough that they keep their interest in programming altogether.
- dhosek 4y agoI’ll say that when I started working on finl a couple years ago, I started in C++ (employing 20+-year-old memories of the language). When I switched to Rust, starting from zero, I found myself instantly productive. Yes, there are some things that are harder, but in general, the if it compiles, it works rule holds for Rust. I can still remember some rather disturbing bugs that should never have even compiled in some of my early C code (e.g., treating argv values as if they were variables and could be modified in place).
- nequo 4y ago> keep their interest in programming altogether Python will do that too and without reinforcing patterns that produce UB.
- Filligree 4y agoAlthough Python is getting long a little in the tooth. It used to be a simple, easy to learn language, but who can honestly claim its async implementation is 'simple and easy to learn'? I'm curious if there are any newer alternatives that fit in the same niche.
- entelechy0 4y ago[dead]
- swsieber 4y agoIt still is a simple, easy to learn language. But now if you want to do more complex things with it (async), you can. Of course, that means that it doesn't fit in that niche - it fills it and then some.
- sanderjd 4y agoThey didn't complete it though, if it doesn't work.
- estebank 4y agoThere's a wide gulf between "one-off afternoon-long project done for fun" and "serving all traffic for amazon.com during black friday", so I am receptive to the "I can just do this one off thing in Perl". On the other hand I know that once you get familiar with Rust it can be very productive (the "it hurts when I do that" stops when you learn to preemptively "don't do that" and stop fearing "this code is inefficient because it has two extra allocations!!!1") and I've seen too many "weekend projects" become the backbone of large enterprises. Rust's superpower is being able to scale up and down. But the GP might be talking about a project that falls squarely on the former. Anything that starts to move towards the later, I would immediately push for a language/ecosystem more tuned for "maintainability" than "time to first char on screen".
- sanderjd 4y agoIndeed, I agree.
- sanderjd 4y agoThis doesn't make sense as a metric though. The goal of software development is not to write code that compiles, it is to have an executing software system that does the right thing.
- codemac 4y ago> The goal of software development is not to write code that compiles, it is to have an executing software system that does the right thing. But there are many UB-laden, compilable C++ programs that produce the right result, they just are implemented with bad, non-standard, leaky code. Rust and other languages that detect this bad code and force you to remove it are harder to start with, because you need to learn everything to get to a running program. Interactive development (especially REPLs!) have shown time and time again that it speeds up the learning process. Rust takes the inverse approach imo.
- sanderjd 4y agoI use debuggers in languages like rust or go very similarly to how I use repls in languages like python. But I do think interpreted languages have a distinct advantage on this front! Which is why rust (or c++, or go) isn't the best tool for every job.