const
They don’t do it well, but an attempt was made.
const
They don’t do it well, but an attempt was made.
To be fair, that’s an issue in almost every imperative language and even some functional languages. Rust, C, and C++ are the only imperative languages I know of that make a serious effort to restrict mutability.
Wait until you hear about rent.
Strange, I’ve never found a use for a lightning cable.
For those who, like me, have never heard of a .gitkeep file: https://stackoverflow.com/questions/7229885/what-are-the-differences-between-gitignore-and-gitkeep
Why are we looking for new technologies?
Why are we writing new software? There’s plenty already.
And being a nightmare to figure out what code is whereas they all communicate independently.
So much this. Especially in a larger company it can be basically impossible to find the code that implements an endpoint, and of course even if you can find it you can’t trace it in a debugger.
Why are you still using Windows? Switch to Linux!
For an application? Never. I’d still use it for something very small like a build script where the hassle of separate compile and run stages makes the whole thing a hassle to use. That might change now, though, since I think Node has gained the ability to execute Typescript directly.
I think a better solution would be to add a method called something like ulock that does a combined lock and unwrap.
My concern with lock+unwrap is only partly because of convenience; I also didn’t like it because I think it’s a bad idea to get people used to casually calling unwrap, because it tends to hide inadequate error handing.
Now that I think about it, I don’t like how unwrap can signal either “I know this can’t fail”, “the possible error states are too rare to care about” or “I can’t be bothered with real error handing right now”. In one or two of those cases you want to leave it in my production code, and in the last you want to audit all instances and replace them with proper error handing. Using the same function for all three cases makes that difficult.
Typescript and JavaScript are different languages and the distinction is important, especially because the two are used in conjunction with each other.
try_lock
already exists; it’s called lock
. I just want a more convenient name and I want the name of the new method to be lock
, but that ship has sailed.
Looks like the author missed my main complaint about Rust mutexes, which is that the lock
method returns a Result
. There should be a try_unlock
method for when someone actually wants to handle the rather obscure failure case, and the name lock
should be used for a method that panics on failure but returns a value that doesn’t need to be unwrapped first. I see the current arrangement as being about as sensible as having array subscripting return a Result
to handle the case of a failed bounds check.
I didn’t think you realize just how much code is written in JavaScript these days.
I’m old enough to remember when 4 of those 5 languages were the hot new thing. You’d have had me ignore them all and keep using C for everything. If I had done that I wouldn’t have even landed my first job.
There you go again flinging insults at anyone who disagrees with you.
Yeah, because the new tools are never actually better, right? If condescending luddites like you had your way we’d still be living in the literal stone age. At every step of the way, people like you have smugly said that the older, more established ways of doing things were good enough and new ways were just a fad that would die out.
Your favorite language was dismissed as fad when it was new. High level languages were a fad. Computing was a fad. Electricity was a fad. See a pattern?
Nice job projecting with the “only morons” bit, BTW, when it is in fact you who started off by denigrating people whose preferences are different from yours.
Clearly Rust is a conspiracy.
“But the plans were on display…”
“On display? I eventually had to go down to the cellar to find them.”
“That’s the display department.”
“With a flashlight.”
“Ah, well, the lights had probably gone.”
“So had the stairs.”
“But look, you found the notice, didn’t you?”
“Yes,” said Arthur, “yes I did. It was on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying ‘Beware of the Leopard.
From is run by Vogons!
And that’s where I stopped. I’m a real working programmer who’s done tons of work in C++, so I know firsthand that it absolutely sucks compared to Rust. Go back to Typescript if you hate Rust so much.