7 ms·
Two things this doesn't mention about Rust that I think we can expect to see in new languages: 1. Version control. If you ask Cargo to make you a new Rust proj
by tialaramex 4y ago
Two things this doesn't mention about Rust that I think we can expect to see in new languages:
1. Version control. If you ask Cargo to make you a new Rust project, and you have git (which, if you're a software developer you almost certainly do) it makes you a Git repository for the new project, with its target directory ignored.
As with formatting you might have very strong opinions about revision control, or you might be subject to a company policy, maybe you must use Bob's Special Version Control Program for all Company Projects. Cargo won't stop you doing that, but if you don't have an opinion you get git which is definitely better than nothing. And if you want to, somebody can teach Cargo about Bob's SVCP and make 'svcp' one of the possible choices in the config for the few people who do care.
2. Hello World. If you ask Cargo for a new Application, the project it gives you prints "Hello, World!" because why not. Rust's boilerplate for such an application isn't very heavy, but like a blank piece of paper is intimidating when writing an essay or novel, it's nice to have something to start from. Step #1 remove the part where it prints "Hello, World!". Step #2 write my actual program. Hey, we're off to a great start already.
This also means you have a correct, valid program to check your tooling. A new Cargo Application is a Hello, World program that will compile, and run, showing that your tools work as intended before you write a single line of Rust. It doesn't have any tests, nor any documentation, but since it's a working program the test infrastructure and doc builder work, the results will just be not very exciting.
- usrnm 4y agoAny half-decent IDE created in this century gives you both these features and much more. I remember selecting the type of the new project in Visual Studio 6.0 and getting either a console "Hello, world" or a full-blown GUI application. VS 6.0 is literally older than some engineers I work with today
- HexDecOctBin 4y agoToo many people believe in the superiority of Linux as an OS for software development that they would consider it beneath them to even notice Windows toolchains, and would then be flabbergasted by the idea of project templates.
- rightbyte 4y agoIn my experience "IDE lockin" is terrible to work with in the long run. After 5+ years trying to compile old Visual Studio or Eclipse projects is a horrible experience.
- HexDecOctBin 4y agoSure, I agree, though not anymore horrible than dealing with Autotools. Shitty developer tooling is a different question (and a very important one that I trying to solve), but I am simply talking about being unaware of the simplest features because of one's ideological blinders.
- AshamedCaptain 4y agoAnd I have quite the feeling it will be identical to compiling one of these "package managed" projects whose dependencies are expressed as Github URLs.
- jiggawatts 4y agoMine is the opposite. Visual Studio makes it a breeze to pick up some random person’s work, often after decades of time if the projects can be upgraded. Even if not… I recently installed Visual Studio 2015 in a VM to build an old project and it was perfectly fine. Can it show smiley emoji in string literals? No, but it does a lot more for me as a programmer than a text editor!
- josephg 4y agoThis isn’t my experience of running old VC++ projects. They usually end up with some weird linker errors because they embed a hardcoded DLL or something which was compiled with an old version of visual studio or something. You get a lot better at fixing these errors with experience, but I’ve lost count of the number of hours I’ve lost noodling with this stuff to compile some old code. Speaking of progress, I adore this improvement in modern languages. C#, Swift, Rust and nodejs all have officially defined project configuration alongside the source code. I expect to be able to “cargo run” any of my rust programs in 50 years from now just as easily as I can today.
- tialaramex 4y ago> Any half-decent IDE created in this century gives you both these features and much more If you've paid for the expensive "Professional" Visual Studio .NET in 2002, you do indeed get version control. But it's Visual SourceSafe, which is garbage†. Fortunately, it's optional, so you probably just never switch it on (it's not default) and don't use any version control at all, so you're back to square one. If you're just using the (cheaper) Microsoft Visual C++.NET for example - whose users I imagine would have believed they had an IDE - you don't get Visual SourceSafe. As we saw that's probably no problem since you don't want VSS anyway, but it does mean you do not, in fact, get version control out of the box, you're going to need to pay Microsoft $$$ (or, try using anybody else's offerings which are better and many of them are free...) Either way, you're not getting that comparable experience. † It's markedly worse than CVS, which itself is awful. Microsoft actually sold VSS for money rather than giving it away and so there was (until 2005) a team at Microsoft maintaining it. As I understand it the revision control of the Visual SourceSafe software itself was eventually... a Perforce repo (technically "Source Depot" Microsoft's internal-use licensed fork of Perforce's software). This is not an endorsement of your confidence in your own product.
- legalcorrection 4y agoOkay but VS uses git now.
- oaiey 4y agoAt the time we happily used also tools outside of VS like CVS, SVN and then later git. Also, VS came also with TFS Version Control which was better than CVS (not much tough) or source safe.
- davidkunz 4y agoAnd with `cargo init --lib` you even get a green unit test!
- 2143 4y ago> blank piece of paper is intimidating when writing an essay or novel Who starts off of a template when writing a novel?!