News for hackers. Stuff that matters.
Re:Ruby Methods Are Colorless by akoboldfrying on Tuesday July 23, 2024 @09:47PM (#41052899)
It's a big neon sign that says "Either this function is expensive, or it isn't but some framework somewhere that sometimes needs to call expensive functions might also need to call this function using the same syntax".
Re:Ruby Methods Are Colorless by resonious on Wednesday July 24, 2024 @09:47AM (#41057089)
This feels very true in Rust but not sure about JS. In JS you can `await` non-promise values without issue.
Re:Ruby Methods Are Colorless by lolinder on Wednesday July 24, 2024 @10:01AM (#41057228)
No, because in JavaScript/TypeScript you can happily await any function that you'd like on the chance that it sometimes returns a Promise. If a framework demands that you return a Promise unnecessarily, that's on the framework, not the language.