Why are we looking for new technologies?
Why are we writing new software? There’s plenty already.
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.
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.
“Polarize the hull plating!”
What.
JSON and YAML aren’t the same as XML. The attribute/child distinction in XML, and the fact that every object has a tag name associated with it, make it a PITA to map into the data primitives of any programming language I know.
YAML had comments and trailing commas, therefore it’s objectively better than JSON. If you want a compromise solution that mostly looks like JSON, try JSON5.
I don’t know how I feel about calling it a dye. But I also can’t think of a better word.
The article goes into a lot of detail about how it works.
Because classes kind of suck.
JSON5. it’s basically just JSON with several QoL improvements, like comments, that make it usable as a format for human consumption (as opposed to a serialization format).
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